Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning about rsyncdir is raised even when rsyncdir is not used #840

Closed
ogrisel opened this issue Nov 1, 2022 · 8 comments
Closed

Comments

@ogrisel
Copy link

ogrisel commented Nov 1, 2022

As observed on our CI:

+ eval 'python -m pytest --showlocals --durations=20 --junitxml=test-data.xml --cov-config='\''D:\a\1\s/.coveragerc'\'' --cov sklearn --cov-report= -Werror::DeprecationWarning -Werror::FutureWarning -Werror::numpy.VisibleDeprecationWarning -Wignore:tostring:DeprecationWarning -Wignore:The\ distutils:DeprecationWarning -Wignore:distutils\ Version\ classes\ are\ deprecated:DeprecationWarning -Werror::pytest.PytestUnraisableExceptionWarning -n2 --pyargs sklearn'
++ python -m pytest --showlocals --durations=20 --junitxml=test-data.xml '--cov-config=D:\a\1\s/.coveragerc' --cov sklearn --cov-report= -Werror::DeprecationWarning -Werror::FutureWarning -Werror::numpy.VisibleDeprecationWarning -Wignore:tostring:DeprecationWarning '-Wignore:The distutils:DeprecationWarning' '-Wignore:distutils Version classes are deprecated:DeprecationWarning' -Werror::pytest.PytestUnraisableExceptionWarning -n2 --pyargs sklearn
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\_pytest\main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\_pytest\config\__init__.py", line 1037, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\pluggy\_hooks.py", line 277, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\pluggy\_callers.py", line 60, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\pluggy\_result.py", line 60, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\xdist\plugin.py", line 214, in pytest_configure
INTERNALERROR>     config.issue_config_time_warning(warning, 2)
INTERNALERROR>   File "C:\Miniconda\envs\testvenv\lib\site-packages\_pytest\config\__init__.py", line 1394, in issue_config_time_warning
INTERNALERROR>     warnings.warn(warning, stacklevel=stacklevel)
INTERNALERROR> DeprecationWarning: The --rsyncdir command line argument and rsyncdirs config variable are deprecated.
INTERNALERROR> The rsync feature will be removed in pytest-xdist 4.0.

I did a git grep rsyncdir in our repo and there are no occurrence of this option.

@ogrisel
Copy link
Author

ogrisel commented Nov 1, 2022

This problem is already being discussed in #825 (comment).

@skirpichev
Copy link
Contributor

Probably, this could be closed. See pytest-dev/pytest-cov#557.

@sigma67
Copy link

sigma67 commented Oct 23, 2023

The warning is still happening, so I don't think it can be closed

@nicoddemus
Copy link
Member

@sigma67 according to pytest-dev/pytest-cov#558 this seems to be solved now and release in pytest-cov 4.1. Make sure to update accordingly.

Closing this for now, we can reopen if needed.

@skirpichev
Copy link
Contributor

@nicoddemus, please reopen: pytest-dev/pytest-cov#558 doesn't solve the issue (which was mentioned already in the pytest-cov issue thread).

For example, if I stop filter this DeprecationWarning in the diofant:

$ git diff
diff --git a/pyproject.toml b/pyproject.toml
index 5fb7b16417..55bc89e403 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -137,8 +137,7 @@ norecursedirs = ['build', '.eggs', '.git']
 timeout = 1000
 xfail_strict = true
 filterwarnings = ['ignore::UserWarning',
-                  'error::DeprecationWarning',
-                  'ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning']
+                  'error::DeprecationWarning']
 [tool.coverage.run]
 branch = true
 omit = ['conftest.py',
$ pip list|grep pytest-cov
pytest-cov                    4.1.0
$ pytest --cov diofant diofant/tests/interactive/
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1054, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/pluggy/_hooks.py", line 452, in call_historic
INTERNALERROR>     res = self._hookexec(self.name, self._hookimpls, kwargs, False)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/pluggy/_manager.py", line 112, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/pluggy/_callers.py", line 116, in _multicall
INTERNALERROR>     raise exception.with_traceback(exception.__traceback__)
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/pluggy/_callers.py", line 80, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>           ^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/xdist/plugin.py", line 252, in pytest_configure
INTERNALERROR>     config.issue_config_time_warning(warning, 2)
INTERNALERROR>   File "/home/sk/venv/dev3.11/lib/python3.11/site-packages/_pytest/config/__init__.py", line 1465, in issue_config_time_warning
INTERNALERROR>     warnings.warn(warning, stacklevel=stacklevel)
INTERNALERROR> DeprecationWarning: The --rsyncdir command line argument and rsyncdirs config variable are deprecated.
INTERNALERROR> The rsync feature will be removed in pytest-xdist 4.0.

@nicoddemus
Copy link
Member

Hmmm but what is actionable for pytest-xdist to do? Can you elaborate?

@nicoddemus
Copy link
Member

I mean, AFAIU it seems somebody is passing --rsyncdir to pytest-xdist, but pytest-xdist itself cannot do much about it other than issue the warning.

@skirpichev
Copy link
Contributor

Yeah, probably you are right. It's pytest-cov's issue (pytest-dev/pytest-cov#557) should be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants