packaging: make the installed wheel importable and the CLI runnable#149
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 sestravfailed: the wheel shipped a top-levelsrcpackage, neversestrav(pyproject include was["src*"], and nosestrav/package existed).functions.*was missing from the wheel: the CLIpredictcommand importsfunctions.stage1..stage4at runtime, butfunctions/is a top-level directory thatinclude = ["src*"]excluded, so an installedsestrav predictraisedModuleNotFoundError: functions.import sestrav ... || from src import features, and the fallback passed on the broken wheel, keeping the job green.Changes
include = ["sestrav*", "src*", "functions*"]so the CLI stages and the new facade package ship. Thesrc/functionslayout is unchanged (they are mutually coupled), so no internal import statements change.features,main,__version__) fromsrc, soimport sestravworks for an installed wheel.||fallback and make the smoke test real - it now assertsimport sestrav,import functions.stage1_..., andsestrav --help.Safety
models/is touched.rf_31feature_integrated.jobliband every other joblib/pth artifact remain byte-identical (sha256 verified before/after).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
sestrav/,src/, andfunctions/(all 5 stage files) ship;top_level.txtnow lists functions/sestrav/src; entry point intact.import sestrav,import functions.stage1_peptide_generation, andsrc.cli.mainall resolve from the installed location (not the repo source).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:121pip install "sestrav==X" --index-url pypi.orgstep still activates only once the package exists on PyPI.