binnev-python-template 5.3.0__tar.gz → 6.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/PKG-INFO +5 -26
  2. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/binnev_python_template.egg-info/PKG-INFO +5 -26
  3. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/binnev_python_template.egg-info/SOURCES.txt +0 -7
  4. binnev_python_template-6.0.1/binnev_python_template.egg-info/requires.txt +6 -0
  5. binnev_python_template-6.0.1/binnev_python_template.egg-info/top_level.txt +1 -0
  6. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/pyproject.toml +17 -10
  7. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/src/core/__init__.py +1 -1
  8. binnev_python_template-5.3.0/binnev_python_template.egg-info/requires.txt +0 -26
  9. binnev_python_template-5.3.0/binnev_python_template.egg-info/top_level.txt +0 -1
  10. binnev_python_template-5.3.0/src/__init__.py +0 -0
  11. binnev_python_template-5.3.0/src/api/__init__.py +0 -1
  12. binnev_python_template-5.3.0/src/api/app.py +0 -7
  13. binnev_python_template-5.3.0/src/api/calculator.py +0 -75
  14. binnev_python_template-5.3.0/src/cli/__init__.py +0 -0
  15. binnev_python_template-5.3.0/src/cli/calculator.py +0 -98
  16. binnev_python_template-5.3.0/src/cli/greeter.py +0 -57
  17. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/README.md +0 -0
  18. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/binnev_python_template.egg-info/dependency_links.txt +0 -0
  19. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/binnev_python_template.egg-info/entry_points.txt +0 -0
  20. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/setup.cfg +0 -0
  21. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/src/core/calculator.py +0 -0
  22. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/src/core/greeter.py +0 -0
  23. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/tests/test_api.py +0 -0
  24. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/tests/test_async_stuff.py +0 -0
  25. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/tests/test_calculator.py +0 -0
  26. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/tests/test_cli.py +0 -0
  27. {binnev_python_template-5.3.0 → binnev_python_template-6.0.1}/tests/test_greeter.py +0 -0
@@ -1,37 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binnev-python-template
3
- Version: 5.3.0
3
+ Version: 6.0.1
4
4
  Summary: Add your description here
5
5
  Author-email: Robin Neville <robin.m.neville@gmail.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/binnev/python-template
8
8
  Requires-Python: >=3.13
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: fastapi>=0.115.12
11
- Requires-Dist: httpx>=0.28.1
12
- Requires-Dist: typer>=0.15.4
13
- Requires-Dist: uvicorn>=0.34.2
14
- Provides-Extra: dev
15
- Requires-Dist: pytest>=8.3.5; extra == "dev"
16
- Requires-Dist: pytest-asyncio>=1.0.0; extra == "dev"
17
- Requires-Dist: pytest-dotenv>=0.5.2; extra == "dev"
18
- Requires-Dist: pytest-watcher>=0.4.3; extra == "dev"
19
- Requires-Dist: pytest-cov>=6.1.1; extra == "dev"
20
- Requires-Dist: pytest-xdist>=3.6.1; extra == "dev"
21
- Requires-Dist: pytest-sugar>=1.0.0; extra == "dev"
22
- Requires-Dist: pytest-better-parametrize>=0.2.0; extra == "dev"
23
- Requires-Dist: coverage>=7.8.0; extra == "dev"
24
- Requires-Dist: ruff>=0.11.10; extra == "dev"
25
- Requires-Dist: mypy>=1.15.0; extra == "dev"
26
- Requires-Dist: mkdocs>=1.6.1; extra == "dev"
27
- Requires-Dist: mkdocs-material>=9.6.14; extra == "dev"
28
- Requires-Dist: mkdocstrings[python]>=0.29.1; extra == "dev"
29
- Requires-Dist: mkdocs-mermaid2-plugin>=1.2.1; extra == "dev"
30
- Requires-Dist: mike>=2.1.3; extra == "dev"
31
- Requires-Dist: commitizen>=4.7.2; extra == "dev"
32
- Requires-Dist: pre-commit>=4.2.0; extra == "dev"
33
- Requires-Dist: build>=1.2.2.post1; extra == "dev"
34
- Requires-Dist: twine>=6.1.0; extra == "dev"
10
+ Provides-Extra: cli
11
+ Requires-Dist: typer>=0.27.3; extra == "cli"
12
+ Provides-Extra: api
13
+ Requires-Dist: fastapi[standard]>=0.162.0; extra == "api"
35
14
 
36
15
  # Python project template
