Skip to content

Commit 6441632

Browse files
committed
fix: report the real SDK version in the default User-Agent
Derive the version from a single source (_version.py), consumed by __version__, the User-Agent string, and the build backend, so it can no longer go stale.
1 parent 153b22b commit 6441632

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎pyproject.toml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "foxnose-sdk"
7-
version = "0.6.0"
7+
dynamic = ["version"]
88
description = "Official Python client for FoxNose Management and Flux APIs"
99
readme = "README.md"
1010
license = {text = "Apache-2.0"}
@@ -50,6 +50,9 @@ docs = [
5050
"Source" = "https://github.com/FoxNoseTech/foxnose-python"
5151
"Documentation" = "https://foxnose-python.readthedocs.io"
5252

53+
[tool.hatch.version]
54+
path = "src/foxnose_sdk/_version.py"
55+
5356
[tool.pytest.ini_options]
5457
addopts = "-q"
5558
asyncio_mode = "auto"

‎src/foxnose_sdk/_version.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Single source of truth for the package version.
2+
3+
Read by ``foxnose_sdk.__version__``, by the transport ``User-Agent`` string, and
4+
by the build backend (see ``[tool.hatch.version]`` in ``pyproject.toml``).
5+
"""
6+
7+
__version__ = "0.7.0"

0 commit comments

Comments
 (0)