Skip to content

Commit 6fc5d64

Browse files
committed
Cleanup Python version handling
1 parent ffae0aa commit 6fc5d64

File tree

5 files changed

+31
-37
lines changed

5 files changed

+31
-37
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1515
// "forwardPorts": [],
1616
// Use 'postCreateCommand' to run commands after the container is created.
17-
"postCreateCommand": "uv sync"
17+
"postCreateCommand": "uv pip install -e ."
1818
// Configure tool-specific properties.
1919
// "customizations": {},
2020
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.

docs/conf.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,13 @@
22
#
33
# For the full list of built-in configuration values, see the documentation:
44
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5-
import os
6-
import sys
7-
sys.path.append(os.path.abspath('../src'))
85

96
# -- Project information -----------------------------------------------------
107
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
118

129
project = 'Python Training Project by devminds GmbH'
13-
copyright = '2024, Andreas, Thomas'
1410
author = 'Andreas, Thomas'
15-
16-
# Note: this requires the python_training_project package to be installed
17-
from python_training_project.version import version # noqa
18-
# The full version, including alpha/beta/rc tags
19-
release = version
11+
copyright = '2024, Andreas, Thomas'
2012

2113
# -- General configuration ---------------------------------------------------
2214
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ dependencies = [
2525
]
2626
dynamic = ["version"]
2727

28-
[project.optional-dependencies]
29-
dev = [
28+
[project.urls]
29+
"Homepage" = "https://github.com/devminds-ch/project-python"
30+
"Bug Tracker" = "https://github.com/devminds-ch/project-python/issues"
31+
32+
[project.scripts]
33+
python_training_project = "python_training_project.__main__:cli"
34+
35+
[tool.uv]
36+
dev-dependencies = [
3037
"coverage",
3138
"flake8",
3239
"mypy",
@@ -39,13 +46,6 @@ dev = [
3946
"sphinx-rtd-theme",
4047
]
4148

42-
[project.urls]
43-
"Homepage" = "https://github.com/devminds-ch/project-python"
44-
"Bug Tracker" = "https://github.com/devminds-ch/project-python/issues"
45-
46-
[project.scripts]
47-
python_training_project = "python_training_project.__main__:cli"
48-
4949
[tool.setuptools_scm]
5050
write_to = "src/python_training_project/version.py"
5151

src/python_training_project/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
"""
22
The main entry point contains the command line interface.
33
"""
4-
import click
54
import logging
65
import sys
76

7+
import click
8+
89
from python_training_project.calculate import sum
9-
from python_training_project.version import version
1010

1111
log = logging.getLogger(__name__)
1212

1313

1414
@click.group()
15-
@click.version_option(version)
15+
@click.version_option()
1616
def cli():
1717
"""Python Training Project by devminds GmbH."""
1818
logging.basicConfig(
@@ -26,7 +26,7 @@ def cli():
2626
@click.argument('b', type=float)
2727
def cli_sum(a: float, b: float):
2828
"""Show the sum of two numbers on the console."""
29-
log.info(f'Sum of {a} and {b} is {sum(a, b)}')
29+
log.info('Sum of %f and %f is %f', a, b, sum(a, b))
3030

3131

3232
if __name__ == '__main__':

uv.lock

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)