From b70e905d55e2e7abccb6d9fc53b58e12ef854d3a Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 12 Dec 2025 17:37:26 +0000 Subject: [PATCH 1/6] [#1161] version.py => _version.py --- pyproject.toml | 2 +- tofu/_version.py | 35 +---------------------------------- tofu/version.py | 2 -- 3 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 tofu/version.py 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 index aefa9b159..6a050597f 100644 --- a/tofu/_version.py +++ b/tofu/_version.py @@ -1,34 +1 @@ -# 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' +__version__ = '1.8.18' diff --git a/tofu/version.py b/tofu/version.py deleted file mode 100644 index 2e17740f1..000000000 --- a/tofu/version.py +++ /dev/null @@ -1,2 +0,0 @@ -# Do not edit, pipeline versioning governed by git tags! -__version__ = '1.8.18' From 34d96fe5f7ccdd2fe2ca85e5d04d18460323b5cd Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 12 Dec 2025 17:41:07 +0000 Subject: [PATCH 2/6] [#1161] Single-sourcing from tofu/_version.py --- meson.build | 3 ++- tofu/__init__.py | 2 +- tofu/_version.py | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index f920418df..fe3c197e3 100644 --- a/meson.build +++ b/meson.build @@ -9,7 +9,8 @@ project( 'c', 'cpp', 'cython', license: 'MIT', meson_version: '>=1.8.3', - version: run_command(['git', 'describe'], capture:true, check:false).stdout().strip().split('-')[0], + version: run_command(['tofu/_version.py', '--wheel'], check:true).stdout().strip() + # version: run_command(['git', 'describe'], capture:true, check:false).stdout().strip().split('-')[0], # https://mesonbuild.com/Builtin-options.html default_options: [ 'buildtype=release', diff --git a/tofu/__init__.py b/tofu/__init__.py index dc32a6fdf..3a401b2e3 100644 --- a/tofu/__init__.py +++ b/tofu/__init__.py @@ -54,7 +54,7 @@ import os import sys import warnings -from .version import __version__ +from ._version import __version__ # ------------------------------------- diff --git a/tofu/_version.py b/tofu/_version.py index 6a050597f..914f60f82 100644 --- a/tofu/_version.py +++ b/tofu/_version.py @@ -1 +1,4 @@ __version__ = '1.8.18' + +if __name__ == "__main__": + print(__version__) From 06a63a86ad337a31d31be80b3bce7d6814e338fc Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 12 Dec 2025 18:13:26 +0000 Subject: [PATCH 3/6] [#1161] uv build --sdist and --wheel in GA --- .github/workflows/publish-pypi-bdist-linux.yml | 4 +--- .github/workflows/publish-pypi-sdist.yml | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) 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: From 6a586b4dc7b86909d276111338662a6db718ae55 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 12 Dec 2025 18:13:50 +0000 Subject: [PATCH 4/6] [#1161] Seems to work --- meson.build | 6 +++--- tofu/meson.build | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index fe3c197e3..599a19854 100644 --- a/meson.build +++ b/meson.build @@ -4,14 +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(['tofu/_version.py', '--wheel'], check:true).stdout().strip() - # 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/tofu/meson.build b/tofu/meson.build index 318b0c3be..2ecfa0538 100644 --- a/tofu/meson.build +++ b/tofu/meson.build @@ -4,7 +4,7 @@ py.install_sources([ '__init__.py', - 'version.py', + '_version.py', 'py.typed', 'pathfile.py', 'utils.py', From c36ac9202af11f16ad3d16b862aec5705e0f6c02 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 12 Dec 2025 18:34:31 +0000 Subject: [PATCH 5/6] [#1161] Back to version.py --- meson.build | 2 +- tofu/__init__.py | 2 +- tofu/{_version.py => version.py} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename tofu/{_version.py => version.py} (100%) diff --git a/meson.build b/meson.build index 599a19854..60fa8a631 100644 --- a/meson.build +++ b/meson.build @@ -11,7 +11,7 @@ project( 'c', 'cpp', 'cython', license: 'MIT', meson_version: '>=1.8.3', - version: run_command(['python', 'tofu/_version.py'], check:true).stdout().strip(), + version: run_command(['python', 'tofu/version.py'], check:true).stdout().strip(), default_options: [ 'buildtype=release', 'c_std=c11', diff --git a/tofu/__init__.py b/tofu/__init__.py index 3a401b2e3..dc32a6fdf 100644 --- a/tofu/__init__.py +++ b/tofu/__init__.py @@ -54,7 +54,7 @@ import os import sys import warnings -from ._version import __version__ +from .version import __version__ # ------------------------------------- diff --git a/tofu/_version.py b/tofu/version.py similarity index 100% rename from tofu/_version.py rename to tofu/version.py From e6854fe9fc8302756f345f924b1ccd4e4545a462 Mon Sep 17 00:00:00 2001 From: dvezinet Date: Fri, 12 Dec 2025 18:35:36 +0000 Subject: [PATCH 6/6] [#1161] Minor debug --- tofu/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tofu/meson.build b/tofu/meson.build index 2ecfa0538..318b0c3be 100644 --- a/tofu/meson.build +++ b/tofu/meson.build @@ -4,7 +4,7 @@ py.install_sources([ '__init__.py', - '_version.py', + 'version.py', 'py.typed', 'pathfile.py', 'utils.py',