diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7b6c5e3..af89906 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,4 +30,5 @@ repos: args: [] additional_dependencies: - pytest>=7.0.0 + - execnet>=2.1.0 - py>=1.10.0 diff --git a/changelog/1057.removal b/changelog/1057.removal index fbd9c5d..71aad7f 100644 --- a/changelog/1057.removal +++ b/changelog/1057.removal @@ -1 +1,3 @@ pytest>=7.0.0 is now required. + +execnet>=2.1.0 is now required. diff --git a/pyproject.toml b/pyproject.toml index 144df63..7ae28b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "execnet>=1.1", + "execnet>=2.1", "pytest>=7.0.0", ] dynamic = ["version"] diff --git a/src/xdist/workermanage.py b/src/xdist/workermanage.py index d183dc9..d2f790f 100644 --- a/src/xdist/workermanage.py +++ b/src/xdist/workermanage.py @@ -139,7 +139,7 @@ class NodeManager: # XXX This changes the calling behaviour of # pytest_xdist_rsyncstart and pytest_xdist_rsyncfinish to # be called once per rsync target. - rsync = HostRSync(source, verbose=verbose, ignores=ignores) + rsync = HostRSync(source, verbose=verbose > 0, ignores=ignores) spec = gateway.spec if spec.popen and not spec.chdir: # XXX This assumes that sources are python-packages @@ -175,12 +175,12 @@ class HostRSync(execnet.RSync): sourcedir: PathLike, *, ignores: Optional[Sequence[PathLike]] = None, - **kwargs: object, + verbose: bool = True, ) -> None: if ignores is None: ignores = [] self._ignores = [re.compile(fnmatch.translate(os.fspath(x))) for x in ignores] - super().__init__(sourcedir=Path(sourcedir), **kwargs) + super().__init__(sourcedir=Path(sourcedir), verbose=verbose) def filter(self, path: PathLike) -> bool: path = Path(path) diff --git a/testing/test_workermanage.py b/testing/test_workermanage.py index e7fa3f5..1246911 100644 --- a/testing/test_workermanage.py +++ b/testing/test_workermanage.py @@ -102,14 +102,14 @@ class TestNodeManagerPopen: def waitclose(self): pass - gw.remote_exec = pseudoexec + gw.remote_exec = pseudoexec # type: ignore[assignment] notifications = [] for gw in hm.group: hm.rsync(gw, source, notify=lambda *args: notifications.append(args)) assert not notifications hm.teardown_nodes() assert not len(hm.group) - assert "sys.path.insert" in gw.remote_exec.args[0] + assert "sys.path.insert" in gw.remote_exec.args[0] # type: ignore[attr-defined] def test_rsync_popen_with_path( self, config, source: Path, dest: Path, workercontroller