Skip to content

Commit 7cf9e44

Browse files
committed
Updated pyproject.toml with [tool.poetry-dynamic-versioning] config
Added version.py with placeholders for dynamic substitution Confirmed version substitution with poetry-dynamic-versioning show Successfully ran poetry check and poetry build Verified built .whl unpacks with correct version
1 parent cfb917f commit 7cf9e44

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[build-system]
2-
requires = ["setuptools>=64", "setuptools_scm>=8"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
3+
build-backend = "poetry_dynamic_versioning.backend"
4+
45

56

67
[project]
78
name = "mira-simpeg"
8-
version = "0.0.0" ## dummy version to pass Poetry
99

1010
dynamic = ["dependencies", "version"]
1111

@@ -21,6 +21,8 @@ authors = [
2121
]
2222

2323
keywords = ["geophysics", "inverse problem"]
24+
25+
2426
dependencies = [
2527
"discretize>=0.11",
2628
"geoana>=0.7.0",
@@ -32,6 +34,7 @@ dependencies = [
3234
"scipy>=1.8",
3335
]
3436

37+
3538
classifiers = [
3639
"Development Status :: 4 - Beta",
3740
"Intended Audience :: Developers",
@@ -50,6 +53,38 @@ classifiers = [
5053
]
5154

5255

56+
[tool.poetry]
57+
packages = [{ include = "simpeg" }]
58+
version = "0.0.0"
59+
60+
61+
[tool.poetry-dynamic-versioning]
62+
enable = true
63+
vcs = "git"
64+
style = "pep440"
65+
66+
67+
[tool.poetry-dynamic-versioning.substitution]
68+
files = ["simpeg/version.py", "recipe.yaml"]
69+
patterns = [
70+
{ value = '''(^__version__\s*(?::.*?)?=\s*['"])[^'"]*(['"])''', mode = "str" },
71+
{ value = '''(^\s*version\s*(?::.*?)?:\s*['"])[^'"]*(['"])''', mode = "str" },
72+
{ value = '''(^__version_tuple__\s*(?::.*?)?=\s*\()[^)]*(\))''', mode = "tuple" },
73+
]
74+
75+
76+
[tool.poetry-dynamic-versioning.files."simpeg/version.py"]
77+
persistent-substitution = true
78+
initial-content = """
79+
# These version placeholders will be replaced later during substitution.
80+
__version__ = "0.0.0"
81+
__version_tuple__ = (0, 0, 0)
82+
"""
83+
84+
[tool.poetry-dynamic-versioning.files."recipe.yaml"]
85+
persistent-substitution = true
86+
87+
5388
[project.license]
5489
file = 'LICENSE'
5590

@@ -267,3 +302,4 @@ filterwarnings = [
267302
"ignore::simpeg.utils.solver_utils.DefaultSolverWarning",
268303
]
269304

305+

0 commit comments

Comments
 (0)