Repository navigation
Add nox configuration file with environments for building documentation and running mypy - #2654
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2654 +/- ##
=======================================
Coverage 95.22% 95.22%
=======================================
Files 103 103
Lines 9401 9401
Branches 2151 2151
=======================================
Hits 8952 8952
Misses 274 274
Partials 175 175 ☔ View full report in Codecov by Sentry. |
| sphinx_commands = ( | ||
| "sphinx-build", | ||
| "docs/", | ||
| "docs/build/html", | ||
| "--nitpicky", | ||
| "--fail-on-warning", | ||
| "--keep-going", | ||
| ) | ||
|
|
||
| html = ("-b", "html") | ||
| check_hyperlinks = ("-b", "linkcheck") |
There was a problem hiding this comment.
📝 By defining the options into discrete groups like this, we can compose different environments to build the docs 📚 with different option sets ⚙️, which should make the commands more reusable. I suspect it'll be more maintainable too, since the commands that get reused are isolated from the details of the testing environment
| settings.register_profile("debug", max_examples=10, verbosity=Verbosity.verbose) | ||
| settings.load_profile(os.getenv("HYPOTHESIS_PROFILE", "default")) | ||
|
|
||
| collect_ignore = ["noxfile.py"] |
There was a problem hiding this comment.
❔ I wasn't able to get pytest to ignore this file from within pyproject.toml, since I could only find options for ignoring directories rather than files.
It should also help to have a global pytest configuration file so that it works for both regular tests (in tests/) and doctests (in src/plasmapy/).
|
Thank you for the reviews! 😸 |
Description
This PR adds
noxfile.py, which is a configuration file fornox. So far it includes testing environments for building docs and running mypy. After installingnoxanduv, the environments can be run with commands likenox -e docsornox -e mypyin the top-level directory of the repository.Motivation and context
We currently use
toxas our test runner. The configuration fortoxis given intox.ini. I've personally foundtox.inito be incredibly difficult to parse and understand.noxis a test runner that was originally inspired bytox. Unliketox, the configuration file fornoxis a Python file:noxfile.py. In my limited experience, setting up and modifying test environments defined innoxfile.pyhas been considerably less difficult than doing the same intox.ini.This PR is only to add
noxfile.pywithout adding it to the CI suite and without removing anything fromtox.ini. Subsequent steps include:tox.iniRelated issues
#1734, #1735