Skip to content

Commit bcbd974

Browse files
Reorganize for Poetry
1 parent aeec4ec commit bcbd974

File tree

7 files changed

+30
-7
lines changed

7 files changed

+30
-7
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
.env
22
/__pycache__
3-
.vscode
3+
.vscode
4+
/spacesay/__pycache__
5+
/dist
6+
poetry.lock

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[tool.poetry]
2+
name = "spacesay"
3+
version = "0.1.0"
4+
description = "A CLI spaceman tells you where the ISS is!"
5+
authors = ["AlgorithmEnigma <[email protected]>"]
6+
readme = "README.md"
7+
8+
[tool.poetry.scripts]
9+
spacesay = "spacesay.main:app"
10+
11+
[tool.poetry.dependencies]
12+
python = "^3.10"
13+
typer = {extras = ["all"], version = "^0.7.0"}
14+
python-dotenv = "^0.21.1"
15+
requests = "^2.28.2"
16+
17+
18+
[build-system]
19+
requires = ["poetry-core"]
20+
build-backend = "poetry.core.masonry.api"

spacesay/__init__.py

Whitespace-only changes.
File renamed without changes.

main.py renamed to spacesay/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
from typing import Optional
33
from dotenv import load_dotenv
44

5-
from location import iss_location
6-
from speech import speech_bubble
5+
from spacesay.location import iss_location
6+
from spacesay.speech import speech_bubble
77

88

99
load_dotenv() # Export dotenv into enviroment
@@ -30,6 +30,10 @@
3030
"""
3131

3232

33+
app = typer.Typer()
34+
35+
36+
@app.command()
3337
def main(text: Optional[str] = typer.Argument(None)):
3438
if text is None:
3539
location_time = iss_location()
@@ -39,7 +43,3 @@ def main(text: Optional[str] = typer.Argument(None)):
3943
speech_bubble(text)
4044

4145
print(astronaut)
42-
43-
44-
if __name__ == "__main__":
45-
typer.run(main)
File renamed without changes.

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)