Skip to content

Commit 15081a2

Browse files
feat: add version.py as single source of truth for versioning
- Create src/modelscope_hub/version.py with default 0.0.0 - Update __init__.py to import from version.py - Update pyproject.toml to use setuptools dynamic version
1 parent c1dc64e commit 15081a2

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "modelscope-hub"
3-
version = "0.1.0"
3+
dynamic = ["version"]
44
description = "An OpenAPI-first Python SDK for interacting with the ModelScope Hub platform."
55
requires-python = ">=3.10"
66
license = {text = "Apache-2.0"}
@@ -45,6 +45,9 @@ build-backend = "setuptools.build_meta"
4545
[tool.setuptools.packages.find]
4646
where = ["src"]
4747

48+
[tool.setuptools.dynamic]
49+
version = {attr = "modelscope_hub.version.__version__"}
50+
4851
[tool.ruff]
4952
target-version = "py313"
5053
line-length = 120

src/modelscope_hub/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
RepoInfo,
3535
UserInfo,
3636
)
37-
38-
__version__ = "0.1.0"
37+
from .version import __version__
3938

4039
__all__ = [
4140
"__version__",

src/modelscope_hub/version.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Version information for modelscope-hub."""
2+
3+
__version__ = "0.0.0"

0 commit comments

Comments
 (0)