37
16
  This project is a template for new python projects. It contains up-to-date tooling for tests, docs, versioning, and dependency management.
@@ -1,37 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: binnev-python-template
3
- Version: 5.3.0
3
+ Version: 6.0.1
4
4
  Summary: Add your description here
5
5
  Author-email: Robin Neville <robin.m.neville@gmail.com>
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/binnev/python-template
8
8
  Requires-Python: >=3.13
9
9
  Description-Content-Type: text/markdown
10
- Requires-Dist: fastapi>=0.115.12
11
- Requires-Dist: httpx>=0.28.1
12
- Requires-Dist: typer>=0.15.4
13
- Requires-Dist: uvicorn>=0.34.2
14
- Provides-Extra: dev
15
- Requires-Dist: pytest>=8.3.5; extra == "dev"
16
- Requires-Dist: pytest-asyncio>=1.0.0; extra == "dev"
17
- Requires-Dist: pytest-dotenv>=0.5.2; extra == "dev"
18
- Requires-Dist: pytest-watcher>=0.4.3; extra == "dev"
19
- Requires-Dist: pytest-cov>=6.1.1; extra == "dev"
20
- Requires-Dist: pytest-xdist>=3.6.1; extra == "dev"
21
- Requires-Dist: pytest-sugar>=1.0.0; extra == "dev"
22
- Requires-Dist: pytest-better-parametrize>=0.2.0; extra == "dev"
23
- Requires-Dist: coverage>=7.8.0; extra == "dev"
24
- Requires-Dist: ruff>=0.11.10; extra == "dev"
25
- Requires-Dist: mypy>=1.15.0; extra == "dev"
26
- Requires-Dist: mkdocs>=1.6.1; extra == "dev"
27
- Requires-Dist: mkdocs-material>=9.6.14; extra == "dev"
28
- Requires-Dist: mkdocstrings[python]>=0.29.1; extra == "dev"
29
- Requires-Dist: mkdocs-mermaid2-plugin>=1.2.1; extra == "dev"
30
- Requires-Dist: mike>=2.1.3; extra == "dev"
31
- Requires-Dist: commitizen>=4.7.2; extra == "dev"
32
- Requires-Dist: pre-commit>=4.2.0; extra == "dev"
33
- Requires-Dist: build>=1.2.2.post1; extra == "dev"
34
- Requires-Dist: twine>=6.1.0; extra == "dev"
10
+ Provides-Extra: cli
11
+ Requires-Dist: typer>=0.27.3; extra == "cli"
12
+ Provides-Extra: api
13
+ Requires-Dist: fastapi[standard]>=0.162.0; extra == "api"
35
14
 
36
15
  # Python project template
37
16
  This project is a template for new python projects. It contains up-to-date tooling for tests, docs, versioning, and dependency management.
@@ -6,13 +6,6 @@ binnev_python_template.egg-info/dependency_links.txt
6
6
  binnev_python_template.egg-info/entry_points.txt
7
7
  binnev_python_template.egg-info/requires.txt
8
8
  binnev_python_template.egg-info/top_level.txt
9
- src/__init__.py
10
- src/api/__init__.py
11
- src/api/app.py
12
- src/api/calculator.py
13
- src/cli/__init__.py
14
- src/cli/calculator.py
15
- src/cli/greeter.py
16
9
  src/core/__init__.py
17
10
  src/core/calculator.py
18
11
  src/core/greeter.py
@@ -0,0 +1,6 @@
1
+
2
+ [api]
3
+ fastapi[standard]>=0.162.0
4
+
5
+ [cli]
6
+ typer>=0.27.3
@@ -2,27 +2,28 @@
2
2
  urls = { Homepage = "https://github.com/binnev/python-template" }
3
3
 
4
4
  name = "binnev-python-template"
5
- version = "5.3.0"
5
+ version = "6.0.1"
6
6
  authors = [{ name = "Robin Neville", email = "robin.m.neville@gmail.com" }]
7
7
  description = "Add your description here"
8
8
  readme = "README.md"
9
9
  requires-python = ">=3.13"
10
10
  license = "MIT"
11
- dependencies = [
12
- "fastapi>=0.115.12",
13
- "httpx>=0.28.1",
14
- "typer>=0.15.4",
15
- "uvicorn>=0.34.2",
16
- ]
11
+ # These are core dependencies that are always included when publishing to pypi
12
+ dependencies = []
17
13
 
18
14
  [project.scripts]
19
15
  calculator = "src.cli.calculator:calculator_app"
20
16
  greeter = "src.cli.greeter:greeter_app"
