Closed bhazelton closed 1 year ago
Patch coverage: 100.00
% and project coverage change: +0.14
:tada:
Comparison is base (
957afd3
) 99.85% compared to head (8ecc7f2
) 100.00%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Description
Use the
src
layout to ensure that we're testing the package as it is installed for users.Also update the github actions to use current versions of actions and update the release date of the last version in the changelog
Motivation and Context
The "flat" layout we were using before made it so that we were not actually testing the package as it would be installed by most users. This was revealed by the coverage issues in #203.
After doing a bunch of reading on these issues and talking with other RASG folks on telecons, we decided the best approach was to move to the
src
layout. We're doing it here first to work out the sticking points in a relatively simple python-only package.I initially tried to also update to the most current packaging practices, using the
pyproj.toml
file and removing thesetup.py
file. I ran into trouble with this becausesetuptools_scm
does not currently support defining custom versioning schemes using thepyproj.toml
(see the issue log in that repo for several related issues). The primary developer on that package says support for that will be included in the next version ofsetuptools_scm
, we can re-visit the packaging at that point.In order to make our current versioning scheme work with this new layout I actually had to copy the code for it to two places (yuck!) but that seemed to be the only way to be able to get it to work without modifying the python path in
setup.py
which we really do not want to do (among other issues, it causes us to not be testing the installed package). If anyone has a better approach, please let me know!A major issue was getting the coverage reports to be properly generated in the actions. Many things messed that up, and one obvious approach (setting
--cov=src/pyradiosky
) does not work because it leads to us not actually testing the installed package. The solution I came up with was to set--cov=.
but then it also picks up the docs folder and thesetup.py
file in the coverage reports. The docs folder was easy to fix by adding it to the omit list in our.coveragerc
file. But for some reason, adding setup.py to that list results in coverage reports not being generated in CI. So I addedpragma: no cover
markers to cover all the lines of setup.py. It's an ugly solution, if anyone has a better approach please tell me!Checklists:
Build/CI Change Checklist: