Skip to content

Commit 84920de

Browse files
committed
Finish removal of "slave" terminology
See issue #234. It's time.
1 parent d19b4d1 commit 84920de

File tree

8 files changed

+7
-36
lines changed

8 files changed

+7
-36
lines changed

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.0rc1", "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
@@ -220,13 +220,9 @@ def __init__(self, nodemanager, gateway, config, putevent):
220220
self.workerinput = {
221221
"workerid": gateway.id,
222222
"workercount": len(nodemanager.specs),
223-
"slaveid": gateway.id,
224-
"slavecount": len(nodemanager.specs),
225223
"testrunuid": nodemanager.testrunuid,
226224
"mainargv": sys.argv,
227225
}
228-
# TODO: deprecated name, backward compatibility only. Remove it in future
229-
self.slaveinput = self.workerinput
230226
self._down = False
231227
self._shutdown_sent = False
232228
self.log = py.log.Producer("workerctl-%s" % gateway.id)
@@ -325,7 +321,7 @@ def process_from_remote(self, eventcall): # noqa too complex
325321
self.notify_inproc(eventname, node=self, **kwargs)
326322
elif eventname == "workerfinished":
327323
self._down = True
328-
self.workeroutput = self.slaveoutput = kwargs["workeroutput"]
324+
self.workeroutput = kwargs["workeroutput"]
329325
self.notify_inproc("workerfinished", node=self)
330326
elif eventname in ("logstart", "logfinish"):
331327
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
@@ -246,22 +246,6 @@ def pytest_load_initial_conftests(early_config):
246246
result.stderr.fnmatch_lines(["--foobar=123 active! *"])
247247
assert dest.join(subdir.basename).check(dir=1)
248248

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

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)