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

test_integration: allow PEP 625 sdist name #1096

Merged
merged 4 commits into from Apr 29, 2024

Conversation

woodruffw
Copy link
Member

This should fix the integration tests.

Explanation: the integration suite uses pypa/sampleproject, which uses setuptools as its build backend. setuptools in turn has recently switched to adhering to PEP 625, which enforces that hyphens in package names be normalized to underscores to eliminate a parsing ambiguity in the sdist file format.

sampleproject's backend dependency on setuptools is unconstrained, which means in principle that the latest version should always be used. However, this patch allows both the PEP 625 and the old variant, just in case pip or other layers of the stack select an older setuptools.

See also: pypa/setuptools#3593

Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw
Copy link
Member Author

I confirmed that this fixes the dist name assert locally, but the integration suite is now flaking on TestPyPI itself returning 503s.

The flake on (macOS, 3.8) appears to be something very deeply broken: I can confirm that lxml itself is installed, but it appears that lxml's 3.8 macOS wheel may actually be broken, causing mypy to ImportError on it. From local testing:

>>> from lxml import etree
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/william/tmp/env/lib/python3.8/site-packages/lxml/etree.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_exsltDateXpathCtxtRegister'
>>> 

(That approximates how mypy discovers lxml: https://github.com/python/mypy/blob/ba6febc903776491ea445cef2ef5375b95e178cd/mypy/report.py#L27-L32)

Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw woodruffw marked this pull request as ready for review April 29, 2024 18:20
@woodruffw
Copy link
Member Author

Integration is still flaky for the reason above, but I've "fixed" the Python 3.8 macOS failure by excluding the current patch version of lxml from the types environment. I've filed a launchpad tracker for the bad wheel here: https://bugs.launchpad.net/lxml/+bug/2064158

@woodruffw woodruffw changed the title test_integration: all PEP 625 sdist name test_integration: allow PEP 625 sdist name Apr 29, 2024
@sigmavirus24 sigmavirus24 merged commit 5de10e8 into pypa:main Apr 29, 2024
22 of 23 checks passed
@woodruffw woodruffw deleted the ww/fix-integration branch April 29, 2024 19:29
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

Successfully merging this pull request may close these issues.

None yet

2 participants