Skip to content

Commit f98dce6

Browse files
committed
Finish removal of "slave" terminology
See issue #234. It's time.
1 parent 30fd44d commit f98dce6

File tree

10 files changed

+7
-39
lines changed

10 files changed

+7
-39
lines changed

.appveyor.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
environment:
22
matrix:
3-
- TOXENV: "py27-pytestlatest"
43
- TOXENV: "py35-pytestlatest"
54
- TOXENV: "py36-pytestlatest"
65
- TOXENV: "py37-pytestlatest"

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ jobs:
3232
- $HOME/.cache/pre-commit
3333
- python: '3.8'
3434
env: TOXENV=py38-pytestlatest
35-
- python: '2.7'
36-
env: TOXENV=py27-pytestlatest
3735

3836
- stage: test
3937
python: "3.5"

changelog/541.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
drop backward-compatibility "slave" aliases related to worker nodes. We deliberately moved away from this terminology years ago, and it seems like the right time to finish the deprecation and removal process.

setup.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup, find_packages
22

3-
install_requires = ["execnet>=1.1", "pytest>=4.4.0", "pytest-forked", "six"]
3+
install_requires = ["execnet>=1.1", "pytest>=6.0.0", "pytest-forked", "six"]
44

55

66
with open("README.rst") as f:
@@ -24,7 +24,7 @@
2424
"pytest11": ["xdist = xdist.plugin", "xdist.looponfail = xdist.looponfail"]
2525
},
2626
zip_safe=False,
27-
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
27+
python_requires=">=3.5",
2828
install_requires=install_requires,
2929
setup_requires=["setuptools_scm"],
3030
classifiers=[
@@ -39,9 +39,8 @@
3939
"Topic :: Software Development :: Quality Assurance",
4040
"Topic :: Utilities",
4141
"Programming Language :: Python",
42-
"Programming Language :: Python :: 2",
43-
"Programming Language :: Python :: 2.7",
4442
"Programming Language :: Python :: 3",
43+
"Programming Language :: Python :: 3 :: Only",
4544
"Programming Language :: Python :: 3.5",
4645
"Programming Language :: Python :: 3.6",
4746
"Programming Language :: Python :: 3.7",

src/xdist/dsession.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,6 @@ def worker_workerready(self, node, workerinfo):
150150
node.workerinfo["id"] = node.gateway.id
151151
node.workerinfo["spec"] = node.gateway.spec
152152

153-
# TODO: (#234 task) needs this for pytest. Remove when refactor in pytest repo
154-
node.slaveinfo = node.workerinfo
155-
156153
self.config.hook.pytest_testnodeready(node=node)
157154
if self.shuttingdown:
158155
node.shutdown()

src/xdist/plugin.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,11 @@ def pytest_addoption(parser):
6262
)
6363
group.addoption(
6464
"--max-worker-restart",
65-
"--max-slave-restart",
6665
action="store",
6766
default=None,
6867
dest="maxworkerrestart",
6968
help="maximum number of workers that can be restarted "
70-
"when crashed (set to zero to disable this feature)\n"
71-
"'--max-slave-restart' option is deprecated and will be removed in "
72-
"a future release",
69+
"when crashed (set to zero to disable this feature)",
7370
)
7471
group.addoption(
7572
"--dist",

src/xdist/remote.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,5 @@ def setup_config(config, basetemp):
266266
config._parser.prog = os.path.basename(workerinput["mainargv"][0])
267267
config.workerinput = workerinput
268268
config.workeroutput = {}
269-
# TODO: deprecated name, backward compatibility only. Remove it in future
270-
config.slaveinput = config.workerinput
271-
config.slaveoutput = config.workeroutput
272269
interactor = WorkerInteractor(config, channel)
273270
config.hook.pytest_cmdline_main(config=config)

src/xdist/workermanage.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,13 +228,9 @@ def __init__(self, nodemanager, gateway, config, putevent):
228228
self.workerinput = {
229229
"workerid": gateway.id,
230230
"workercount": len(nodemanager.specs),
231-
"slaveid": gateway.id,
232-
"slavecount": len(nodemanager.specs),
233231
"testrunuid": nodemanager.testrunuid,
234232
"mainargv": sys.argv,
235233
}
236-
# TODO: deprecated name, backward compatibility only. Remove it in future
237-
self.slaveinput = self.workerinput
238234
self._down = False
239235
self._shutdown_sent = False
240236
self.log = py.log.Producer("workerctl-%s" % gateway.id)
@@ -333,7 +329,7 @@ def process_from_remote(self, eventcall): # noqa too complex
333329
self.notify_inproc(eventname, node=self, **kwargs)
334330
elif eventname == "workerfinished":
335331
self._down = True
336-
self.workeroutput = self.slaveoutput = kwargs["workeroutput"]
332+
self.workeroutput = kwargs["workeroutput"]
337333
self.notify_inproc("workerfinished", node=self)
338334
elif eventname in ("logstart", "logfinish"):
339335
self.notify_inproc(eventname, node=self, **kwargs)

testing/acceptance_test.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,22 +245,6 @@ def pytest_load_initial_conftests(early_config):
245245
result.stderr.fnmatch_lines(["--foobar=123 active! *"])
246246
assert dest.join(subdir.basename).check(dir=1)
247247

248-
def test_backward_compatibility_worker_terminology(self, testdir):
249-
"""Ensure that we still support "config.slaveinput" for backward compatibility (#234).
250-
251-
Keep in mind that removing this compatibility will break a ton of plugins and user code.
252-
"""
253-
testdir.makepyfile(
254-
"""
255-
def test(pytestconfig):
256-
assert hasattr(pytestconfig, 'slaveinput')
257-
assert hasattr(pytestconfig, 'workerinput')
258-
"""
259-
)
260-
result = testdir.runpytest("-n1")
261-
result.stdout.fnmatch_lines("*1 passed*")
262-
assert result.ret == 0
263-
264248
def test_data_exchange(self, testdir):
265249
testdir.makeconftest(
266250
"""

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist=
33
linting
4-
py{27,35,36,37,38}-pytestlatest
4+
py{35,36,37,38}-pytestlatest
55
py38-pytestmaster
66

77
[testenv]

0 commit comments

Comments
 (0)