-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Update noxutil.py #359
Update noxutil.py #359
Conversation
Add `python` parameter to `get_version()` allowing one to limit versions based on the python version.
Codecov Report
@@ Coverage Diff @@
## master #359 +/- ##
==========================================
- Coverage 77.48% 77.46% -0.03%
==========================================
Files 92 92
Lines 14633 14633
Branches 3274 3274
==========================================
- Hits 11338 11335 -3
- Misses 2853 2854 +1
- Partials 442 444 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
My first test: EDIT: Ah, now I see that the python version corresponds to the python version specified for the dependency in my pyproject.toml. |
Sorry, yes, an example sys.path.append(".")
from noxutils import get_versions
python_versions = ["3.6", "3.7", "3.8", "3.9", "3.10"]
@session(reuse_venv=True)
@nox.parametrize("python,sphinx",
sum([[(python, sphinx)
for sphinx in get_versions("sphinx", "minor", python=python)]
for python in python_versions],
[]),
)
def test(session, sphinx):
# nox_poetry uses the info in poetry.lock but you need to specify the test
# dependencies here:
session.install("sphinx-testing", "pytest-cov", ".")
# Override sphinx, but using get_versions() makes sure this is consistent
session.run("pip", "install", f"sphinx=={sphinx}")
session.run("pytest") I am a bit confused: your example |
Thanks! I was able to get closer to get it working once I realized that I needed to set python-version dependent Sphinx requirements in my pyproject.toml (as you suggested in your original comment). I needed to upgrade Poetry because I ran into an issue with it generating an invalid version constraint (I forgot the details, unfortunately), but now I'm running into python-poetry/poetry-plugin-export#118, so I'll first need to fix that before I can start using this. |
Merged. Many thanks for taking the time to make this PR! |
Only use Python 3.9 if the Sphinx version requires it. This requires setting the Python version requirement for Sphinx in our pyproject.toml (see #359).
Add
python
parameter toget_version()
allowing one to limit versions based on the python version.This allows one to parse multiple requirements like