fix(ci): add pyproject.toml so pytest can import data_quality package#11
Merged
bdevierno1 merged 1 commit intoJul 14, 2026
Merged
Conversation
CI runs pytest from backend/ working-directory but there was no pythonpath configuration, so `from data_quality.checks import ...` raised ModuleNotFoundError at collection time (exit 2). Adding [tool.pytest.ini_options] pythonpath = ["."] tells pytest to prepend the backend/ directory to sys.path, making data_quality and any sibling packages importable without an install step. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bdevierno1
marked this pull request as ready for review
July 14, 2026 01:08
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.
Root Cause
CI job Data-quality checks & contract lint was failing with:
at
tests/test_data_quality.py:12— pytest collection exit code 2.The workflow sets
working-directory: backendand runs:The
data_qualitypackage lives atbackend/data_quality/(has__init__.py), but there was no pytest path configuration telling pytest to includebackend/onsys.path. Pytest's default import mode inserts the test file's parent directory (tests/) intosys.path, which doesn't containdata_quality.Fix
Add
backend/pyproject.tomlwith:The
pythonpathoption (available since pytest 7.0; requirements pinpytest>=8.0.0) prepends the working directory (backend/) tosys.pathbefore any test collection, makingdata_qualityand sibling packages importable without apip install -e .step.Diff
One file added:
backend/pyproject.toml(5 lines). No code changes.Verification
Out of scope
This PR only adds the pytest path configuration. No logic or test changes are included. The
DeprecationWarningfordatetime.utcnow()surfaced in the run is pre-existing and tracked separately.Links