Setuptools Tests query PyPI #2534
Setuptools Tests Search PyPI
Originally reported privately to avoid early disclosure.
In the test suite of https://pypi.org/project/setuptools/,
It only happens in tests, so it's not a high severity issue. I'm
The happens because setuptools passes filenames to pip's --find-links,
I'm attaching a log of the tests, run without connectivity to the
The affected test appears to be test_test_command_install_requirements.
Reviewing what the test does, it seems unlikely that the tests could pass as described:
If that were the case, the tests would surely fail, as the tests explicitly import modules from the various requirements.
Still, it's obvious from the "MissingSchema" error (in the logs) that something was causing the
This is the command that the test runs when it defers to pip:
I was able to replicate the issue, first by creating a 'bits' sdist:
Then by referencing that sdist in a
The problem is not that it fails to build but that it attempts to download the project from the index URL.
I've found with this diff, I can observe the output:
And in particular, when running
So I'll commit just the NO_INDEX setting.
Patch committed at #2515 and released as 51.1.1.
Subsequently, reporter indicates the issue exists in other tests:
It does appear as if many tests in
After patching to ensure verbose output from pip, I've found running this command can elicit the failures:
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index dc00e697d..c0271c4e9 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -38,6 +38,11 @@ from .files import build_files from .textwrap import DALS +@pytest.fixture(autouse=True) +def pip_always_verbose(monkeypatch): + monkeypatch.setenv('PIP_VERBOSE', 'true') + + class FakeDist: def get_entry_map(self, group): if group != 'console_scripts':
Applying this diff:
demonstrates the fix:
Patch applied in a499dee, pending release with 51.2.0.
The text was updated successfully, but these errors were encountered: