Skip to content

Adopt src layout: move falcon/ to src/falcon/#110

Merged
cweniger merged 1 commit into
mainfrom
refactor/src-layout
Jun 29, 2026
Merged

Adopt src layout: move falcon/ to src/falcon/#110
cweniger merged 1 commit into
mainfrom
refactor/src-layout

Conversation

@cweniger

Copy link
Copy Markdown
Owner

Summary

Converts the repo from a flat package layout to a src layout (falcon/src/falcon/). With the package under src/, a repo checkout no longer puts an importable falcon/ on sys.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 gains where = ["src"].
  • mkdocs.yml: mkdocstrings Python handler paths: [.]paths: [src] so griffe finds the source.
  • .github/workflows/docs.yml: docs path trigger falcon/**src/falcon/**.

Unchanged / compatibility

  • Import path (import falcon), the falcon console script (falcon.cli:main), and the falcon-sbi distribution name are all unchanged.
  • tests.yml already runs pip install -e . before pytest --cov=falcon (import name, not path) — no change needed.
  • publish.yml builds via python -m build, driven by the updated pyproject discovery.
  • Verified 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 at src/falcon. Note that with src layout, local pytest runs against the installed package, so the editable reinstall is required to test local changes.

Test plan

  • find_packages(where="src", ...) discovers all packages
  • No leftover top-level falcon/
  • CI: pip install -e . + pytest -m "not slow" green
  • CI: docs build (mkdocs) resolves API pages via paths: [src]

🤖 Generated with Claude Code

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

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 10.33%. Comparing base (90bccbf) to head (d081038).

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           
Flag Coverage Δ
unit 10.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cweniger cweniger merged commit d3c33ba into main Jun 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant