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

[BUG] 60.5.4: pytest is failing in few units #3032

Closed
1 task done
kloczek opened this issue Jan 17, 2022 · 11 comments
Closed
1 task done

[BUG] 60.5.4: pytest is failing in few units #3032

kloczek opened this issue Jan 17, 2022 · 11 comments

Comments

@kloczek
Copy link

kloczek commented Jan 17, 2022

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:

Package                       Version
----------------------------- -------------------
alabaster                     0.7.12
attrs                         21.4.0
Babel                         2.9.1
build                         0.7.0
chardet                       4.0.0
charset-normalizer            2.0.10
coverage                      6.2
cycler                        0.11.0
dbus-python                   1.2.18
distlib                       0.3.4
distro                        1.6.0
docutils                      0.17.1
execnet                       1.9.0
extras                        1.0.0
filelock                      3.4.2
fixtures                      3.0.0
flake8                        4.0.1
fonttools                     4.28.5
gpg                           1.16.0-unknown
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.10.1
iniconfig                     1.1.1
jaraco.envs                   2.2.0
jaraco.packaging              8.2.1
jaraco.path                   3.3.1
Jinja2                        3.0.3
jupyter-packaging-test-foo    0.1
kiwisolver                    1.3.2
libcomps                      0.1.18
lit                           13.0.0
lxml                          4.7.1
MarkupSafe                    2.0.1
matplotlib                    3.5.1
mccabe                        0.6.1
meson                         0.60.3
mock                          4.0.3
mypy                          0.931
mypy-extensions               0.4.3
numpy                         1.22.0
olefile                       0.46
packaging                     21.3
path                          16.3.0
pbr                           5.8.0
pep517                        0.12.0
Pillow                        9.0.0
pip                           21.3.1
platformdirs                  2.4.1
pluggy                        1.0.0
py                            1.11.0
pycairo                       1.20.1
pycodestyle                   2.8.0
pyflakes                      2.4.0
Pygments                      2.11.2
PyGObject                     3.42.0
pyparsing                     3.0.6
pytest                        6.2.5
pytest-checkdocs              2.7.1
pytest-cov                    3.0.0
pytest-fixture-config         1.7.0
pytest-flake8                 1.0.7
pytest-forked                 1.4.0
pytest-shutil                 1.7.0
pytest-virtualenv             1.7.0
pytest-xdist                  2.5.0
python-dateutil               2.8.2
pytz                          2021.3
requests                      2.27.1
rpm                           4.17.0
rst                           0.1
rst.linker                    2.2.0
setuptools                    60.1.0.post20211225
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        4.3.2.dev20220106
sphinx-favicon                0.2
sphinx_inline_tabs            2021.8.17b10
sphinxcontrib-applehelp       1.0.2.dev20220108
sphinxcontrib-devhelp         1.0.2.dev20220108
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220108
sphinxcontrib-qthelp          1.0.3.dev20220108
sphinxcontrib-serializinghtml 1.1.5
termcolor                     1.1.0
testtools                     2.5.0
toml                          0.10.2
tomli                         2.0.0
tox                           3.24.4
typing_extensions             4.0.1
urllib3                       1.26.8
virtualenv                    20.13.0
wheel                         0.37.1
zipp                          3.7.0

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
  • because I'm calling build with --no-isolation I'm using during all processes oly locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Because I'v been adwised in #2638 (comment) I'm running pytest with -W ignore::DeprecationWarning

Output

Summary pytest output without ignore :

========================================================================= short test summary info ==========================================================================
SKIPPED [2] setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler': No module named 'winreg'
SKIPPED [1] setuptools/tests/test_develop.py:66: TODO: needs a fixture to cause 'develop' to be invoked without mutating environment.
SKIPPED [1] setuptools/tests/test_install_scripts.py:50: Windows only
SKIPPED [1] setuptools/tests/test_install_scripts.py:78: Windows only
SKIPPED [5] setuptools/tests/test_integration.py:31: Integration tests cannot run when pbr is installed
SKIPPED [1] setuptools/tests/test_msvc14.py:16: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:34: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:52: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:68: These tests are only for win32
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:80: Windows only
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:121: Windows only
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:180: Windows only
SKIPPED [8] conftest.py:49: skipping integration tests
XFAIL setuptools/tests/test_bdist_egg.py::Test::test_exclude_source_files
  Byte code disabled
XFAIL setuptools/tests/test_dist.py::test_read_metadata[Metadata Version 1.2: Project-Url-attrs5]
  Issue #1578: project_urls not read
XFAIL setuptools/tests/test_dist.py::test_read_metadata[Metadata Version 2.1: Provides Extra-attrs9]
  provides_extras not read
XFAIL setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[extras_require_with_marker_in_setup_cfg]
XFAIL setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<20]
  pypa/pip#6599
