Skip to content

Commit a18d646

Browse files
committed
fix: track map2loop and loopstructuralvisualisation versions in pyproject.toml instead of version.py
Same fix as the LoopStructural root package: map2loop already had a static pyproject.toml version but its __init__.py still read from the now-redundant version.py; loopstructuralvisualisation had a dynamic pyproject.toml version resolved from its version.py via tool.setuptools.dynamic. Both now use a static pyproject.toml version directly, with map2loop's __version__ read via importlib.metadata at runtime (loopstructuralvisualisation's __init__.py never imported __version__, so no equivalent change needed there). Also drops loopstructuralvisualisation's release-please extra-files entry pointing at the now-deleted version.py. Done ahead of merging this PR: once merged, the root LoopStructural release-please component's repo-wide version.py filename search (a structural side effect of its path being ".", not scoped to a subdirectory) would otherwise find and try to bump these packages' version.py files too, colliding with their own release-please components -- the same bug fixed for loop_interpolation's stray loopsolver/version.py in #315.
1 parent 1823375 commit a18d646

5 files changed

Lines changed: 5 additions & 14 deletions

File tree

packages/loopstructural_visualisation/pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "loopstructuralvisualisation"
77
description = "3D geological modelling visualisation for LoopStructural"
8-
dynamic = ["version"]
8+
version = "0.1.17"
99
requires-python = ">=3.9"
1010
authors = [{ name = "Lachlan Grose", email = "lachlan.grose@monash.edu" }]
1111
readme = "README.md"
@@ -42,9 +42,6 @@ Documentation = "https://Loop3d.org/LoopStructural/"
4242
"Bug Tracker" = "https://github.com/loop3d/loopstructural-visualisation/issues"
4343
"Source Code" = "https://github.com/loop3d/loopstructural-visualisation"
4444

45-
[tool.setuptools.dynamic]
46-
version = { attr = "loopstructuralvisualisation.version.__version__" }
47-
4845
[tool.setuptools.packages.find]
4946
where = ["src"]
5047
include = ["loopstructuralvisualisation", "loopstructuralvisualisation.*"]

packages/loopstructural_visualisation/src/loopstructuralvisualisation/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/map2loop/src/map2loop/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import logging
2+
from importlib.metadata import version
23
from map2loop.logging import loggers, ch
34

45
from .project import Project
5-
from .version import __version__
6+
7+
__version__ = version("map2loop")
68

79
import warnings # TODO: convert warnings to logging
810
from packaging import (

packages/map2loop/src/map2loop/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

release-please-config.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@
1818
},
1919
"packages/loopstructural_visualisation": {
2020
"release-type": "python",
21-
"component": "loopstructuralvisualisation",
22-
"extra-files": [
23-
{
24-
"type": "generic",
25-
"path": "src/loopstructuralvisualisation/version.py"
26-
}
27-
]
21+
"component": "loopstructuralvisualisation"
2822
}
2923
}
3024
}

0 commit comments

Comments
 (0)