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 metadata as produced by #3903 + #3904 #4029

Merged
merged 18 commits into from
Aug 29, 2023

Conversation

abravalheri
Copy link
Contributor

Summary of changes

Closes

Pull Request Checklist

This change extracts the logic for writing 'requires.txt' from
the ``egg_info`` module into ``_requirestxt``.

It also adds the missing pre-processing for ``install_requires`` and
``extras_require`` previously done in ``dist`` but now implemented in
``_requires.txt``.
For the time being, when `setuptools.build_meta` is called,
`egg_info.egg_base` is accidentally set to the project root between the
several calls to the different build hooks.

This means that if the hooks are called, they will try to overwrite
`setuptools.egg-info/PKG-INFO`, and for a very short interval of time it
will be an empty file.

Another process may then try to simultaneously use `importlib.metadata`
to list entry-points. However to sort entry-points, `importlib.metadata`
will try to read the `Name` field in the `PKG-INFO/METADATA` files and
will raise an error/warning if that file is empty.

This commit tries to use `os.replace` to avoid having an empty PKG-INFO
while `importlib.metadata` is used.
Here we use a specific SHA that we now is "green" to avoid problems with
a moving HEAD.
@abravalheri abravalheri changed the title Test metadata on #3903, #3904 Test metadata as produced by #3903 + #3904 Aug 29, 2023
(An independent validation library makes the confidence in the code
stronger).
@abravalheri abravalheri marked this pull request as ready for review August 29, 2023 17:42
@abravalheri abravalheri merged commit 1ef36f2 into pypa:main Aug 29, 2023
21 checks passed
@abravalheri abravalheri deleted the test-metadata branch August 29, 2023 17:44
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.

1 participant