Skip to content

Commit

Permalink
Specify dynamic __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
pt1243 committed Oct 22, 2023
1 parent d208734 commit a476547
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions my_package/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .__version__ import __version__
1 change: 1 addition & 0 deletions my_package/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.0"
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ authors = [
{name = "Jeremy Smith", email = "64465231+pt1243@users.noreply.github.com"},
]
description = "My Python package."
version = "0.1.0"
requires-python = ">=3.8"
readme = "README.md"
license = {file = "LICENSE"}
dependencies = [
"numpy",
]
dynamic = ["version"]

[build-system]
requires = ["setuptools>=61.0.0", "wheel"]
Expand All @@ -19,6 +19,9 @@ build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["my_package"]

[tool.setuptools.dynamic]
version = {attr = "my_package.__version__"}

[tool.pytest.ini_options]
addopts = "--cov=my_package --cov-report=term-missing --cov-append"
testpaths = [
Expand Down

0 comments on commit a476547

Please sign in to comment.