Skip to content

Fix packaged SciPy quick-start resources and add artifact release gates - #5

Open
aliengineering-byte wants to merge 5 commits into
mainfrom
codex/issue-4-artifact-hardening
Open

Fix packaged SciPy quick-start resources and add artifact release gates#5
aliengineering-byte wants to merge 5 commits into
mainfrom
codex/issue-4-artifact-hardening

Conversation

@aliengineering-byte

@aliengineering-byte aliengineering-byte commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Fixes #4

External reproduction

PhaseProbe 0.2.0 was installed from PyPI into a fresh CPython 3.12 environment. From an unrelated working directory containing spaces, with PYTHONPATH unset and phaseprobe imported from site-packages, this documented command exited 2 because the relative file was absent:

phaseprobe perturb --config examples/scipy/lorenz.json

Root cause

The four SciPy JSON configurations lived in the repository-level examples/scipy/ tree. Hatchling's wheel target packages src/phaseprobe, so the wheel omitted that tree. The sdist contained it only as source material; installing the sdist built a wheel that omitted it again. Checkout-root tests and CI masked the installed-artifact failure.

Implementation

  • Package all four SciPy configurations below phaseprobe/data/examples and load them with importlib.resources through --example scipy-* names.
  • Keep one registry for built-in names, resource filenames, and the four former config paths.
  • Preserve the exact former paths as narrow compatibility aliases only when the requested file is absent. Existing files win; matching is case-sensitive, accepts Windows or POSIX separators, and does not use fuzzy or basename fallback.
  • Add versioned missing/malformed-resource diagnostics and source/package drift tests.
  • Add source-derived wheel/sdist resource audits and clean installed-artifact gates on Linux and Windows.
  • Make generated regression creation idempotent and refuse conflicting overwrites.

The original Issue #4 command now resolves to scipy-lorenz when its relative file is absent. The preferred installed-safe form is:

phaseprobe perturb --example scipy-lorenz

Artifact-level verification design

The gate builds the wheel and sdist, inspects their members and metadata, creates fresh installations outside the checkout with PYTHONPATH removed, and exercises the wheel, sdist, and dependency-free base wheel. The installed smoke loads every built-in, runs all four SciPy examples through the real CLI, reproduces the former command, checks local-file precedence plus separator/case/fuzzy behavior, runs scan/replay/generated pytest, and runs pip check.

Local verification

Windows, CPython 3.12.13:

  • Ruff format/check: passed
  • mypy strict check: 35 source files passed
  • pytest: 99 passed; 86.48% coverage (85% required)
  • build and Twine: wheel and sdist passed
  • resource audit: all 13 runtime files present in both artifacts
  • clean wheel, clean sdist, and base-wheel verification: passed from site-packages
  • installed generated pytest: 1 passed for wheel and sdist
  • Lorenz: FINITE-TIME TRAJECTORY DIVERGENCE FOUND
  • predator-prey: CHECK POLICY PASSED
  • both negative controls reached their expected results
  • replay: REPLAY VERIFIED
  • pip check: no broken requirements
  • README logistic and SciPy walkthroughs: passed
  • links and public-tree hygiene: passed

No solver method, tolerance, threshold, search bound, numerical default, replay semantic, or scientific claim changed.

PhaseProbe 0.2.1 has not been published to PyPI or TestPyPI. The remaining remote-CI requirement is now satisfied: all 14 jobs passed across Linux and Windows, Python 3.10/3.12/3.14, core and SciPy source tests, package/hygiene, and Windows installed-artifact verification.

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.

[Bug]: SciPy quick-start config is missing in a clean PyPI install

2 participants