diff options
author | Diego Ramirez <dr01191115@gmail.com> | 2021-11-29 09:29:14 -0600 |
---|---|---|
committer | Diego Ramirez <dr01191115@gmail.com> | 2021-11-29 09:29:14 -0600 |
commit | 7ced6c583bb7739628fd78d7bdece3ed4ce25303 (patch) | |
tree | bb2f917bf26069fd2cc9e0dcda46df8c5976129b | |
parent | 5c916121a92202cb8be16ffa0db83774fe271606 (diff) | |
download | pip-7ced6c583bb7739628fd78d7bdece3ed4ce25303.tar.gz |
Replace tox with Nox (CLI, docs)
-rw-r--r-- | .github/workflows/ci.yml | 14 | ||||
-rw-r--r-- | docs/html/development/getting-started.rst | 28 | ||||
-rw-r--r-- | noxfile.py | 6 |
3 files changed, 21 insertions, 27 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d3f70fca..e9885a499 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,17 +121,17 @@ jobs: if: matrix.os == 'MacOS' run: brew install bzr - - run: pip install tox 'virtualenv<20' + - run: pip install nox 'virtualenv<20' # Main check - name: Run unit tests run: >- - tox -e py -- + nox -s test-${{ matrix.python }} -- -m unit --verbose --numprocesses auto --showlocals - name: Run integration tests run: >- - tox -e py -- + nox -s test-${{ matrix.python }} -- -m integration --verbose --numprocesses auto --showlocals --durations=5 @@ -178,7 +178,7 @@ jobs: $acl.AddAccessRule($rule) Set-Acl "R:\Temp" $acl - - run: pip install tox 'virtualenv<20' + - run: pip install nox 'virtualenv<20' env: TEMP: "R:\\Temp" @@ -186,7 +186,7 @@ jobs: - name: Run unit tests if: matrix.group == 1 run: >- - tox -e py -- + nox -s test-${{ matrix.python }} -- -m unit --verbose --numprocesses auto --showlocals env: @@ -195,7 +195,7 @@ jobs: - name: Run integration tests (group 1) if: matrix.group == 1 run: >- - tox -e py -- + nox -s test-${{ matrix.python }} -- -m integration -k "not test_install" --verbose --numprocesses auto --showlocals env: @@ -204,7 +204,7 @@ jobs: - name: Run integration tests (group 2) if: matrix.group == 2 run: >- - tox -e py -- + nox -s test-${{ matrix.python }} -- -m integration -k "test_install" --verbose --numprocesses auto --showlocals env: diff --git a/docs/html/development/getting-started.rst b/docs/html/development/getting-started.rst index 3ba664f12..730f5ece0 100644 --- a/docs/html/development/getting-started.rst +++ b/docs/html/development/getting-started.rst @@ -27,8 +27,8 @@ Development Environment pip is a command line application written in Python. For developing pip, you should `install Python`_ on your computer. -For developing pip, you need to install :pypi:`tox`. Often, you can run -``python -m pip install tox`` to install and use it. +For developing pip, you need to install :pypi:`nox`. Often, you can run +``python -m pip install nox`` to install and use it. Running pip From Source Tree @@ -60,7 +60,7 @@ Running Tests ============= pip's tests are written using the :pypi:`pytest` test framework and -:mod:`unittest.mock`. :pypi:`tox` is used to automate the setup and execution +:mod:`unittest.mock`. :pypi:`nox` is used to automate the setup and execution of pip's tests. It is preferable to run the tests in parallel for better experience during development, @@ -70,29 +70,29 @@ To run tests: .. code-block:: console - $ tox -e py310 -- -n auto + $ nox -s test-3.10 -- -n auto To run tests without parallelization, run: .. code-block:: console - $ tox -e py310 + $ nox -s test-3.10 The example above runs tests against Python 3.10. You can also use other -versions like ``py39`` and ``pypy3``. +versions like ``3.9`` and ``pypy3``. -``tox`` has been configured to forward any additional arguments it is given to +``nox`` has been configured to forward any additional arguments it is given to ``pytest``. This enables the use of pytest's `rich CLI`_. As an example, you can select tests using the various ways that pytest provides: .. code-block:: console $ # Using file name - $ tox -e py310 -- tests/functional/test_install.py + $ nox -s test-3.10 -- tests/functional/test_install.py $ # Using markers - $ tox -e py310 -- -m unit + $ nox -s test-3.10 -- -m unit $ # Using keywords - $ tox -e py310 -- -k "install and not wheel" + $ nox -s test-3.10 -- -k "install and not wheel" Running pip's entire test suite requires supported version control tools (subversion, bazaar, git, and mercurial) to be installed. If you are missing @@ -101,8 +101,8 @@ explicitly tell pytest to skip those tests: .. code-block:: console - $ tox -e py310 -- -k "not svn" - $ tox -e py310 -- -k "not (svn or git)" + $ nox -s test-3.10 -- -k "not svn" + $ nox -s test-3.10 -- -k "not (svn or git)" Running Linters @@ -116,7 +116,7 @@ To use linters locally, run: .. code-block:: console - $ tox -e lint + $ nox -s lint .. note:: @@ -155,7 +155,7 @@ To build it locally, run: .. code-block:: console - $ tox -e docs + $ nox -s docs The built documentation can be found in the ``docs/build`` folder. diff --git a/noxfile.py b/noxfile.py index fcafb3ec2..7f1815d2e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -63,12 +63,6 @@ def should_update_common_wheels() -> bool: return need_to_repopulate -# ----------------------------------------------------------------------------- -# Development Commands -# These are currently prototypes to evaluate whether we want to switch over -# completely to nox for all our automation. Contributors should prefer using -# `tox -e ...` until this note is removed. -# ----------------------------------------------------------------------------- @nox.session(python=["3.7", "3.8", "3.9", "3.10", "pypy3"]) def test(session: nox.Session) -> None: # Get the common wheels. |