Skip to content
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

Fix pypy ci #3307

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ jobs:
- python-version: "pypy-3.8"
os: ubuntu-latest
experimental: false
nox-session: test-pypy
- python-version: "pypy-3.9"
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
21 changes: 18 additions & 3 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
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,7 +36,7 @@ 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.8 test-3.9 test-pypy3.8 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
.......
Expand All @@ -49,6 +49,21 @@ you::
.......
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.8
~/.pyenv/versions/3.8.16/bin/python3.8

$ which python3.9
~/.pyenv/versions/3.9.6/bin/python3.9

$ which pypy3.8
~/.pyenv/versions/pypy3.8-7.3.11/bin/pypy3.8


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
Original file line number Diff line number Diff line change
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