fix(pkg): make lib a real package; clean before local build#109
Merged
Conversation
lib was shipped only as implicit namespace pkg; make explicit. Add clean+build targets so stale build/ can't leak phantom modules (binance/google/defillama/examples) into local wheels.
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.
Summary
Two packaging fixes found while auditing
MANIFEST.in.datamaxi/lib/__init__.py—lib(heavily imported:datamaxi.lib.utils,datamaxi.lib.constants) had no__init__.py, so it only shipped as an implicit namespace package. Made it an explicit package for robustness.Makefile—clean+buildtargets.buildcleans first so a stalebuild/dir can't leak removed/phantom modules into a locally-built wheel.Why
A leftover
build/dir (Apr 2024) causedpython -m build --wheelto ship phantom packages (binance/,google/,defillama/,examples/) that no longer exist in source —bdist_wheelzipsbuild/lib, andbuild_pycopies current files in without removing old ones. The sdist was unaffected. CI (release.yml) is safe — it builds on a freshcheckout@v4, so no stalebuild/exists; this only bit local builds.MANIFEST.initself needs no changes —requirements/common.txt(build-time dep source) is already included and the sdist builds correctly.Tests
pytest -m "not integration": 108 passed, 130 skipped.make buildthen inspected wheel: 23 correct modules +lib/__init__.py, no phantoms.Known failures
None.