Skip to content

Commit

Permalink
Setup basic CLI project with typer and all instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Man Parvesh Singh Randhawa committed Oct 4, 2024
1 parent a993f5f commit 212a9ed
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ celerybeat.pid
# SageMath parsed files
*.sage.py

.idea

# Environments
.env
.venv
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Yoda PA

PyPi link: https://pypi.org/project/yodapa/

## Development setup

```bash
# 1. Install poetry from their website: https://python-poetry.org/docs/#installation

# 2. Install dependencies and this package
poetry install

# 3. Activate the virtual environment
poetry shell

# Now you should be able to communicate with yoda
yoda --help
```
34 changes: 0 additions & 34 deletions main.py

This file was deleted.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ description = "Personal Assistant on the command line"
authors = ["Man Parvesh Singh Randhawa <[email protected]>"]
license = "MIT"
readme = "README.md"
packages = [
{ include = "yodapa", from = "src" }
]

[tool.poetry.dependencies]
python = "^3.9"
Expand All @@ -17,3 +20,6 @@ pytest = "^8.3.3"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
yoda = "cli.yoda:app"
Empty file added src/cli/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions src/cli/yoda.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import typer
from yodapa import hi

app = typer.Typer()

@app.command()
def hello(name: str):
"""Greet someone by name."""
typer.echo(hi.hu(name))

if __name__ == "__main__":
app()
Empty file added src/yodapa/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions src/yodapa/hi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def hu(s: str) -> str:
return f"Hellowww {s}"
1 change: 0 additions & 1 deletion yodapa/__init__.py

This file was deleted.

2 changes: 0 additions & 2 deletions yodapa/hi.py

This file was deleted.

0 comments on commit 212a9ed

Please sign in to comment.