XFAIL setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[https://github.com/pypa/pip/archive/main.zip]
  #2975
XPASS setuptools/tests/test_archive_util.py::test_unicode_files #710 and #712
FAILED setuptools/tests/test_develop.py::TestNamespaces::test_editable_prefix - subprocess.CalledProcessError: Command '[PosixPath('/tmp/pytest-of-tkloczko/pytest-17/tes...
FAILED setuptools/tests/test_dist.py::test_dist_fetch_build_egg - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major ...
FAILED setuptools/tests/test_distutils_adoption.py::test_distutils_local_with_setuptools - subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-tkloczko/pytest-...
FAILED setuptools/tests/test_distutils_adoption.py::test_distutils_local - AssertionError: assert '.env' in ['', 'usr', 'lib64', 'python3.8', 'distutils', '__init__.py\n']
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_no_find_links - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be remo...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_unicode_filename_in_sdist - DeprecationWarning: Creating a LegacyVersion has been deprecated and ...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_unicode_content_in_sdist - DeprecationWarning: Creating a LegacyVersion has been deprecated and w...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_script_install - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be rem...
FAILED setuptools/tests/test_easy_install.py::TestUserInstallTest::test_user_install_not_implied_user_site_enabled - DeprecationWarning: Creating a LegacyVersion has bee...
FAILED setuptools/tests/test_easy_install.py::TestUserInstallTest::test_user_install_not_implied_user_site_disabled - DeprecationWarning: Creating a LegacyVersion has be...
FAILED setuptools/tests/test_easy_install.py::TestUserInstallTest::test_local_index - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be remove...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg0] - DeprecationWarning: Creating a LegacyVe...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg1] - DeprecationWarning: Creating a LegacyVe...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg2] - DeprecationWarning: Creating a LegacyVe...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg3] - DeprecationWarning: Creating a LegacyVe...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg0] - DeprecationWarning: Creating a LegacyVersion has be...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg1] - DeprecationWarning: Creating a LegacyVersion has be...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg2] - DeprecationWarning: Creating a LegacyVersion has be...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg3] - DeprecationWarning: Creating a LegacyVersion has be...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg0] - DeprecationWarning: Creating a LegacyVersion has...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg1] - DeprecationWarning: Creating a LegacyVersion has...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg2] - DeprecationWarning: Creating a LegacyVersion has...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg3] - DeprecationWarning: Creating a LegacyVersion has...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_honors_pip_env - DeprecationWarning: Creating a LegacyVersion has been deprecated an...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_pep508_url - DeprecationWarning: Creating a LegacyVersion has been deprecated a...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_allow_hosts - DeprecationWarning: Creating a LegacyVersion has been deprecated ...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_python_requires - DeprecationWarning: Creating a LegacyVersion has been depreca...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_find_links_in_setup_cfg[False] - DeprecationWarning: Creating a LegacyVersion h...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_find_links_in_setup_cfg[True] - DeprecationWarning: Creating a LegacyVersion ha...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_transitive_extra_dependency - DeprecationWarning: Creating a LegacyVersion has ...
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[None] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<20.1] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<21] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<22] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_test_command_install_requirements - subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-tkloczko/pytest-17/tes...
=============================================== 35 failed, 532 passed, 25 skipped, 6 xfailed, 1 xpassed in 219.07s (0:03:39) ===============================================

second with ignore DeprecationWarning.

========================================================================= short test summary info ==========================================================================
SKIPPED [2] setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler': No module named 'winreg'
SKIPPED [1] setuptools/tests/test_develop.py:66: TODO: needs a fixture to cause 'develop' to be invoked without mutating environment.
SKIPPED [1] setuptools/tests/test_install_scripts.py:50: Windows only
SKIPPED [1] setuptools/tests/test_install_scripts.py:78: Windows only
SKIPPED [5] setuptools/tests/test_integration.py:31: Integration tests cannot run when pbr is installed
SKIPPED [1] setuptools/tests/test_msvc14.py:16: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:34: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:52: These tests are only for win32
SKIPPED [1] setuptools/tests/test_msvc14.py:68: These tests are only for win32
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:80: Windows only
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:121: Windows only
SKIPPED [1] setuptools/tests/test_windows_wrappers.py:180: Windows only
SKIPPED [8] conftest.py:49: skipping integration tests
XFAIL setuptools/tests/test_bdist_egg.py::Test::test_exclude_source_files
  Byte code disabled
XFAIL setuptools/tests/test_dist.py::test_read_metadata[Metadata Version 1.2: Project-Url-attrs5]
  Issue #1578: project_urls not read
XFAIL setuptools/tests/test_dist.py::test_read_metadata[Metadata Version 2.1: Provides Extra-attrs9]
  provides_extras not read
XFAIL setuptools/tests/test_egg_info.py::TestEggInfo::test_requires[extras_require_with_marker_in_setup_cfg]
XFAIL setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<20]
  pypa/pip#6599
XFAIL setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[https://github.com/pypa/pip/archive/main.zip]
  #2975
XPASS setuptools/tests/test_archive_util.py::test_unicode_files #710 and #712
FAILED setuptools/tests/test_develop.py::TestNamespaces::test_editable_prefix - subprocess.CalledProcessError: Command '[PosixPath('/tmp/pytest-of-tkloczko/pytest-18/tes...
FAILED setuptools/tests/test_distutils_adoption.py::test_distutils_local_with_setuptools - subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-tkloczko/pytest-...
FAILED setuptools/tests/test_distutils_adoption.py::test_distutils_local - AssertionError: assert '.env' in ['', 'usr', 'lib64', 'python3.8', 'distutils', '__init__.py\n']
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[None] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<20.1] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<21] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<22] - Failed: DID NOT RAISE <class 'subprocess.CalledProcessError'>
FAILED setuptools/tests/test_virtualenv.py::test_test_command_install_requirements - subprocess.CalledProcessError: Command '[Path('/tmp/pytest-of-tkloczko/pytest-18/tes...
=============================================== 8 failed, 559 passed, 25 skipped, 6 xfailed, 1 xpassed in 202.49s (0:03:22) ================================================

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

  • I agree to follow the PSF Code of Conduct
@kloczek kloczek added bug Needs Triage Issues that need to be evaluated for severity and status. labels Jan 17, 2022
@jaraco
Copy link
Member

jaraco commented Jan 17, 2022

I see in at least one of the failures this traceback:

Error processing line 1 of /usr/lib/python3.8/site-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File "/usr/lib64/python3.8/site.py", line 169, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  AttributeError: module '_distutils_hack' has no attribute 'ensure_shim'

Setuptools 60.1 changed the hack to use ensure_shim but that approach turned out to be problemmatic, so in 60.2, that was changed back to add_shim. Therefore, if you have an environment that has Setuptools 60.1 installed, but then a version of Setuptools other than 60.1.x is present on sys.path, the .pth file will fail to find the hook. Presumably, that issue is ignorable because the hook will be loaded otherwise.

@jaraco
Copy link
Member

jaraco commented Jan 17, 2022

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.

@jaraco jaraco added Needs Investigation Issues which are likely in scope but need investigation to figure out the cause and removed bug Needs Triage Issues that need to be evaluated for severity and status. labels Jan 17, 2022
@abravalheri
Copy link
Contributor

@jaraco would this be related to #3015 somehow?

However, the failures here are different from the ones I found in my investigation, which it seems to be caused by the update and ensure_shim.

@kloczek
Copy link
Author

kloczek commented Jan 17, 2022

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.
I've assumend that setuptools pep517 build procedure requires installed seruptools 😄

Just made the test build without installed setuptools and build is OK however pytest fails like below:

+ 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 --pyargs setuptools.tests does not help.
May I ask what is (still) missing in case of my procedure? 🤔

@abravalheri
Copy link
Contributor

abravalheri commented Jan 17, 2022

ImportError: Error importing plugin "setuptools.tests.fixtures": No module named 'setuptools.tests'

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.

@kloczek
Copy link
Author

kloczek commented Jan 17, 2022

Just found that because I'm building setuptools as rpm package and because I'm building as well documentation sphinx has run time/install time setuptools dependency.
So even if I've removed BuildRequires: python3dist(setuptools) actually that module has been installed ..
I've checked and looks like none of the sphinx code has "import setuptools" or similar.
So I've added patch to sphinx code

--- 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 jarco-packaging so I cannot generate documentation without that.

+ /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 sphinx only (+ maybe sphinx-rtd-theme).

[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 setuptools in Requires.

@kloczek
Copy link
Author

kloczek commented Jan 17, 2022

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

So in this casa I should alter my testing procedure to not use $PYTHONPATH and pointing to </install/prefis> sitelib directory.
Is that correct? 🤔

@abravalheri
Copy link
Contributor

abravalheri commented Jan 17, 2022

So in this casa I should alter my testing procedure to not use $PYTHONPATH and pointing to </install/prefis> sitelib directory.
Is that correct? 🤔

Sorry I don't think that be enough. The folder setuptools/tests has to be collocated with the rest of the setuptools package that you are testing against, moreover the conftest.py file also needs to be properly placed.

I am afraid that this kind of test is not currently supported.

@abravalheri
Copy link
Contributor

/usr/bin/python3 setup.py build_sphinx

Please notice that build_sphinx has been deprecated by the sphinx team and should be removed soon.
You might have to replace calls to build_sphinx with their custom CLI client sphinx-build.

@abravalheri
Copy link
Contributor

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.

@abravalheri abravalheri added duplicate and removed Needs Investigation Issues which are likely in scope but need investigation to figure out the cause labels Jan 19, 2022
@kloczek
Copy link
Author

kloczek commented Jan 19, 2022

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.

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.
So yea .. I agree with that 😄

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

No branches or pull requests

3 participants