Bump min execnet to 2.1.0

This version adds typing which we want to utilize.
This commit is contained in:
Ran Benita 2024-04-05 21:46:41 +03:00
parent dd067e4f86
commit e9084f2d73
5 changed files with 9 additions and 6 deletions

View File

@ -30,4 +30,5 @@ repos:
args: []
additional_dependencies:
- pytest>=7.0.0
- execnet>=2.1.0
- py>=1.10.0

View File

@ -1 +1,3 @@
pytest>=7.0.0 is now required.
execnet>=2.1.0 is now required.

View File

@ -33,7 +33,7 @@ classifiers = [
]
requires-python = ">=3.8"
dependencies = [
"execnet>=1.1",
"execnet>=2.1",
"pytest>=7.0.0",
]
dynamic = ["version"]

View File

@ -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)

View File

@ -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