Skip to content

Commit 6b6f133

Browse files
authored
Merge pull request #842 from nicoddemus/drop-py36-add-py311
Drop Python 3.6 and add Python 3.11
2 parents 59457cc + 0316baf commit 6b6f133

File tree

14 files changed

+132
-119
lines changed

14 files changed

+132
-119
lines changed

Diff for: .github/workflows/deploy.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
deploy:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
# Needed to fetch tags, which are required by setuptools-scm.
17+
fetch-depth: 0
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: "3.10"
22+
- name: Install build
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build
26+
- name: Build package
27+
run: |
28+
python -m build
29+
- name: Publish package to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
user: __token__
33+
password: ${{ secrets.pypi_token }}

Diff for: .github/workflows/main.yml

-87
This file was deleted.

Diff for: .github/workflows/test.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- "*"
7+
8+
pull_request:
9+
branches:
10+
- "*"
11+
12+
jobs:
13+
test:
14+
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
tox_env:
21+
- "py37-pytestlatest"
22+
- "py38-pytestlatest"
23+
- "py39-pytestlatest"
24+
- "py310-pytestlatest"
25+
- "py310-pytestmain"
26+
- "py311-pytestlatest"
27+
- "py311-pytestmain"
28+
- "py310-psutil"
29+
- "py310-setproctitle"
30+
31+
os: [ubuntu-latest, windows-latest]
32+
include:
33+
- tox_env: "py37-pytestlatest"
34+
python: "3.7"
35+
- tox_env: "py38-pytestlatest"
36+
python: "3.8"
37+
- tox_env: "py39-pytestlatest"
38+
python: "3.9"
39+
- tox_env: "py310-pytestlatest"
40+
python: "3.10"
41+
- tox_env: "py310-pytestmain"
42+
python: "3.10"
43+
- tox_env: "py311-pytestlatest"
44+
python: "3.11"
45+
- tox_env: "py311-pytestmain"
46+
python: "3.11"
47+
- tox_env: "py310-psutil"
48+
python: "3.10"
49+
- tox_env: "py310-setproctitle"
50+
python: "3.10"
51+
52+
steps:
53+
- uses: actions/checkout@v3
54+
with:
55+
# Needed to fetch tags, which are required by setuptools-scm.
56+
fetch-depth: 0
57+
- name: Set up Python
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: ${{ matrix.python }}
61+
- name: Install tox
62+
run: |
63+
python -m pip install --upgrade pip
64+
pip install tox
65+
- name: Test
66+
run: |
67+
tox -e ${{ matrix.tox_env }}

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pytest-xdist
1313
:alt: Python versions
1414
:target: https://pypi.python.org/pypi/pytest-xdist
1515

16-
.. image:: https://github.com/pytest-dev/pytest-xdist/workflows/build/badge.svg
16+
.. image:: https://github.com/pytest-dev/pytest-xdist/workflows/test/badge.svg
1717
:target: https://github.com/pytest-dev/pytest-xdist/actions
1818

1919
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg

Diff for: changelog/842.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python 3.11 is now officially supported.

Diff for: changelog/842.removal.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Python 3.6 is no longer supported.

Diff for: setup.cfg

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ classifiers =
2424
Programming Language :: Python
2525
Programming Language :: Python :: 3
2626
Programming Language :: Python :: 3 :: Only
27-
Programming Language :: Python :: 3.6
2827
Programming Language :: Python :: 3.7
2928
Programming Language :: Python :: 3.8
3029
Programming Language :: Python :: 3.9
3130
Programming Language :: Python :: 3.10
31+
Programming Language :: Python :: 3.11
3232
license_file = LICENSE
3333
project_urls =
3434
Documentation=https://pytest-xdist.readthedocs.io/en/latest
@@ -40,7 +40,7 @@ project_urls =
4040
packages = find:
4141
package_dir = =src
4242
zip_safe = False
43-
python_requires = >=3.6
43+
python_requires = >=3.7
4444
install_requires =
4545
execnet>=1.1
4646
pytest>=6.2.0

Diff for: src/xdist/dsession.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def worker_workerfinished(self, node):
169169
"""
170170
self.config.hook.pytest_testnodedown(node=node, error=None)
171171
if node.workeroutput["exitstatus"] == 2: # keyboard-interrupt
172-
self.shouldstop = "{} received keyboard-interrupt".format(node)
172+
self.shouldstop = f"{node} received keyboard-interrupt"
173173
self.worker_errordown(node, "keyboard-interrupt")
174174
return
175175
if node in self.sched.nodes:
@@ -230,7 +230,7 @@ def worker_errordown(self, node, error):
230230
@pytest.hookimpl
231231
def pytest_terminal_summary(self, terminalreporter):
232232
if self.config.option.verbose >= 0 and self._summary_report:
233-
terminalreporter.write_sep("=", "xdist: {}".format(self._summary_report))
233+
terminalreporter.write_sep("=", f"xdist: {self._summary_report}")
234234

235235
def worker_collectionfinish(self, node, ids):
236236
"""worker has finished test collection.
@@ -345,7 +345,7 @@ def handle_crashitem(self, nodeid, worker):
345345
# XXX count no of failures and retry N times
346346
runner = self.config.pluginmanager.getplugin("runner")
347347
fspath = nodeid.split("::")[0]
348-
msg = "worker {!r} crashed while running {!r}".format(worker.gateway.id, nodeid)
348+
msg = f"worker {worker.gateway.id!r} crashed while running {nodeid!r}"
349349
rep = runner.TestReport(
350350
nodeid, (fspath, None, fspath), (), "failed", msg, "???"
351351
)
@@ -381,9 +381,7 @@ def setstatus(self, spec, status, show=True):
381381

382382
def getstatus(self):
383383
if self.config.option.verbose >= 0:
384-
parts = [
385-
"{} {}".format(spec.id, self._status[spec.id]) for spec in self._specs
386-
]
384+
parts = [f"{spec.id} {self._status[spec.id]}" for spec in self._specs]
387385
return " / ".join(parts)
388386
else:
389387
return "bringing up nodes..."
@@ -431,7 +429,7 @@ def pytest_testnodeready(self, node):
431429
def pytest_testnodedown(self, node, error):
432430
if not error:
433431
return
434-
self.write_line("[{}] node down: {}".format(node.gateway.id, error))
432+
self.write_line(f"[{node.gateway.id}] node down: {error}")
435433

436434

437435
def get_default_max_worker_restart(config):

Diff for: src/xdist/looponfail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def repr_pytest_looponfailinfo(failreports, rootdirs):
146146
tr.line(report, red=True)
147147
tr.sep("#", "waiting for changes", bold=True)
148148
for rootdir in rootdirs:
149-
tr.line("### Watching: {}".format(rootdir), bold=True)
149+
tr.line(f"### Watching: {rootdir}", bold=True)
150150

151151

152152
def init_worker_session(channel, args, option_dict):

Diff for: src/xdist/remote.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def pytest_collection_modifyitems(self, session, config, items):
149149
if len(mark.args) > 0
150150
else mark.kwargs.get("name", "default")
151151
)
152-
item._nodeid = "{}@{}".format(item.nodeid, gname)
152+
item._nodeid = f"{item.nodeid}@{gname}"
153153

154154
@pytest.hookimpl
155155
def pytest_collection_finish(self, session):

Diff for: src/xdist/scheduler/loadscope.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,12 @@ def schedule(self):
361361
extra_nodes = len(self.nodes) - len(self.workqueue)
362362

363363
if extra_nodes > 0:
364-
self.log("Shutting down {} nodes".format(extra_nodes))
364+
self.log(f"Shutting down {extra_nodes} nodes")
365365

366366
for _ in range(extra_nodes):
367367
unused_node, assigned = self.assigned_work.popitem(last=True)
368368

369-
self.log("Shutting down unused node {}".format(unused_node))
369+
self.log(f"Shutting down unused node {unused_node}")
370370
unused_node.shutdown()
371371

372372
# Assign initial workload

