Skip to content

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 6, 2024

What do these changes do?

Convert project to use a src layout

Are there changes in behavior for the user?

no, packaging change only

Related issue number

see #18

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 6, 2024
Copy link

codecov bot commented Oct 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.86%. Comparing base (f35d343) to head (6c25173).
Report is 65 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #22      +/-   ##
==========================================
- Coverage   86.63%   84.86%   -1.77%     
==========================================
  Files          15       14       -1     
  Lines         591      555      -36     
  Branches       50       50              
==========================================
- Hits          512      471      -41     
- Misses         63       66       +3     
- Partials       16       18       +2     
Flag Coverage Δ
CI-GHA 84.86% <ø> (-1.43%) ⬇️
MyPy 68.92% <ø> (ø)
OS-Linux 95.40% <ø> (-3.73%) ⬇️
OS-Windows 92.85% <ø> (-3.58%) ⬇️
OS-macOS 92.85% <ø> (-4.13%) ⬇️
Py-3.10.11 92.85% <ø> (-4.13%) ⬇️
Py-3.10.15 94.89% <ø> (-3.81%) ⬇️
Py-3.11.10 94.89% <ø> (-3.81%) ⬇️
Py-3.11.9 92.85% <ø> (-4.13%) ⬇️
Py-3.12.6 94.89% <ø> (-3.81%) ⬇️
Py-3.13.0-rc.3 94.89% <ø> (-3.81%) ⬇️
Py-3.8.10 92.85% <ø> (+13.97%) ⬆️
Py-3.8.18 94.89% <ø> (+14.29%) ⬆️
Py-3.9.13 92.85% <ø> (-4.13%) ⬇️
Py-3.9.20 94.89% <ø> (-3.81%) ⬇️
Py-pypy7.3.11 94.38% <ø> (ø)
Py-pypy7.3.16 94.38% <ø> (ø)
Py-pypy7.3.17 94.38% <ø> (ø)
VM-macos-latest 92.85% <ø> (-4.13%) ⬇️
VM-ubuntu-latest 95.40% <ø> (-3.73%) ⬇️
VM-windows-latest 92.85% <ø> (-3.58%) ⬇️
pytest 95.40% <ø> (-3.73%) ⬇️

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

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

@bdraco bdraco marked this pull request as ready for review October 6, 2024 16:36
@bdraco bdraco merged commit 8341c43 into master Oct 6, 2024
46 of 49 checks passed
@bdraco bdraco deleted the relocate_src branch October 6, 2024 16:44
bdraco added a commit that referenced this pull request Oct 6, 2024
This turned out to not be needed from #22
bdraco added a commit that referenced this pull request Oct 6, 2024
This turned out to not be needed from #22
packaging/,
tests/,
propcache/
src/propcache/
Copy link
Member

Choose a reason for hiding this comment

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

@bdraco I concluded that it's possible to just have src/ here and then, this config can be synchronized across projects w/o needing to adjust project-specific names. Also, this list was supposed to be sorted so it'd be packaging, src, tests.


cov: lint .develop
pytest --cov propcache --cov-report html --cov-report term ./tests/ ./propcache/
pytest --cov src/propcache --cov-report html --cov-report term ./tests
Copy link
Member

Choose a reason for hiding this comment

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

@bdraco with .coveragerc having all the necessary configuration, the pytest invocations should just have the --cov option without any arguments, which also makes sure that other parts of the layout are measured.

This probably also causes these weird paths under /Users/ to show up, like https://app.codecov.io/gh/aio-libs/propcache/tree/master/Users%2Frunner%2Fwork%2Fpropcache%2Fpropcache%2Fsrc%2Fpropcache. And I see that .py files are displayed on the top level, while .pyx are under src/ on Codecov.

--cov corresponds to the source = setting in Coveragepy which accepts both importable identifiers and file paths, which is ambiguous. To make it cleaner, .coveragerc marks the entire project as source and specifies source_pkgs which only works with importables.

Copy link
Member

Choose a reason for hiding this comment

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

Oh.. there's actually another place that is missing — .coveragerc's path mapping doesn't take into account src which is likely one of the main causes of broken path mapping. Drop in this section https://github.com/ansible/awx_plugins.interfaces/blob/fc44b24/.coveragerc#L5-L12 to fix it. It maps src to site-packages w/o using project-specific names, which makes it copy-paste-friendly too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants