-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] 60.5.4: pytest is failing in few units #3032
Comments
I see in at least one of the failures this traceback:
Setuptools 60.1 changed the hack to use |
All of these issues seem to stem from the fact that setuptools is additionally installed in another location. Probably your best bet is to run setuptools' tests without having an older version of setuptools installed in the environment. |
Ha .. and that is very importand detail. Just made the test build without installed + cd setuptools-60.5.4
+ PYTHONDONTWRITEBYTECODE=1
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.5.4-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ pytest -ra -p no:randomly setuptools -W ignore::DeprecationWarning
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 703, in import_plugin
__import__(importspec)
ModuleNotFoundError: No module named 'setuptools.tests'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/pytest", line 8, in <module>
sys.exit(console_main())
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 143, in main
config = _prepareconfig(args, plugins)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
config = pluginmanager.hook.pytest_cmdline_parse(
File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
gen.send(outcome)
File "/usr/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
config: Config = outcome.get_result()
File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
self.parse(args)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1283, in parse
self._preparse(args, addopts=addopts)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1191, in _preparse
self.hook.pytest_load_initial_conftests(
File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1070, in pytest_load_initial_conftests
self.pluginmanager._set_initial_conftests(early_config.known_args_namespace)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 500, in _set_initial_conftests
self._try_load_conftest(anchor, namespace.importmode)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 508, in _try_load_conftest
self._getconftestmodules(anchor, importmode)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 536, in _getconftestmodules
mod = self._importconftest(conftestpath, importmode)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 587, in _importconftest
self.consider_conftest(mod)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 663, in consider_conftest
self.register(conftestmodule, name=conftestmodule.__file__)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 443, in register
self.consider_module(plugin)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 669, in consider_module
self._import_plugin_specs(getattr(mod, "pytest_plugins", []))
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 676, in _import_plugin_specs
self.import_plugin(import_spec)
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 705, in import_plugin
raise ImportError(
File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 703, in import_plugin
__import__(importspec)
ImportError: Error importing plugin "setuptools.tests.fixtures": No module named 'setuptools.tests' I've tested and |
Thanks @kloczek. Now it is the same error I see in #3015! Please consider that the current layout of the setuptools repository does not allow you to run the tests with an installed version of setuptools, only the "develop" mode/editable install (you can check the comments in the PR mentioned above for more details on why that happens). Changing this requires a series of workarounds which increases complexity, and therefore it is a tradeoff that setuptools might decide to implement or not. |
Just found that because I'm building --- a/setup.py~ 2021-12-19 08:38:16.000000000 +0000
+++ b/setup.py 2021-12-31 07:58:23.219074983 +0000
@@ -29,7 +28,6 @@
'alabaster>=0.7,<0.8',
'imagesize',
'requests>=2.5.0',
- 'setuptools',
'packaging',
] Issue is that looks like setuptools is on the install time/run time list of the + /usr/bin/python3 setup.py build_sphinx -b man --build-dir build/sphinx
running build_sphinx
Running Sphinx v4.3.2
Extension error:
Could not import extension jaraco.packaging.sphinx (exception: No module named 'jaraco-packaging') I would suggest to minimise sphinx requirements to [tkloczko@ss-desktop SPECS]$ pip show jaraco-packaging
Name: jaraco.packaging
Version: 8.2.1
Summary: tools to supplement packaging Python releases
Home-page: https://github.com/jaraco/jaraco.packaging
Author: Jason R. Coombs
Author-email: [email protected]
License: UNKNOWN
Location: /usr/lib/python3.8/site-packages
Requires: setuptools
Required-by: Will try to check 'jaraco-packaging' really needs to have |
So in this casa I should alter my testing procedure to not use $PYTHONPATH and pointing to </install/prefis> sitelib directory. |
Sorry I don't think that be enough. The folder I am afraid that this kind of test is not currently supported. |
Please notice that |
Hi @kloczek, I believe that at this point we can say with confidence that the problems you are facing are the same ones described in #2318, and that the test mode you described is not currently supported by setuptools. Since #2318 already exists and works as a request for implementing this feature, I will go ahead and close this issue as a duplicate. You can subscribe to #2318 to receive updates if the feature you are after is implemented in setuptools. |
As Im using very simmilar %pytest rpm macro with what is used in Fedora looks l;ike that methodology which I've descriobed on top of this ticket goat of the #2318 goes in exactly the same direction. |
setuptools version
60.5.4
Python version
3.8.12
OS
Linux/x86_64
Additional environment information
Full list of modules installed in build env:
Description
Duting iupgrade from 60.1.0 to the latest 60.5.4 found that pytest is failing.
Expected behavior
pytest should not fail.
How to Reproduce
I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes oly locally installed modulesBecause I'v been adwised in #2638 (comment) I'm running pytest with
-W ignore::DeprecationWarning
Output
Summary pytest output without ignore :
second with ignore DeprecationWarning.
Full pytest output for both cses are attachments
setuptools-60.5.4-pytest.txt
setuptools-60.5.4-pytest-with-ignore-DeprecationWarning.txt
Code of Conduct
The text was updated successfully, but these errors were encountered: