-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
As noted by @tnixon in #453, we should be running tests against built artifacts (not just source) to catch packaging issues like missing sub-packages. The root cause of #453 was that setup.py used find_packages(include=["tempo"]) which silently excluded sub-packages (tempo.intervals, tempo.joins, etc.) from wheel builds — something unit tests against source would never catch.
This was fixed in #455 by switching to hatch build targets, but we have no regression test to prevent this from happening again.
Proposed Tests
Add an integration test suite that installs the built wheel into a clean environment and verifies:
Import patterns
# Top-level imports
import tempo
from tempo import TSDF
# Sub-package module-style imports (the pattern that broke in #453)
import tempo.intervals as t_int
import tempo.joins as t_joins
# Deep sub-package imports
from tempo.intervals.core import IntervalsDF
from tempo.intervals.overlap import detection
from tempo.joins.strategies import AsOfJoinStrategyPackage completeness
- All
__init__.pyfiles are present and importable - No
ModuleNotFoundErrorfor any sub-package in the source tree importlib.metadata.version("dbl-tempo")returns a valid version
Wheel contents validation
- Inspect the built wheel to verify all expected packages are included
- Could use
zipfileto list wheel contents and assert against expected package list
Implementation Approach
- Add a CI step after
hatch buildthat:- Creates a clean virtualenv
- Installs the built wheel (
pip install dist/*.whl) - Runs the import integration tests against the installed package
- Tests should live in a separate directory (e.g.,
tests/integration/) to distinguish from unit tests that run against source
References
- [BUG] [v0.2]: intervals package import pattern broken #453 — Original bug report (sub-package imports broken)
- Make pyproject.toml + hatch the sole build source of truth (PEP 517/518) #455 — Build fix (hatch build targets)
- Comment by @tnixon: "we should probably run test suite against build artifacts (not just source)"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request