Repository navigation
feat(dist): consume campus-common from its own distribution - #987
Merged
Merged
Conversation
campus.common is carved to nyjc-computing/campus-common@main (v0.1.0): the monorepo now declares it as a git dependency and ships no campus/common of its own. Consumers see one unchanged import surface (from campus.common import ...) - the namespace portion comes from the installed dist instead of the suite wheel. Downstream repos relock to pick this up; locks pin the old suite until they choose to update. - tests/unit/common: 10 suites moved to campus-common; test_deploy / test_import_weight / test_openapi_spec stay (suite modules); test_url.py reduced to the codespace-deploy test (exercises campus.deploy); its url-utils coverage lives in campus-common. - tests/unit/test_package_boundaries.py: SHARED_ALLOWED drops the in-repo 'common' entry (its dir is gone - the rules would silently no-op); constraints on common itself moved to campus-common's tests/unit/test_boundaries.py. The remaining rules still govern importing campus.common from the in-tree layers via AST. Verified: unit + contract green in a fresh worktree venv (the sqlite concurrency flake reproduces only under parallel-suite CPU contention and passes isolated); campus.common resolves from the campus-common wheel while suite modules resolve from the tree; wheel audit green. Refs #970.
With campus/common gone from the tree, ruff's src-based first-party detection classified campus.common third-party and flagged every mixed import block as I001 (~30 files). known-first-party = ["campus"] pins the whole namespace; also rename a loop variable left unused by the moved common-specific rule (B007).
This was referenced Oct 28, 2026
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
campus.commonmoves to its own distribution: nyjc-computing/campus-common (v0.1.0, shipped first so this dep resolves). The monorepo declares it as a git dependency and ships nocampus/commonof its own. Consumer import syntax is unchanged —from campus.common import ...resolves through the shared PEP 420 namespace instead of the suite wheel.Downstream repos are unaffected until they choose to relock; locks pin the old campus-suite commit (with
campus/commonbaked in) until each repo updates. The downstream pass (sdk, classroom, admin, profile, nyxchange declarecampus-common; cli picks it up transitively) follows this merge.Changes
campus-common = {git = ".../campus-common.git", branch = "main"}alongside the existing campus-api-python pattern.campus/common/**deleted (24 files, verbatim-carved into campus-common@995bc2c).test_deploy/test_import_weight/test_openapi_specstay (they test suite modules);test_url.pyreduced to the codespace-deploy test (it exercisescampus.deploy) — its url-utils coverage lives in campus-common.SHARED_ALLOWEDdrops the in-repo"common"entry (its directory is gone, so the rules would silently no-op). The remaining AST rules still govern what in-tree layers may import fromcampus.common. Constraints on common itself (stdlib+bcrypt only, no sibling imports, lazy flask per chore(common): campus.common still imports flask at import time via campus/common/utils/url.py #861) are enforced by campus-common's own boundary guard (tests/unit/test_boundaries.py).Testing
poetry lockresolves campus-common 0.1.0; 724 unit tests + full contract suite green (the sqlite concurrency flake reproduces only under parallel-suite CPU contention; passes isolated)campus.commonresolves from the campus-common wheel (site-packages), suite modules resolve from the tree, both dists present (campus-common 0.1.0,campus-suite 0.1.16)poetry build+ namespace audit: suite wheel is an init-less portion with nocampus/commonRefs #970 (phase 3, dist 1 of 5). Non-closing.