Skip to content

Commit 8ef91cf

Browse files
authored
Merge pull request #10693 from DiddiLeija/tox-to-nox
2 parents 8d4fb05 + a829016 commit 8ef91cf

File tree

5 files changed

+39
-100
lines changed

5 files changed

+39
-100
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ jobs:
8484
- uses: actions/checkout@v2
8585
- uses: actions/setup-python@v2
8686

87-
- run: pip install vendoring
88-
- run: vendoring sync . --verbose
87+
- run: pip install nox
88+
- run: nox -s vendoring
8989
- run: git diff --exit-code
9090

9191
tests-unix:
@@ -121,17 +121,17 @@ jobs:
121121
if: matrix.os == 'MacOS'
122122
run: brew install bzr
123123

124-
- run: pip install tox 'virtualenv<20'
124+
- run: pip install nox 'virtualenv<20'
125125

126126
# Main check
127127
- name: Run unit tests
128128
run: >-
129-
tox -e py --
129+
nox -s test-${{ matrix.python }} --
130130
-m unit
131131
--verbose --numprocesses auto --showlocals
132132
- name: Run integration tests
133133
run: >-
134-
tox -e py --
134+
nox -s test-${{ matrix.python }} --
135135
-m integration
136136
--verbose --numprocesses auto --showlocals
137137
--durations=5
@@ -178,15 +178,15 @@ jobs:
178178
$acl.AddAccessRule($rule)
179179
Set-Acl "R:\Temp" $acl
180180
181-
- run: pip install tox 'virtualenv<20'
181+
- run: pip install nox 'virtualenv<20'
182182
env:
183183
TEMP: "R:\\Temp"
184184

185185
# Main check
186186
- name: Run unit tests
187187
if: matrix.group == 1
188188
run: >-
189-
tox -e py --
189+
nox -s test-${{ matrix.python }} --
190190
-m unit
191191
--verbose --numprocesses auto --showlocals
192192
env:
@@ -195,7 +195,7 @@ jobs:
195195
- name: Run integration tests (group 1)
196196
if: matrix.group == 1
197197
run: >-
198-
tox -e py --
198+
nox -s test-${{ matrix.python }} --
199199
-m integration -k "not test_install"
200200
--verbose --numprocesses auto --showlocals
201201
env:
@@ -204,7 +204,7 @@ jobs:
204204
- name: Run integration tests (group 2)
205205
if: matrix.group == 2
206206
run: >-
207-
tox -e py --
207+
nox -s test-${{ matrix.python }} --
208208
-m integration -k "test_install"
209209
--verbose --numprocesses auto --showlocals
210210
env:

docs/html/development/getting-started.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Development Environment
2727
pip is a command line application written in Python. For developing pip,
2828
you should `install Python`_ on your computer.
2929

30-
For developing pip, you need to install :pypi:`tox`. Often, you can run
31-
``python -m pip install tox`` to install and use it.
30+
For developing pip, you need to install :pypi:`nox`. Often, you can run
31+
``python -m pip install nox`` to install and use it.
3232

3333

3434
Running pip From Source Tree
@@ -60,7 +60,7 @@ Running Tests
6060
=============
6161

6262
pip's tests are written using the :pypi:`pytest` test framework and
63-
:mod:`unittest.mock`. :pypi:`tox` is used to automate the setup and execution
63+
:mod:`unittest.mock`. :pypi:`nox` is used to automate the setup and execution
6464
of pip's tests.
6565

6666
It is preferable to run the tests in parallel for better experience during development,
@@ -70,29 +70,29 @@ To run tests:
7070

7171
.. code-block:: console
7272
73-
$ tox -e py310 -- -n auto
73+
$ nox -s test-3.10 -- -n auto
7474
7575
To run tests without parallelization, run:
7676

7777
.. code-block:: console
7878
79-
$ tox -e py310
79+
$ nox -s test-3.10
8080
8181
The example above runs tests against Python 3.10. You can also use other
82-
versions like ``py39`` and ``pypy3``.
82+
versions like ``3.9`` and ``pypy3``.
8383

84-
``tox`` has been configured to forward any additional arguments it is given to
84+
``nox`` has been configured to forward any additional arguments it is given to
8585
``pytest``. This enables the use of pytest's `rich CLI`_. As an example, you
8686
can select tests using the various ways that pytest provides:
8787

8888
.. code-block:: console
8989
9090
$ # Using file name
91-
$ tox -e py310 -- tests/functional/test_install.py
91+
$ nox -s test-3.10 -- tests/functional/test_install.py
9292
$ # Using markers
93-
$ tox -e py310 -- -m unit
93+
$ nox -s test-3.10 -- -m unit
9494
$ # Using keywords
95-
$ tox -e py310 -- -k "install and not wheel"
95+
$ nox -s test-3.10 -- -k "install and not wheel"
9696
9797
Running pip's entire test suite requires supported version control tools
9898
(subversion, bazaar, git, and mercurial) to be installed. If you are missing
@@ -101,8 +101,8 @@ explicitly tell pytest to skip those tests:
101101

102102
.. code-block:: console
103103
104-
$ tox -e py310 -- -k "not svn"
105-
$ tox -e py310 -- -k "not (svn or git)"
104+
$ nox -s test-3.10 -- -k "not svn"
105+
$ nox -s test-3.10 -- -k "not (svn or git)"
106106
107107
108108
Running Linters
@@ -116,7 +116,7 @@ To use linters locally, run:
116116

117117
.. code-block:: console
118118
119-
$ tox -e lint
119+
$ nox -s lint
120120
121121
.. note::
122122

@@ -155,7 +155,7 @@ To build it locally, run:
155155

156156
.. code-block:: console
157157
158-
$ tox -e docs
158+
$ nox -s docs
159159
160160
The built documentation can be found in the ``docs/build`` folder.
161161

news/10693.process.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Replace all our tox operations with Nox.

noxfile.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ def should_update_common_wheels() -> bool:
6565

6666
# -----------------------------------------------------------------------------
6767
# Development Commands
68-
# These are currently prototypes to evaluate whether we want to switch over
69-
# completely to nox for all our automation. Contributors should prefer using
70-
# `tox -e ...` until this note is removed.
7168
# -----------------------------------------------------------------------------
7269
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "pypy3"])
7370
def test(session: nox.Session) -> None:
@@ -223,6 +220,21 @@ def pinned_requirements(path: Path) -> Iterator[Tuple[str, str]]:
223220
release.commit_file(session, ".", message=message)
224221

225222

223+
@nox.session
224+
def coverage(session: nox.Session) -> None:
225+
if not os.path.exists("./.coverage-output"):
226+
os.mkdir("./.coverage-output")
227+
session.run(
228+
"pytest",
229+
"--cov=pip",
230+
"--cov-config=./setup.cfg",
231+
env={
232+
"COVERAGE_OUTPUT_DIR": "./.coverage-output",
233+
"COVERAGE_PROCESS_START": "./setup.cfg",
234+
},
235+
)
236+
237+
226238
# -----------------------------------------------------------------------------
227239
# Release Commands
228240
# -----------------------------------------------------------------------------

tox.ini

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)