From c57283e26794065b21488b2e5405176b90c65e96 Mon Sep 17 00:00:00 2001 From: Aryan Roy Date: Tue, 29 Oct 2024 19:41:49 +0530 Subject: [PATCH 1/2] Update version and .gitignore Signed-off-by: Aryan Roy --- .gitignore | 3 +++ src/formulate/__init__.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b7efee3..296f54d 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,6 @@ venv.bak/ # mypy .mypy_cache/ /formulate/version.py + +#DS_STORE +**/.DS_Store \ No newline at end of file diff --git a/src/formulate/__init__.py b/src/formulate/__init__.py index 4488b9d..622866f 100644 --- a/src/formulate/__init__.py +++ b/src/formulate/__init__.py @@ -14,9 +14,8 @@ from . import toast -__version__ = "1.0.0rc1" +from .version import __version__ -__all__ = ("__version__",) From bfaeb942e31d068f38ab0c94ce80f48a5e712e61 Mon Sep 17 00:00:00 2001 From: Aryan Roy Date: Tue, 5 Nov 2024 20:26:04 +0530 Subject: [PATCH 2/2] Fix dynamic versioning Signed-off-by: Aryan Roy --- .gitignore | 7 +++++-- pyproject.toml | 6 ++++-- src/formulate/__init__.py | 7 ++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 296f54d..4d36321 100644 --- a/.gitignore +++ b/.gitignore @@ -105,5 +105,8 @@ venv.bak/ .mypy_cache/ /formulate/version.py -#DS_STORE -**/.DS_Store \ No newline at end of file +# DS_STORE +**/.DS_Store + +# Versioning +**/_version.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a217fbf..a52bc4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["hatchling"] +requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" [project] name = "formulate" @@ -54,8 +54,10 @@ Homepage = "https://github.com/Scikit-HEP/formulate" "Bug Tracker" = "https://github.com/Scikit-HEP/formulate/issues" Discussions = "https://github.com/Scikit-HEP/formulate/discussions" Changelog = "https://github.com/Scikit-HEP/formulate/releases" + [tool.hatch] -version.path = "src/formulate/__init__.py" +version.source = "vcs" +build.hooks.vcs.version-file = "src/formulate/_version.py" envs.default.dependencies = [ "pytest", "pytest-cov", diff --git a/src/formulate/__init__.py b/src/formulate/__init__.py index 622866f..7c517e3 100644 --- a/src/formulate/__init__.py +++ b/src/formulate/__init__.py @@ -14,8 +14,13 @@ from . import toast -from .version import __version__ +from ._version import __version__ +# print("======================") +# print(__version__.__repr__()) +# print("======================") + +# __all__ = ("__version__",)