-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[FR] Add support for running 62.3.4 directly with pytest and a installed version of setuptools. #3362
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
Comments
Here is pytest output: + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-62.3.4-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-62.3.4-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -p no:randomly
==================================================================== test session starts =====================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/setuptools-62.3.4, configfile: pytest.ini, testpaths: setuptools/tests
plugins: forked-1.4.0, shutil-1.7.0, cov-3.0.0, virtualenv-1.7.0, xdist-2.5.0, flake8-1.1.1, checkdocs-2.7.1
collected 875 items / 2 skipped
setuptools/tests/test_archive_util.py X [ 0%]
setuptools/tests/test_bdist_deprecations.py F [ 0%]
setuptools/tests/test_bdist_egg.py .x [ 0%]
setuptools/tests/test_build_clib.py . [ 0%]
setuptools/tests/test_build_ext.py .... [ 1%]
setuptools/tests/test_build_meta.py .................................................................................................................. [ 14%]
................................................................ [ 21%]
setuptools/tests/test_build_py.py ....x [ 21%]
setuptools/tests/test_config_discovery.py ................................................................................ [ 31%]
setuptools/tests/test_dep_util.py . [ 31%]
setuptools/tests/test_depends.py . [ 31%]
setuptools/tests/test_develop.py s....F [ 32%]
setuptools/tests/test_dist.py F......x...x............................................. [ 38%]
setuptools/tests/test_dist_info.py ................................... [ 42%]
setuptools/tests/test_distutils_adoption.py ............. [ 44%]
setuptools/tests/test_easy_install.py .F...FFF......FF.F...FFFFFFFFFFFFFFFFFFF..........F [ 49%]
setuptools/tests/test_editable_install.py .x [ 50%]
setuptools/tests/test_egg_info.py .........................x............................................... [ 58%]
setuptools/tests/test_extern.py ... [ 58%]
setuptools/tests/test_find_packages.py ................... [ 60%]
setuptools/tests/test_find_py_modules.py ......... [ 61%]
setuptools/tests/test_glob.py .... [ 62%]
setuptools/tests/test_install_scripts.py .s.s [ 62%]
setuptools/tests/test_integration.py sssss [ 63%]
setuptools/tests/test_logging.py .. [ 63%]
setuptools/tests/test_manifest.py ................................................................... [ 71%]
setuptools/tests/test_msvc14.py ssss [ 71%]
setuptools/tests/test_namespaces.py .... [ 72%]
setuptools/tests/test_packageindex.py .................... [ 74%]
setuptools/tests/test_register.py . [ 74%]
setuptools/tests/test_sandbox.py .......... [ 75%]
setuptools/tests/test_sdist.py ................. [ 77%]
setuptools/tests/test_setopt.py .. [ 77%]
setuptools/tests/test_setuptools.py ....................... [ 80%]
setuptools/tests/test_test.py . [ 80%]
setuptools/tests/test_unicode_utils.py . [ 80%]
setuptools/tests/test_upload.py . [ 80%]
setuptools/tests/test_virtualenv.py ..x...X.. [ 81%]
setuptools/tests/test_wheel.py ........................ [ 84%]
setuptools/tests/test_windows_wrappers.py sss [ 85%]
setuptools/tests/config/test_apply_pyprojecttoml.py ..................................... [ 89%]
setuptools/tests/config/test_expand.py .................. [ 91%]
setuptools/tests/config/test_pyprojecttoml.py ....................... [ 93%]
setuptools/tests/config/test_setupcfg.py ............................................. [ 99%]
setuptools/tests/integration/test_pip_install_sdist.py ssssssss [100%]
[..]
-------------------------------------------------------------------- Captured stdout call --------------------------------------------------------------------
running develop
Checking .pth file support in /tmp/pytest-of-tkloczko/pytest-40/test_editable_user_and_build_i0/.home/.local/lib/python3.8/site-packages
/usr/bin/python3 -E -c pass
TEST PASSED: /tmp/pytest-of-tkloczko/pytest-40/test_editable_user_and_build_i0/.home/.local/lib/python3.8/site-packages appears to support .pth files
-------------------------------------------------------------------- Captured stderr call --------------------------------------------------------------------
WARNING: The user site-packages directory is disabled.
================================================================== 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:51: skipping integration tests
XFAIL setuptools/tests/test_bdist_egg.py::Test::test_exclude_source_files
Byte code disabled
XFAIL setuptools/tests/test_build_py.py::test_excluded_subpackages
reason: #3260
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_editable_install.py::test_editable_with_pyproject[None]
Editable install is currently only supported with `setup.py`
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
XPASS setuptools/tests/test_archive_util.py::test_unicode_files #710 and #712
XPASS setuptools/tests/test_virtualenv.py::test_pip_upgrade_from_source[https://github.com/pypa/pip/archive/main.zip] #2975
FAILED setuptools/tests/test_bdist_deprecations.py::test_bdist_rpm_warning - TypeError: issubclass() arg 1 must be a class
FAILED setuptools/tests/test_develop.py::TestNamespaces::test_editable_prefix - subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '...
FAILED setuptools/tests/test_dist.py::test_dist_fetch_build_egg - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in t...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_no_find_links - DeprecationWarning: Creating a LegacyVersion has been deprecated an...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_unicode_filename_in_sdist - DeprecationWarning: Creating a LegacyVersion has been d...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_unicode_content_in_sdist - DeprecationWarning: Creating a LegacyVersion has been de...
FAILED setuptools/tests/test_easy_install.py::TestEasyInstallTest::test_script_install - DeprecationWarning: Creating a LegacyVersion has been deprecated a...
FAILED setuptools/tests/test_easy_install.py::TestUserInstallTest::test_user_install_not_implied_user_site_enabled - DeprecationWarning: Creating a LegacyV...
FAILED setuptools/tests/test_easy_install.py::TestUserInstallTest::test_user_install_not_implied_user_site_disabled - DeprecationWarning: Creating a Legacy...
FAILED setuptools/tests/test_easy_install.py::TestUserInstallTest::test_local_index - DeprecationWarning: Creating a LegacyVersion has been deprecated and ...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg0] - DeprecationWarning: Creat...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg1] - DeprecationWarning: Creat...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg2] - DeprecationWarning: Creat...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg3] - DeprecationWarning: Creat...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg0] - DeprecationWarning: Creating a Legacy...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg1] - DeprecationWarning: Creating a Legacy...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg2] - DeprecationWarning: Creating a Legacy...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg3] - DeprecationWarning: Creating a Legacy...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg0] - DeprecationWarning: Creating a Leg...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg1] - DeprecationWarning: Creating a Leg...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg2] - DeprecationWarning: Creating a Leg...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg3] - DeprecationWarning: Creating a Leg...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_honors_pip_env - DeprecationWarning: Creating a LegacyVersion has been...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_pep508_url - DeprecationWarning: Creating a LegacyVersion has bee...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_allow_hosts - DeprecationWarning: Creating a LegacyVersion has be...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_python_requires - DeprecationWarning: Creating a LegacyVersion ha...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_find_links_in_setup_cfg[False] - DeprecationWarning: Creating a L...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_find_links_in_setup_cfg[True] - DeprecationWarning: Creating a Le...
FAILED setuptools/tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_transitive_extra_dependency - DeprecationWarning: Creating a Lega...
FAILED setuptools/tests/test_easy_install.py::test_editable_user_and_build_isolation - DeprecationWarning: Creating a LegacyVersion has been deprecated and...
======================================= 30 failed, 813 passed, 25 skipped, 7 xfailed, 2 xpassed in 1216.08s (0:20:16) ======================================== And here is full pytest output |
Hi @kloczek, thank you very much for the information. I don't consider this issue to be a bug for the reason that no testing methodology is supported by Under this perspective, this issue seems to me like it is a duplication of already the existing issue #2318. Unfortunately the suggested patch is not applicable in the main repository due to the following reason:
Please note that although this project does not support other testing methodologies directly, it is open to any PRs that would make other testing methodologies easier, as long as:
The change proposed in the text of this issue, seems to violate condition 1. Please consider the following tips when creating an issue in setuptools:
|
BTW looks like to testpaths can be added |
Should I submit that patch as PR? 🤔 |
Please don't, this patch has problems described in #3362 (comment). |
Hmm I'm uning that patch in my rpm build procedure and despite some number of units failing at least it is possible to use pytest. Currently without that patch it is not possible (pytest fails on collectiing units) |
You know that by adding this patch you are skipping a bunch of tests, right? Please refer to the other comment I linked above. Setuptools test suite is designed to run the way it is encoded in our tox/ci files. If you try to run it differently, it will probably break, unfortunately. I listed in a previous comment some conditions that must be observed if you want to submit a PR. |
You kiow .. I completly do not undrerstand that situation. |
This is explained in #3362 (comment)
Setuptools already uses pytest. The circumstances of the call are what differ. We don't have any plans to officially support any test methodology other than the one encoded via the We would consider a positive change if we manage to test setuptools as if it was loaded from a test virtual environment, instead of the source tree directly (this is pointed out in the original issue But as you noticed, we have already started to make some progress, some parts of the test suite already work with a proper installation (but not all of it). |
Issue ids that thios methot is radically different with typical methodology used on packaging python modules. |
setuptools version
62.3.4
Python version
3.8.13
OS
Linux/x86_64
Additional environment information
list of module sinstalled in build env
Description
I'm trying to package your module as an rpm package. So 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 only locally installed modulesRecently I found that some progress has been made on "testing as installed" scenario and it is possible now execute pytest with small patch
With that patch pytest is ble to collect units and start testing and it fails in few units.
Expected behavior
pytest should not fail.
How to Reproduce
Output
Will add pytest output in next comment.
The text was updated successfully, but these errors were encountered: