Skip to content

Commit 8a01b42

Browse files
committed
[Enh] Add dynamic version field (#6)
1 parent 7f6a365 commit 8a01b42

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

mpython/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from .runtime import Runtime
66
from .sparse_array import SparseArray
77
from .struct import Struct
8+
from ._version import __version__
89

910
__all__ = [
1011
"Runtime",
@@ -14,6 +15,7 @@
1415
"Struct",
1516
"Array",
1617
"SparseArray",
18+
"__version__",
1719
]
1820

1921
# ----------------------------------------------------------------------

mpython/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "25.04alpha2.post2"

pyproject.toml

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

55
[project]
66
name = "mpython-core"
7-
version = "25.04alpha2.post2"
7+
dynamic = ["version"]
88
description = "Core Python elements for wrapped MPython packages."
99
readme = "README.md"
1010
license = {file = "LICENSE"}
@@ -24,6 +24,9 @@ dependencies = [
2424
"numpy"
2525
]
2626

27+
[tool.setuptools.dynamic]
28+
version = {attr = "mpython._version.__version__"}
29+
2730
[project.urls]
2831
Repository = "https://github.com/MPython-Package-Factory/mpython-core"
2932

0 commit comments

Comments
 (0)