Skip to content

Fix support for src/ layout even without setup.py - #161

Merged
astrofrog merged 5 commits into
astropy:mainfrom
astrofrog:src-layout-hook
Sep 15, 2026
Merged

astrofrog merged 5 commits into
astropy:mainfrom
astrofrog:src-layout-hook

Conversation

@astrofrog

Copy link
Copy Markdown
Member

This is built on top of #157 and should be rebased once that PR is merged

@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 19.23077% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.61%. Comparing base (3b398a6) to head (bb72376).

Files with missing lines Patch % Lines
extension_helpers/__init__.py 16.66% 20 Missing ⚠️
extension_helpers/_setup_helpers.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
- Coverage   80.21%   76.61%   -3.60%     
==========================================
  Files           4        4              
  Lines         379      402      +23     
==========================================
+ Hits          304      308       +4     
- Misses         75       94      +19     

☔ 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.

@astrofrog
astrofrog marked this pull request as ready for review September 15, 2026 10:57
@astrofrog
astrofrog requested a review from Cadair September 15, 2026 10:57
[options]
packages = find:
package_dir =
= {'src' if src_layout else '.'}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this valid?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops not sure what happened there but indeed very weird that this works

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No wait sorry it's fine it's standard recommendation for src/ layout, see e.g. https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#using-a-src-layout

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# This example contains just the necessary options for a src-layout, set up
# the rest of the file as described above.

[options]
package_dir=
    =src
packages=find:

[options.packages.find]
where=src

@astrofrog
astrofrog merged commit 221a0ec into astropy:main Sep 15, 2026
17 of 19 checks passed
@astrofrog astrofrog added the enhancement New feature or request label Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants