Skip to content

Commit 31e80c8

Browse files
authored
Merge pull request #828 from nicoddemus/deprecate-rsync-825
Deprecate rsync support
2 parents c168706 + 1e9f6a7 commit 31e80c8

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Features
3434
* ``--looponfail``: run your tests repeatedly in a subprocess. After each run
3535
pytest waits until a file in your project changes and then re-runs
3636
the previously failing tests. This is repeated until all tests pass
37-
after which again a full run is performed.
37+
after which again a full run is performed (DEPRECATED).
3838

3939
* :ref:`Multi-Platform` coverage: you can specify different Python interpreters
4040
or different platforms and run tests in parallel on all of them.

docs/remote.rst

+11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
Sending tests to remote SSH accounts
66
====================================
77

8+
.. deprecated:: 3.0
9+
10+
.. warning::
11+
12+
This feature is deprecated because the support for ``rsync`` is faulty
13+
in terms of reproducing the development environment in the remote
14+
worker, and there is no clear solution moving forward.
15+
16+
This feature is scheduled to be removed in release 4.0, to let the team
17+
focus on a smaller set of features.
18+
819
Suppose you have a package ``mypkg`` which contains some
920
tests that you can successfully run locally. And you
1021
have a ssh-reachable machine ``myhost``. Then

src/xdist/looponfail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def pytest_cmdline_main(config):
4444
return 2 # looponfail only can get stop with ctrl-C anyway
4545

4646

47-
def looponfail_main(config: pytest.Config) -> None:
47+
def looponfail_main(config: "pytest.Config") -> None:
4848
remotecontrol = RemoteControl(config)
4949
config_roots = config.getini("looponfailroots")
5050
if not config_roots:

src/xdist/newhooks.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ def pytest_xdist_newgateway(gateway):
2424
"""called on new raw gateway creation."""
2525

2626

27-
@pytest.hookspec()
27+
@pytest.hookspec(
28+
warn_on_impl="rsync feature is deprecated and will be removed in pytest-xdist 4.0"
29+
)
2830
def pytest_xdist_rsyncstart(source, gateways):
2931
"""called before rsyncing a directory to remote gateways takes place."""
3032

3133

32-
@pytest.hookspec()
34+
@pytest.hookspec(
35+
warn_on_impl="rsync feature is deprecated and will be removed in pytest-xdist 4.0"
36+
)
3337
def pytest_xdist_rsyncfinish(source, gateways):
3438
"""called after rsyncing a directory to remote gateways takes place."""
3539

src/xdist/plugin.py

+7
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ def pytest_configure(config):
204204
)
205205
config.issue_config_time_warning(warning, 2)
206206

207+
if config.getoption("rsyncdir", None) or config.getini("rsyncdirs"):
208+
warning = DeprecationWarning(
209+
"The --rsyncdir command line argument and rsyncdirs config variable are deprecated.\n"
210+
"The rsync feature will be removed in pytest-xdist 4.0."
211+
)
212+
config.issue_config_time_warning(warning, 2)
213+
207214
config_line = (
208215
"xdist_group: specify group for tests should run in same session."
209216
"in relation to one another. " + "Provided by pytest-xdist."

0 commit comments

Comments
 (0)