From de3e54fd278d49b9b5d64e64f5942512519545e5 Mon Sep 17 00:00:00 2001 From: Zac-HD Date: Fri, 12 Jun 2020 18:00:28 +1000 Subject: [PATCH] Finish removal of "slave" terminology See issue #234. It's time. --- .appveyor.yml | 1 - .travis.yml | 2 -- changelog/541.removal.rst | 1 + setup.py | 16 ++++------------ src/xdist/dsession.py | 3 --- src/xdist/plugin.py | 5 +---- src/xdist/remote.py | 3 --- src/xdist/workermanage.py | 6 +----- testing/acceptance_test.py | 16 ---------------- tox.ini | 2 +- 10 files changed, 8 insertions(+), 47 deletions(-) create mode 100644 changelog/541.removal.rst diff --git a/.appveyor.yml b/.appveyor.yml index 36c98c1..0c9cef7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - TOXENV: "py27-pytestlatest" - TOXENV: "py35-pytestlatest" - TOXENV: "py36-pytestlatest" - TOXENV: "py37-pytestlatest" diff --git a/.travis.yml b/.travis.yml index 8932051..79afe10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,8 +32,6 @@ jobs: - $HOME/.cache/pre-commit - python: '3.8' env: TOXENV=py38-pytestlatest - - python: '2.7' - env: TOXENV=py27-pytestlatest - stage: test python: "3.5" diff --git a/changelog/541.removal.rst b/changelog/541.removal.rst new file mode 100644 index 0000000..0823a67 --- /dev/null +++ b/changelog/541.removal.rst @@ -0,0 +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. diff --git a/setup.py b/setup.py index ad4675c..fcba298 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,6 @@ from setuptools import setup, find_packages -install_requires = [ - "execnet>=1.1", - "psutil>=3.0.0", - "pytest>=4.4.0", - "pytest-forked", - "six", -] +install_requires = ["execnet>=1.1", "psutil>=3.0.0", "pytest>=6.0.0", "pytest-forked"] with open("README.rst") as f: @@ -15,8 +9,7 @@ with open("README.rst") as f: setup( name="pytest-xdist", use_scm_version={"write_to": "src/xdist/_version.py"}, - description="pytest xdist plugin for distributed testing" - " and loop-on-failing modes", + description="pytest xdist plugin for distributed testing and loop-on-failing modes", long_description=long_description, license="MIT", author="holger krekel and contributors", @@ -30,7 +23,7 @@ setup( "pytest11": ["xdist = xdist.plugin", "xdist.looponfail = xdist.looponfail"] }, zip_safe=False, - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", + python_requires=">=3.5", install_requires=install_requires, setup_requires=["setuptools_scm"], classifiers=[ @@ -45,9 +38,8 @@ setup( "Topic :: Software Development :: Quality Assurance", "Topic :: Utilities", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", diff --git a/src/xdist/dsession.py b/src/xdist/dsession.py index 2f06cb1..7a84c8b 100644 --- a/src/xdist/dsession.py +++ b/src/xdist/dsession.py @@ -150,9 +150,6 @@ class DSession(object): node.workerinfo["id"] = node.gateway.id node.workerinfo["spec"] = node.gateway.spec - # TODO: (#234 task) needs this for pytest. Remove when refactor in pytest repo - node.slaveinfo = node.workerinfo - self.config.hook.pytest_testnodeready(node=node) if self.shuttingdown: node.shutdown() diff --git a/src/xdist/plugin.py b/src/xdist/plugin.py index 162f4c9..29062d9 100644 --- a/src/xdist/plugin.py +++ b/src/xdist/plugin.py @@ -43,14 +43,11 @@ def pytest_addoption(parser): ) group.addoption( "--max-worker-restart", - "--max-slave-restart", action="store", default=None, dest="maxworkerrestart", help="maximum number of workers that can be restarted " - "when crashed (set to zero to disable this feature)\n" - "'--max-slave-restart' option is deprecated and will be removed in " - "a future release", + "when crashed (set to zero to disable this feature)", ) group.addoption( "--dist", diff --git a/src/xdist/remote.py b/src/xdist/remote.py index 86ba9cb..088ebeb 100644 --- a/src/xdist/remote.py +++ b/src/xdist/remote.py @@ -266,8 +266,5 @@ if __name__ == "__channelexec__": config._parser.prog = os.path.basename(workerinput["mainargv"][0]) config.workerinput = workerinput config.workeroutput = {} - # TODO: deprecated name, backward compatibility only. Remove it in future - config.slaveinput = config.workerinput - config.slaveoutput = config.workeroutput interactor = WorkerInteractor(config, channel) config.hook.pytest_cmdline_main(config=config) diff --git a/src/xdist/workermanage.py b/src/xdist/workermanage.py index e8b49bb..69b1fbd 100644 --- a/src/xdist/workermanage.py +++ b/src/xdist/workermanage.py @@ -228,13 +228,9 @@ class WorkerController(object): self.workerinput = { "workerid": gateway.id, "workercount": len(nodemanager.specs), - "slaveid": gateway.id, - "slavecount": len(nodemanager.specs), "testrunuid": nodemanager.testrunuid, "mainargv": sys.argv, } - # TODO: deprecated name, backward compatibility only. Remove it in future - self.slaveinput = self.workerinput self._down = False self._shutdown_sent = False self.log = py.log.Producer("workerctl-%s" % gateway.id) @@ -333,7 +329,7 @@ class WorkerController(object): self.notify_inproc(eventname, node=self, **kwargs) elif eventname == "workerfinished": self._down = True - self.workeroutput = self.slaveoutput = kwargs["workeroutput"] + self.workeroutput = kwargs["workeroutput"] self.notify_inproc("workerfinished", node=self) elif eventname in ("logstart", "logfinish"): self.notify_inproc(eventname, node=self, **kwargs) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 7f9a551..168bb97 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -245,22 +245,6 @@ class TestDistribution: result.stderr.fnmatch_lines(["--foobar=123 active! *"]) assert dest.join(subdir.basename).check(dir=1) - def test_backward_compatibility_worker_terminology(self, testdir): - """Ensure that we still support "config.slaveinput" for backward compatibility (#234). - - Keep in mind that removing this compatibility will break a ton of plugins and user code. - """ - testdir.makepyfile( - """ - def test(pytestconfig): - assert hasattr(pytestconfig, 'slaveinput') - assert hasattr(pytestconfig, 'workerinput') - """ - ) - result = testdir.runpytest("-n1") - result.stdout.fnmatch_lines("*1 passed*") - assert result.ret == 0 - def test_data_exchange(self, testdir): testdir.makeconftest( """ diff --git a/tox.ini b/tox.ini index a68913a..584d3ed 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist= linting - py{27,35,36,37,38}-pytestlatest + py{35,36,37,38}-pytestlatest py38-pytestmaster [testenv]