Skip to content

Commit a17825d

Browse files
committed
Add dynamic version to pyo3 projects
1 parent cf89e45 commit a17825d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/project_generator.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ module-name = "{{ module }}._{{ module }}"
498498
binding = "pyo3"
499499
features = ["pyo3/extension-module"]
500500
501+
[tool.hatch.version]
502+
path = "{{ module }}/_version.py"
503+
501504
"#
502505
.to_string(),
503506
Pyo3PythonManager::Setuptools => r#"[build-system]
@@ -512,6 +515,7 @@ authors = [{name = "{{ creator }}", email = "{{ creator_email }}"}]
512515
license = "{{ license }}"
513516
{% endif -%}
514517
readme = "README.md"
518+
version = {attr = "{{ module }}.__version__"}
515519
dependencies = []
516520
517521
[tool.maturin]

0 commit comments

Comments
 (0)