Adopt src layout: move falcon/ to src/falcon/#110
Merged
Conversation
Switch from a flat to a src package layout. Under src/, a repo checkout no longer puts an importable `falcon/` on sys.path, so imports always resolve to the installed package instead of being silently shadowed by the working directory. - git mv falcon -> src/falcon - pyproject: setuptools package discovery gains where = ["src"] - mkdocs: mkdocstrings handler paths [.] -> [src] so griffe finds source - docs workflow: path trigger falcon/** -> src/falcon/** The import path (`falcon`), the `falcon` console script, and the falcon-sbi distribution name are all unchanged. After pulling this, re-run `pip install -e .` so the editable install points at src/falcon. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
=======================================
Coverage 10.33% 10.33%
=======================================
Files 30 30
Lines 3927 3927
=======================================
Hits 406 406
Misses 3521 3521
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Converts the repo from a flat package layout to a src layout (
falcon/→src/falcon/). With the package undersrc/, a repo checkout no longer puts an importablefalcon/onsys.path, so imports always resolve to the installed package rather than being silently shadowed by the current working directory — the standard motivation for src layout, and a real footgun here since there are multiple local checkouts.Changes
git mv falcon src/falcon(30 files, pure renames — no content changes).pyproject.toml: setuptools package discovery gainswhere = ["src"].mkdocs.yml: mkdocstrings Python handlerpaths: [.]→paths: [src]so griffe finds the source..github/workflows/docs.yml: docs path triggerfalcon/**→src/falcon/**.Unchanged / compatibility
import falcon), thefalconconsole script (falcon.cli:main), and thefalcon-sbidistribution name are all unchanged.tests.ymlalready runspip install -e .beforepytest --cov=falcon(import name, not path) — no change needed.publish.ymlbuilds viapython -m build, driven by the updated pyproject discovery.find_packages(where="src", include=["falcon*"])returns the same 5 packages (falcon,falcon.core,falcon.embeddings,falcon.estimators,falcon.priors).After merging
Re-run
pip install -e .in any working checkout so the editable install repoints atsrc/falcon. Note that with src layout, localpytestruns against the installed package, so the editable reinstall is required to test local changes.Test plan
find_packages(where="src", ...)discovers all packagesfalcon/pip install -e .+pytest -m "not slow"greenpaths: [src]🤖 Generated with Claude Code