diff --git a/.github/workflows/publish-pypi-bdist-linux.yml b/.github/workflows/publish-pypi-bdist-linux.yml index 185d7e5ce..56783f4df 100644 --- a/.github/workflows/publish-pypi-bdist-linux.yml +++ b/.github/workflows/publish-pypi-bdist-linux.yml @@ -43,9 +43,7 @@ jobs: # Build dist - name: Build the project run: | - rm dist/* - uv build - rm dist/*.tar.gz + uv build --wheel - name: Publish bdist to PyPI env: diff --git a/.github/workflows/publish-pypi-sdist.yml b/.github/workflows/publish-pypi-sdist.yml index 923011751..5545368b3 100644 --- a/.github/workflows/publish-pypi-sdist.yml +++ b/.github/workflows/publish-pypi-sdist.yml @@ -33,8 +33,7 @@ jobs: # Build dist - name: Build the project run: | - uv build - rm dist/*whl + uv build --sdist - name: Publish sdist to PyPI env: diff --git a/meson.build b/meson.build index f920418df..60fa8a631 100644 --- a/meson.build +++ b/meson.build @@ -4,13 +4,14 @@ # ################################### +# version: run_command(['git', 'describe'], capture:true, check:false).stdout().strip().split('-')[0], +# https://mesonbuild.com/Builtin-options.html project( 'tofu', 'c', 'cpp', 'cython', license: 'MIT', meson_version: '>=1.8.3', - version: run_command(['git', 'describe'], capture:true, check:false).stdout().strip().split('-')[0], - # https://mesonbuild.com/Builtin-options.html + version: run_command(['python', 'tofu/version.py'], check:true).stdout().strip(), default_options: [ 'buildtype=release', 'c_std=c11', diff --git a/pyproject.toml b/pyproject.toml index a60d023c8..34ac44344 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dist = ['--include-subprojects'] name = "tofu" readme = "README.md" license = "MIT" -version = "1.8.17" +dynamic = ["version"] description = "TOmography for FUsion toolkit" authors = [ {name = "Didier VEZINET", email = "didier.vezinet@gmail.com"}, diff --git a/tofu/_version.py b/tofu/_version.py deleted file mode 100644 index aefa9b159..000000000 --- a/tofu/_version.py +++ /dev/null @@ -1,34 +0,0 @@ -# file generated by setuptools-scm -# don't change, don't track in version control - -__all__ = [ - "__version__", - "__version_tuple__", - "version", - "version_tuple", - "__commit_id__", - "commit_id", -] - -TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Tuple - from typing import Union - - VERSION_TUPLE = Tuple[Union[int, str], ...] - COMMIT_ID = Union[str, None] -else: - VERSION_TUPLE = object - COMMIT_ID = object - -version: str -__version__: str -__version_tuple__: VERSION_TUPLE -version_tuple: VERSION_TUPLE -commit_id: COMMIT_ID -__commit_id__: COMMIT_ID - -__version__ = version = '1.8.18.dev55+g47d94b532' -__version_tuple__ = version_tuple = (1, 8, 18, 'dev55', 'g47d94b532') - -__commit_id__ = commit_id = 'g47d94b532' diff --git a/tofu/version.py b/tofu/version.py index 2e17740f1..914f60f82 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,2 +1,4 @@ -# Do not edit, pipeline versioning governed by git tags! __version__ = '1.8.18' + +if __name__ == "__main__": + print(__version__)