Skip to content

Commit

Permalink
Add test-pypy 3.8 3.9 3.10 nox sessions (#3304)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecerulm committed Jan 24, 2024
1 parent fb6cf2d commit 89ed0d6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -66,15 +66,15 @@ jobs:
- python-version: "pypy-3.8"
os: ubuntu-latest
experimental: false
nox-session: test-pypy
nox-session: test-pypy3.8
- python-version: "pypy-3.9-v7.3.13"
os: ubuntu-latest
experimental: false
nox-session: test-pypy
nox-session: test-pypy3.9
- python-version: "pypy-3.10"
os: ubuntu-latest
experimental: false
nox-session: test-pypy
nox-session: test-pypy3.10
- python-version: "3.x"
# brotli
os: ubuntu-latest
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
if: ${{ matrix.nox-session == 'emscripten' }}
- name: "Run tests"
# If no explicit NOX_SESSION is set, run the default tests for the chosen Python version
run: nox -s ${NOX_SESSION:-test-$PYTHON_VERSION} --error-on-missing-interpreters
run: nox -s ${NOX_SESSION:-test-$PYTHON_VERSION}
env:
PYTHON_VERSION: ${{ matrix.python-version }}
NOX_SESSION: ${{ matrix.nox-session }}
Expand Down
29 changes: 16 additions & 13 deletions docs/contributing.rst
Expand Up @@ -13,8 +13,8 @@ If you wish to add a new feature or fix a bug:
to start making your changes.
#. Write a test which shows that the bug was fixed or that the feature works
as expected.
#. Format your changes with black using command `$ nox -rs format` and lint your
changes using command `nox -rs lint`.
#. Format your changes with black using command ``nox -rs format`` and lint your
changes using command ``nox -rs lint``.
#. Add a `changelog entry
<https://github.com/urllib3/urllib3/blob/main/changelog/README.rst>`__.
#. Send a pull request and bug the maintainer until it gets merged and published.
Expand All @@ -36,18 +36,21 @@ We use some external dependencies, multiple interpreters and code coverage
analysis while running test suite. Our ``noxfile.py`` handles much of this for
you::

$ nox --reuse-existing-virtualenvs --sessions test-3.8 test-3.9
$ nox --reuse-existing-virtualenvs --sessions test-3.12 test-pypy3.10
[ Nox will create virtualenv if needed, install the specified dependencies, and run the commands in order.]
nox > Running session test-3.8
.......
.......
nox > Session test-3.8 was successful.
.......
.......
nox > Running session test-3.9
.......
.......
nox > Session test-3.9 was successful.


Note that for nox to test different interpreters, the interpreters must be on the
``PATH`` first. Check with ``which`` to see if the interpreter is on the ``PATH``
like so::


$ which python3.12
~/.pyenv/versions/3.12.1/bin/python3.12

$ which pypy3.10
~/.pyenv/versions/pypy3.10-7.3.13/bin/pypy3.10


There is also a nox command for running all of our tests and multiple python
versions.::
Expand Down
6 changes: 5 additions & 1 deletion noxfile.py
Expand Up @@ -8,6 +8,8 @@

import nox

nox.options.error_on_missing_interpreters = True


def tests_impl(
session: nox.Session,
Expand Down Expand Up @@ -85,7 +87,9 @@ def tests_impl(
)


@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "pypy"])
@nox.session(
python=["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10"]
)
def test(session: nox.Session) -> None:
tests_impl(session)

Expand Down

0 comments on commit 89ed0d6

Please sign in to comment.