Diff for: src/xdist/workermanage.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def get_dir(p):
112112
for root in candidates:
113113
root = Path(root).resolve()
114114
if not root.exists():
115-
raise pytest.UsageError("rsyncdir doesn't exist: {!r}".format(root))
115+
raise pytest.UsageError(f"rsyncdir doesn't exist: {root!r}")
116116
if root not in roots:
117117
roots.append(root)
118118
return roots
@@ -192,7 +192,7 @@ def _report_send_file(self, gateway, modified_rel_path):
192192
if self._verbose > 0:
193193
path = os.path.basename(self._sourcedir) + "/" + modified_rel_path
194194
remotepath = gateway.spec.chdir
195-
print("{}:{} <= {}".format(gateway.spec, remotepath, path))
195+
print(f"{gateway.spec}:{remotepath} <= {path}")
196196

197197

198198
def make_reltoroot(roots: Sequence[Path], args: List[str]) -> List[str]:
@@ -219,7 +219,7 @@ def make_reltoroot(roots: Sequence[Path], args: List[str]) -> List[str]:
219219
parts[0] = root.name + "/" + str(x)
220220
break
221221
else:
222-
raise ValueError("arg {} not relative to an rsync root".format(arg))
222+
raise ValueError(f"arg {arg} not relative to an rsync root")
223223
result.append(splitcode.join(parts))
224224
return result
225225

@@ -249,7 +249,7 @@ def __init__(self, nodemanager, gateway, config, putevent):
249249
self.log = Producer(f"workerctl-{gateway.id}", enabled=config.option.debug)
250250

251251
def __repr__(self):
252-
return "<{} {}>".format(self.__class__.__name__, self.gateway.id)
252+
return f"<{self.__class__.__name__} {self.gateway.id}>"
253253

254254
@property
255255
def shutting_down(self):
@@ -310,11 +310,11 @@ def shutdown(self):
310310

311311
def sendcommand(self, name, **kwargs):
312312
"""send a named parametrized command to the other side."""
313-
self.log("sending command {}(**{})".format(name, kwargs))
313+
self.log(f"sending command {name}(**{kwargs})")
314314
self.channel.send((name, kwargs))
315315

316316
def notify_inproc(self, eventname, **kwargs):
317-
self.log("queuing {}(**{})".format(eventname, kwargs))
317+
self.log(f"queuing {eventname}(**{kwargs})")
318318
self.putevent((eventname, kwargs))
319319

320320
def process_from_remote(self, eventcall): # noqa too complex
@@ -336,7 +336,7 @@ def process_from_remote(self, eventcall): # noqa too complex
336336
return
337337
eventname, kwargs = eventcall
338338
if eventname in ("collectionstart",):
339-
self.log("ignoring {}({})".format(eventname, kwargs))
339+
self.log(f"ignoring {eventname}({kwargs})")
340340
elif eventname == "workerready":
341341
self.notify_inproc(eventname, node=self, **kwargs)
342342
elif eventname == "internal_error":
@@ -389,7 +389,7 @@ def process_from_remote(self, eventcall): # noqa too complex
389389
location=kwargs["location"],
390390
)
391391
else:
392-
raise ValueError("unknown event: {}".format(eventname))
392+
raise ValueError(f"unknown event: {eventname}")
393393
except KeyboardInterrupt:
394394
# should not land in receiver-thread
395395
raise

Diff for: testing/test_remote.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, eventcall):
2525
self.name, self.kwargs = eventcall
2626

2727
def __str__(self):
28-
return "<EventCall {}(**{})>".format(self.name, self.kwargs)
28+
return f"<EventCall {self.name}(**{self.kwargs})>"
2929

3030

3131
class WorkerSetup:
@@ -60,7 +60,7 @@ def popevent(self, name=None):
6060
ev = EventCall(data)
6161
if name is None or ev.name == name:
6262
return ev
63-
print("skipping {}".format(ev))
63+
print(f"skipping {ev}")
6464

6565
def sendcommand(self, name, **kwargs):
6666
self.slp.sendcommand(name, **kwargs)

0 commit comments

Comments
 (0)