Skip to content

packaging: make the installed wheel importable and the CLI runnable#149

Merged
Gavin-Borges merged 2 commits into
mainfrom
packaging/wheel-importable-shim
Jul 24, 2026
Merged

packaging: make the installed wheel importable and the CLI runnable#149
Gavin-Borges merged 2 commits into
mainfrom
packaging/wheel-importable-shim

Conversation

@Gavin-Borges

Copy link
Copy Markdown
Owner

Fixes packaging blockers that prevented an installed SESTRAV wheel from being imported or run. All changes are packaging-only; no model, data, or scientific code is modified, and every frozen model artifact is byte-identical.

Problems fixed

  • import sestrav failed: the wheel shipped a top-level src package, never sestrav (pyproject include was ["src*"], and no sestrav/ package existed).
  • functions.* was missing from the wheel: the CLI predict command imports functions.stage1..stage4 at runtime, but functions/ is a top-level directory that include = ["src*"] excluded, so an installed sestrav predict raised ModuleNotFoundError: functions.
  • the release smoke test masked the break: it used import sestrav ... || from src import features, and the fallback passed on the broken wheel, keeping the job green.

Changes

  • pyproject.toml: expand the wheel package set to include = ["sestrav*", "src*", "functions*"] so the CLI stages and the new facade package ship. The src/functions layout is unchanged (they are mutually coupled), so no internal import statements change.
  • add sestrav/init.py: a thin facade that re-exports the public surface (features, main, __version__) from src, so import sestrav works for an installed wheel.
  • .github/workflows/release.yml: drop the || fallback and make the smoke test real - it now asserts import sestrav, import functions.stage1_..., and sestrav --help.

Safety

  • No file under models/ is touched. rf_31feature_integrated.joblib and every other joblib/pth artifact remain byte-identical (sha256 verified before/after).
  • A pickle-header audit confirmed no frozen artifact references any src.*, functions.*, or __main__.* class; all classes resolve to sklearn/xgboost/numpy or torch state_dicts, so the packaging change cannot affect model loading.

Verification

  • Built the wheel; confirmed sestrav/, src/, and functions/ (all 5 stage files) ship; top_level.txt now lists functions/sestrav/src; entry point intact.
  • Isolated installed-layout import test (wheel on PYTHONPATH from a neutral cwd): import sestrav, import functions.stage1_peptide_generation, and src.cli.main all resolve from the installed location (not the repo source).
  • Frozen RF sha256 unchanged (e2acd33...); integrity trio green (selftest 18/18; harness 20 PASS / 1 WARN / 0 FAIL / 2 SKIP).

Note on scope

This makes a future PyPI publish safe (the de-masked smoke test will genuinely validate the wheel); it does not itself publish. The release.yml:121 pip install "sestrav==X" --index-url pypi.org step still activates only once the package exists on PyPI.

Fixes packaging blockers that prevented an installed SESTRAV wheel from being
imported or run. All changes are packaging-only; no model, data, or scientific
code is modified, and every frozen model artifact is byte-identical.

Problems fixed
- import sestrav failed: the wheel shipped a top-level `src` package, never
  `sestrav` (pyproject include was ["src*"], and no `sestrav/` package existed).
- functions.* was missing from the wheel: the CLI `predict` command imports
  functions.stage1..stage4 at runtime, but `functions/` is a top-level directory
  that include = ["src*"] excluded, so an installed `sestrav predict` raised
  ModuleNotFoundError: functions.
- the release smoke test masked the break: it used
  `import sestrav ... || from src import features`, and the fallback passed on the
  broken wheel, keeping the job green.

Changes
- pyproject.toml: expand the wheel package set to
  include = ["sestrav*", "src*", "functions*"] so the CLI stages and the new
  facade package ship. The src and functions layout is unchanged (they are
  mutually coupled), so no internal import statements change.
- add sestrav/__init__.py: a thin facade that re-exports the public surface
  (features, main, __version__) from `src`, so `import sestrav` works for an
  installed wheel.
- .github/workflows/release.yml: drop the `||` fallback and make the smoke test
  real - it now asserts import sestrav, import functions.stage1_..., sestrav --help.

Safety
- No file under models/ is touched. rf_31feature_integrated.joblib and every
  other joblib/pth artifact remain byte-identical (sha256 verified before/after).
- A pickle-header audit (staged) confirmed no frozen artifact references any
  src.*, functions.*, or __main__.* class; all classes resolve to
  sklearn/xgboost/numpy or torch state_dicts.

Verification
- Built the wheel; confirmed sestrav/, src/, and functions/ (all 5 stage files)
  ship; top_level.txt now lists functions/sestrav/src; entry point intact.
- Isolated installed-layout import test (wheel on PYTHONPATH from a neutral cwd):
  import sestrav, import functions.stage1_peptide_generation, src.cli.main all
  resolve from the installed location.
- Frozen RF sha256 unchanged; integrity trio green (18/18; 20P/1W/0F/2SKIP).
@Gavin-Borges
Gavin-Borges merged commit 26c1b19 into main Jul 24, 2026
17 of 18 checks passed
@Gavin-Borges
Gavin-Borges deleted the packaging/wheel-importable-shim branch July 24, 2026 02:57
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