diff --git a/.gitignore b/.gitignore index b7efee3..4d36321 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,9 @@ venv.bak/ # mypy .mypy_cache/ /formulate/version.py + +# 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 4488b9d..7c517e3 100644 --- a/src/formulate/__init__.py +++ b/src/formulate/__init__.py @@ -14,9 +14,13 @@ from . import toast -__version__ = "1.0.0rc1" +from ._version import __version__ -__all__ = ("__version__",) +# print("======================") +# print(__version__.__repr__()) +# print("======================") + +# __all__ = ("__version__",)