Skip to content

fix: remove loopsolver/version.py resurrected by release-please - #315

Merged
lachlangrose merged 1 commit into
masterfrom
fix-loopsolver-version-corruption
Aug 14, 2026
Merged

fix: remove loopsolver/version.py resurrected by release-please#315
lachlangrose merged 1 commit into
masterfrom
fix-loopsolver-version-corruption

Conversation

@lachlangrose

Copy link
Copy Markdown
Member

Summary

Heads up for later

The still-open workspace-package PR (map2loop / loopstructural_visualisation) adds its own legitimate version.py files under packages/. Once merged, the same repo-wide search will find those too and may try to bump them to LoopStructural's version number, colliding with loopstructural_visualisation's own release-please component (which already manages its version.py via an explicit extra-files entry). Worth addressing before that merge — likely by moving those packages off version.py in favor of a static pyproject.toml version too, same as this fix did for the root package.

Test plan

  • Confirmed no importers of loopsolver.version anywhere in the repo.
  • Confirmed current master pyproject.toml/manifest are correctly at 1.7.2, unaffected by this fix.
  • After merge, confirm the next release-please run's file-search no longer reports this file.

🤖 Generated with Claude Code

#314 deleted this file, but the release-please run triggered by that
same merge re-created it with __version__ = "1.7.2" (LoopStructural's
version, not loop_interpolation's real "0.0.1") before PR #313 was
merged. Its own filename-search log line still showed the file as
found on that run -- most likely GitHub's code-search index hadn't
caught up with the deletion commit yet.

Root cause: pointing the LoopStructural component's path at "." makes
release-please's "find any file named version.py" search genuinely
repo-wide rather than scoped to LoopStructural/, so it can collide
with any version.py anywhere in the tree, present or future (e.g. the
still-unmerged map2loop/loopstructural_visualisation packages each
have their own). There's no release-please config to scope that search
to a subpath, so the durable fix is having no other version.py files
left for it to find.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lachlangrose
lachlangrose merged commit ae12958 into master Aug 14, 2026
23 of 24 checks passed
@lachlangrose
lachlangrose deleted the fix-loopsolver-version-corruption branch August 14, 2026 07:13
@github-actions github-actions Bot mentioned this pull request Aug 14, 2026
lachlangrose added a commit that referenced this pull request Aug 14, 2026
…ject.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.
lachlangrose added a commit that referenced this pull request Aug 17, 2026
…ce (#303)

* fix: Updating intrusions code

- Added a new method `_validate_intrusion_inputs` in `GeologicalModel` to validate inputs for intrusions, ensuring necessary data is present before processing.
- Updated `_build_intrusion` to call the new validation method, improving error handling for missing data.
- Refactored `IntrusionBuilder.create_geometry_using_geometric_scaling` to clarify that geometric scaling is not currently implemented, raising a `NotImplementedError` immediately.
- Simplified threshold handling in `IntrusionFeature` by removing redundant checks for marginal faults.
- Removed the unused `intrusion_support_functions.py` file to clean up the codebase.
- Updated tests in `test_intrusions.py` to cover new validation logic, ensuring clear error messages for missing data and parameters.
- Added regression tests for previously silent errors related to weight handling and geometric scaling.

(cherry picked from commit 8cb80c1)

* feat: add loopstructural-visualisation as packages/loopstructural_visualisation workspace package

Ports the loopstructural-visualisation repo in as a uv-workspace member,
following the src-layout pattern proven by packages/loop_common and
packages/loop_interpolation in Stage 2. Import name stays
loopstructuralvisualisation; only the on-disk container path changes.

- Routed the one print() call in __init__.py's trame-ui import guard
  through LoopStructural.utils.getLogger, consistent with the rest of
  the ecosystem's logging conventions.
- Left LoopStructural.datatypes imports in _3d_viewer.py as-is rather
  than swapping to LoopStructural.geometry: that module only exists in
  this repo's unreleased dev tree, not in any published LoopStructural
  release, and the package's declared floor is LoopStructural>=1.6.17.

(cherry picked from commit 07f0868)

* feat: add map2loop as packages/map2loop workspace package

Ports Loop3D/map2loop (upstream commit 078f8a6, master @ 3.3.1) into this
repo as packages/map2loop, following the packages/loop_interpolation
src-layout convention (Stage 2 of ROADMAP.md), for Stage 4's map2loop half.

- Source moved from flat map2loop/ to src/map2loop/; test suite ported to
  packages/map2loop/tests/ unchanged apart from one CWD-relative fixture
  path fix (tests/sampler/geo_test.csv -> path relative to the test file)
  needed because tests now run from the monorepo root, not map2loop's own
  repo root.
- pyproject.toml written from the loop_interpolation template (build
  system, classifiers, src-layout packages.find, tests extra) but keeps
  map2loop's own real name/version/requires-python/dependencies.
- Dependency-declaration gaps fixed (imported at module level but
  undeclared upstream): pandas and packaging. GDAL (osgeo) is also a hard,
  module-level import but is deliberately left undeclared, matching
  upstream's own convention of treating it as an externally-provisioned
  (conda/system) dependency rather than a pip one -- their own
  dependencies.txt explicitly skips it in check_all_dependencies(), and
  pip-building it from source fails without system libgdal headers.
- dependencies.txt (consulted at runtime by map2loop's own import-time
  version-compatibility self-check) copied to src/dependencies.txt to
  match the relative path the existing code resolves it from, and pytest
  removed from it since map2loop's own self-check otherwise hard-requires
  pytest to be installed for a plain (non-tests-extra) install to import
  successfully.

Verified in an isolated uv venv: `import map2loop` succeeds, and
`pytest packages/map2loop/tests` gives 78 passed, 4 failed, 1 skipped, 1
collection error -- all 5 non-passing outcomes trace back to the absence
of native GDAL bindings in this pip/Windows-only verification environment
(4 of them) or a monorepo-embedding artifact where one test's internal
`pytest.main()` call with no explicit path picks up this repo's own
unrelated tests/conftest.py pytest_plugins (1 of them), not to the port
itself.

Audited for loop_common type reuse per ROADMAP.md Stage 4: no swap made.
map2loop's bounding_box is a plain dict of map-CRS extents threaded
through dozens of call sites, architecturally unrelated to
loop_common.geometry.BoundingBox's local/global mesh-frame transform
model; its own map2loop.logging module is already map2loop's public,
already-used API surface, so routing its handful of ad-hoc print()
statements through loop_common.logging would need adding loop-common as a
new hard dependency for a cosmetic swap; no custom point/orientation data
structures exist to compare against loop_common.observations (dip/dip
direction data stays as GeoDataFrame columns throughout). No clean,
low-risk win found.

(cherry picked from commit fb755cc)

* feat: wire map2loop and loopstructural_visualisation into the workspace

Completes Stage 4 (ROADMAP.md, outcomes 5/7) for map2loop and
loopstructural-visualisation, following on from the two ported packages
already merged in from agent worktrees (packages/map2loop,
packages/loopstructural_visualisation).

- Add both to [tool.uv.sources]; loopstructural_visualisation also needs
  LoopStructural = { workspace = true } since it depends on LoopStructural
  itself, which uv treats as an implicit workspace member once referenced
  by name.
- CI: loopstructural_visualisation joins the existing packages-test matrix;
  map2loop gets its own ubuntu-only job (map2loop-test) with an
  apt-installed libgdal, since GDAL has no pip wheel on Windows/macOS and
  upstream map2loop itself only tests via conda for the same reason.
- Add a minimal import-smoke test for loopstructural_visualisation, which
  shipped with zero test coverage upstream.
- Wire both into pypi.yml sdist/publish, release-please-config.json +
  .release-please-manifest.json (loopstructural_visualisation uses
  extra-files to bump version.py's __version__, since it has no static
  pyproject version field), and grandfather D/ANN ruff rules for both
  (matching the loop_common/loop_interpolation precedent).
- Correct ROADMAP.md: loopresources (Stage 4a) was never actually merged
  to master, despite a prior status-log entry claiming otherwise.

Verified: uv sync resolves cleanly for both packages standalone and as a
full workspace sync; tests/unit 695 passed/4 skipped (zero regressions).

(cherry picked from commit ce71cae)

* 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.

* fix: register map2loop in tool.uv.sources

Missing alongside loopstructuralvisualisation/LoopStructural, causing
the same uv workspace-member/sources mismatch build failure for the
map2loop package.

* ci: fix matrix package names

* ci: split package name from directory in packages-test matrix

uv --package matches on the declared pyproject.toml name, which for
loopstructuralvisualisation has no separator, while its directory
under packages/ uses an underscore. A single matrix.package string
can't satisfy both the uv --package flag and the pytest path, so
track name and dir separately.

* ci: fix map2loop gdal_array import by disabling build isolation for gdal

pip/uv build gdal's sdist in an isolated env by default, so its
setup.py can't see the numpy already installed in the synced venv and
skips compiling the _gdal_array extension. Building gdal with
--no-build-isolation-package lets it see that numpy, fixing
"ImportError: cannot import name '_gdal_array' from 'osgeo'" at
runtime.

* ci: declare setuptools as an extra build dependency for gdal

Building gdal with --no-build-isolation-package (previous commit)
means it no longer gets setuptools for free from an isolated build
env, so its legacy setup.py fails with ModuleNotFoundError: No module
named 'setuptools'. uv's own error message pointed at this fix.

* ci: install setuptools directly instead of via extra-build-dependencies

uv pip install did not pick up [tool.uv.extra-build-dependencies] (same
"No module named 'setuptools'" error, with the same hint, reappeared
on the next run) - that config apparently only applies to uv's
project-aware resolver (uv sync/lock), not the pip-compatible
uv pip install used here. Installing setuptools into the venv directly
before the --no-build-isolation gdal build is the other fix uv's error
suggested, and doesn't depend on that.

* fix: scope nested pytest.main() call to its own file in test_timeout_handling

Without an explicit path, the nested pytest.main() fell back to the
root pyproject.toml's testpaths = ["tests"], which collects the
top-level tests/ package instead of this file. That package shares
its "tests" module name with packages/map2loop/tests/ (both have
__init__.py), so once "tests" was already bound in sys.modules to the
map2loop package, the root tests/conftest.py's pytest_plugins entries
like "tests.fixtures.data" failed to import - they resolved against
the wrong "tests" package. Passing __file__ scopes collection to just
this file, avoiding the root tests/ directory entirely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant