Skip to content

test_integration: allow PEP 625 sdist name#1096

Merged
sigmavirus24 merged 4 commits intopypa:mainfrom
woodruffw-forks:ww/fix-integration
Apr 29, 2024
Merged

test_integration: allow PEP 625 sdist name#1096
sigmavirus24 merged 4 commits intopypa:mainfrom
woodruffw-forks:ww/fix-integration

Conversation

@woodruffw
Copy link
Copy Markdown
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 <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
@woodruffw
Copy link
Copy Markdown
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)

@woodruffw woodruffw marked this pull request as ready for review April 29, 2024 18:20
@woodruffw
Copy link
Copy Markdown
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
@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.

2 participants