21
17
 
22
- [tool.setuptools.packages.find]
23
- include = ["src*"]
24
-
18
+ # These are optional dependencies that ARE included when publishing to pypi, but
19
+ # the consumer needs to explicitly request them e.g. `uv add myproject[cli]`
25
20
  [project.optional-dependencies]
21
+ cli = ["typer>=0.27.3"] # `uv tool install binnev-python-template[cli]`
22
+ api = ["fastapi[standard]>=0.162.0"]
23
+
24
+ # These are local-only dev dependencies which are NOT included when publishing
25
+ # to pypi
26
+ [dependency-groups]
26
27
  dev = [
27
28
  "pytest>=8.3.5",
28
29
  "pytest-asyncio>=1.0.0",
@@ -46,6 +47,12 @@ dev = [
46
47
  "twine>=6.1.0",
47
48
  ]
48
49
 
50
+ [tool.setuptools]
51
+ packages = ["libname"]
52
+
53
+ [tool.setuptools.package-dir]
54
+ libname = "src/core"
55
+
49
56
  [tool.pytest.ini_options]
50
57
  asyncio_mode = "auto"
51
58
  asyncio_default_fixture_loop_scope = "session"
@@ -1,2 +1,2 @@
1
1
  __app_name__ = "python-template"
2
- __version__ = "5.3.0"
2
+ __version__ = "6.0.1"
@@ -1,26 +0,0 @@
1
- fastapi>=0.115.12
2
- httpx>=0.28.1
3
- typer>=0.15.4
4
- uvicorn>=0.34.2
5
-
6
- [dev]
7
- pytest>=8.3.5
8
- pytest-asyncio>=1.0.0
9
- pytest-dotenv>=0.5.2
10
- pytest-watcher>=0.4.3
11
- pytest-cov>=6.1.1
12
- pytest-xdist>=3.6.1
13
- pytest-sugar>=1.0.0
14
- pytest-better-parametrize>=0.2.0
15
- coverage>=7.8.0
16
- ruff>=0.11.10
17
- mypy>=1.15.0
18
- mkdocs>=1.6.1
19
- mkdocs-material>=9.6.14
20
- mkdocstrings[python]>=0.29.1
21
- mkdocs-mermaid2-plugin>=1.2.1
22
- mike>=2.1.3
23
- commitizen>=4.7.2
24
- pre-commit>=4.2.0
25
- build>=1.2.2.post1
26
- twine>=6.1.0
File without changes
@@ -1 +0,0 @@
1
- from .app import app as app
@@ -1,7 +0,0 @@
1
- from fastapi import FastAPI
2
-
3
- from .calculator import calculator_router
4
-
5
- app = FastAPI()
6
-
7
- app.include_router(calculator_router, prefix="/calculator")
@@ -1,75 +0,0 @@
1
- from fastapi import APIRouter, HTTPException
2
-
3
- from src.core import calculator
4
-
5
- calculator_router = APIRouter()
6
-
7
-
8
- @calculator_router.get("/add")
9
- def add(a: float, b: float):
10
- """
11
- Endpoint to add two numbers.
12
-
13
- Args:
14
- a (float): The first number to add.
15
- b (float): The second number to add.
16
-
17
- Returns:
18
- dict: The result of the addition.
19
- """
20
- result = calculator.add(a, b)
21
- return {"result": result}
22
-
23
-
24
- @calculator_router.get("/subtract")
25
- def subtract(a: float, b: float):
26
- """
27
- Endpoint to subtract two numbers.
28
-
29
- Args:
30
- a (float): The number to subtract from.
31
- b (float): The number to subtract.
32
-
33
- Returns:
34
- dict: The result of the subtraction.
35
- """
36
- result = calculator.subtract(a, b)
37
- return {"result": result}
38
-
39
-
40
- @calculator_router.get("/multiply")
41
- def multiply(a: float, b: float):
42
- """
43
- Endpoint to multiply two numbers.
44
-
45
- Args:
46
- a (float): The first number to multiply.
47
- b (float): The second number to multiply.
48
-
49
- Returns:
50
- dict: The result of the multiplication.
51
- """
52
- result = calculator.multiply(a, b)
53
- return {"result": result}
54
-
55
-
56
- @calculator_router.get("/divide")
57
- def divide(a: float, b: float):
58
- """
59
- Endpoint to divide two numbers.
60
-
61
- Args:
62
- a (float): The numerator.
63
- b (float): The denominator.
64
-
65
- Returns:
66
- dict: The result of the division.
67
-
68
- Raises:
69
- HTTPException: If division by zero is attempted.
70
- """
71
- try:
72
- result = calculator.divide(a, b)
73
- return {"result": result}
74
- except ValueError as e:
75
- raise HTTPException(status_code=400, detail=str(e))
File without changes
@@ -1,98 +0,0 @@
1
- """
2
- This module provides CLI commands for performing basic arithmetic operations.
3
-
4
- It uses the `typer` library to define commands for addition, subtraction,
5
- multiplication, and division. Each command takes two numbers as input and prints
6
- the result to the console.
7
-
8
- The module relies on the `core.calculator` module for the actual arithmetic
9
- operations.
10
- """
11
-
12
- from typing import Optional
13
-
14
- import typer
15
-
16
- from src import core
17
- from src.core import calculator
18
-
19
- calculator_app = typer.Typer()
20
-
21
-
22
- @calculator_app.command()
23
- def add(a: float, b: float) -> None:
24
- """
25
- Add two numbers.
26
-
27
- Args:
28
- a (float): The first number to add.
29
- b (float): The second number to add.
30
- """
31
- result = calculator.add(a, b)
32
- typer.echo(f"The result of addition is: {result}")
33
-
34
-
35
- @calculator_app.command()
36
- def subtract(a: float, b: float) -> None:
37
- """
38
- Subtract two numbers.
39
-
40
- Args:
41
- a (float): The number to subtract from.
42
- b (float): The number to subtract.
43
- """
44
- result = calculator.subtract(a, b)
45
- typer.echo(f"The result of subtraction is: {result}")
46
-
47
-
48
- @calculator_app.command()
49
- def multiply(a: float, b: float) -> None:
50
- """
51
- Multiply two numbers.
52
-
53
- Args:
54
- a (float): The first number to multiply.
55
- b (float): The second number to multiply.
56
- """
57
- result = calculator.multiply(a, b)
58
- typer.echo(f"The result of multiplication is: {result}")
59
-
60
-
61
- @calculator_app.command()
62
- def divide(a: float, b: float) -> None:
63
- """
64
- Divide two numbers.
65
- Args:
66
- a (float): The numerator.
67
- b (float): The denominator.
68
- """
69
- try:
70
- result = calculator.divide(a, b)
71
- typer.echo(f"The result of division is: {result}")
72
- except ValueError as e:
73
- typer.echo(f"Error: {e}")
74
-
75
-
76
- def _version_callback(value: bool) -> None:
77
- if value:
78
- typer.echo(f"{core.__app_name__} v{core.__version__}")
79
- raise typer.Exit()
80
-
81
-
82
- @calculator_app.callback()
83
- def main(
84
- version: Optional[bool] = typer.Option(
85
- None,
86
- "--version",
87
- "-v",
88
- help="Show the application's version and exit.",
89
- callback=_version_callback,
90
- is_eager=True,
91
- ),
92
- ) -> None:
93
- """Handles the --version flag"""
94
- return
95
-
96
-
97
- if __name__ == "__main__":
98
- calculator_app()
@@ -1,57 +0,0 @@
1
- """
2
- This module provides CLI commands for greeting people.
3
-
4
- The module relies on the `core.greeter` module for the actual greeting logic.
5
- """
6
-
7
- from typing import Annotated, Optional
8
-
9
- import typer
10
-
11
- from src import core
12
- from src.core import greeter
13
-
14
- greeter_app = typer.Typer()
15
-
16
-
17
- @greeter_app.command()
18
- def greet(
19
- name: Annotated[
20
- str,
21
- typer.Argument(help="The name of the person to greet."),
22
- ] = "",
23
- ) -> None:
24
- """
25
- Greet someone.
26
-
27
- Args:
28
- name: The name of the person to greet. If name is omitted, the world
29
- will be greeted.
30
- """
31
- greeting = greeter.greeting(name)
32
- typer.echo(greeting)
33
-
34
-
35
- def _version_callback(value: bool) -> None:
36
- if value:
37
- typer.echo(f"{core.__app_name__} v{core.__version__}")
38
- raise typer.Exit()
39
-
40
-
41
- @greeter_app.callback()
42
- def main(
43
- version: Optional[bool] = typer.Option(
44
- None,
45
- "--version",
46
- "-v",
47
- help="Show the application's version and exit.",
48
- callback=_version_callback,
49
- is_eager=True,
50
- ),
51
- ) -> None:
52
- """Handles the --version flag"""
53
- return
54
-
55
-
56
- if __name__ == "__main__":
57
- greeter_app()