New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to src
layout with separate tests
directory
#2598
Conversation
This one is to ignore trailing whitespace, but this is handled by ruff-format and so is unnecessary. My motivation for removing this rule was because enabling the ruff extension for PyCharm made it so that trailing whitespace was highlighted, even while code was still being written.
@@ -12,15 +12,13 @@ include *.yaml | |||
include *.yml | |||
include changelog/README.rst | |||
include CITATION.cff | |||
include plasmapy/py.typed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 This line is probably not necessary because everything within src
is now included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ I'm not sure if we want to include tests/
in MANIFEST.in
. I'd like the tests to be included in source distributions for completeness, but not included in wheels.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2598 +/- ##
=======================================
Coverage 95.17% 95.18%
=======================================
Files 104 103 -1
Lines 9417 9412 -5
Branches 2154 2153 -1
=======================================
- Hits 8963 8959 -4
Misses 276 276
+ Partials 178 177 -1 ☔ View full report in Codecov by Sentry. |
Preview of admonition from GitHub Action to post on PRs: Note PlasmaPy recently switched to an |
@namurphy FYI I had to re-do the editable installation in order to get internal imports working again after this merge, e.g. Also, the |
@pheuer — thank you for the follow-up! I'll add something to (Also I'm at UCLA working next to @rocco8773 today, and just saw two of your posters in the hallway here!) |
Description
This PR changes the layout to be aligned with what is now recommended in the PyPA Python Packaging Guide. The following changes are made:
plasmapy/
directory has been changed tosrc/plasmapy/
tests/
directory.Below I included my suggestions for other projects on switching to an src layout.
Motivation and context
See #2581 for the motivation. Essentially, the
src
layout can prevent a variety of easy-to-overlook problems. My hope is to get this merged well ahead of the summer school, since we're hoping to welcome new & potential contributors.Code review checklist
While this PR says it modifies ∼239 files 😱, nearly all of the files were moved without being changed and don't require review. 😮💨 The files that warrant the most attention are:
docs/contributing/testing_guide.rst
changelog/2598.internal.rst
pyproject.toml
tests/__init__.py
Thank you! 🙏🏻
Task checklist
git mv plasmapy src/plasmapy
tests/
.gitignore
pathsMANIFEST.in
.pre-commit-config.yaml
mypy.ini
pyproject.toml
: updatesetuptools
&setuptools_scm
pathspyproject.toml
: updatetestpaths
inpytest
pyproject.toml
: updatecoverage
settings (definesource
and update paths inomit
)pyproject.toml
: inisort
settings, addplasmapy
asknown-first-party
pyproject.toml
: updateruff
per-file ignorestox.ini
: updatepytest
commandtox.ini
: Updatemypy
commandRelated issues
Closes #2581.