-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
build meta wheel does not respect metadata_directory per PEP-517 #1825
Comments
IMO the passed directory is not necessary. It will certainly match the recently generated one. |
First and foremost it's mandated per PEP-517, so you MUST conform to that expectation. Second, you can't really make the assumption that it will match. For example, the user might have invoked manually (aka via |
I think the current backends always rebuild dist-info as part of the wheel build. The newly rebuilt dist-info is very likely to match the one built moments earlier by the other hook |
I'm not sure I follow how this is related to the fact that this hook should take and use the |
Updated OP's post to a permalink: setuptools/setuptools/build_meta.py Line 214 in 2878bad
|
This is also discussed in pypa/build#217. Although setuptools is free to rebuild dist-info in This has also been raised to flit (pypa/flit#389) and poetry (python-poetry/poetry#1078). |
Would it be easier to remove this requirement from the specification since no backend found it worthwhile
…On Sat, Jan 30, 2021, at 8:17 AM, Tzu-ping Chung wrote:
This is also discussed in pypa/build#217 <pypa/build#217>. Although setuptools is free to rebuild dist-info in `build_wheel` (instead of using the content of `metadata_directory`), it should at least *verify* the built wheel indeed contains identical metadata to those provided in `metadata_directory`. #2529 <#2529> is a concrete example of setuptools failing expectations due to this nonconformance.
This has also been raised to flit (pypa/flit#389 <pypa/flit#389>) and poetry (python-poetry/poetry#1078 <python-poetry/poetry#1078>).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#1825 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABSZERQ3PENSZTRR5ZWKN3S4QBGZANCNFSM4IM4JSKQ>.
|
But then what happens if a backend return different things from |
setuptools-ext is a thin wrapper around If setuptools were to diligently follow PEP 517 (i.e. does not just ignore the However since that didn't work, instead This "tweaking" of a build backend by wrapping the hooks is apparently an expected usage, because it's documented as a way for an in-tree build backend to augment the build dependencies (by @abravalheri here). It's unfortunate that one can't reliably use a similar technique for |
I just encountered exactly the same thing as seen by I'm guessing it isn't already easy to build using an existing |
Precisely. Things are complicated because of the division between the Right now the Footnotes |
Curiosity got the better of me, and I opened an issue in pypa/wheel#611 and prototyped in pypa/wheel#612. With proposed PR to diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py
index 2decd2d21..58b50cfc4 100644
--- a/setuptools/build_meta.py
+++ b/setuptools/build_meta.py
@@ -406,9 +406,12 @@ class _BuildMetaBackend(_ConfigSettingsTranslator):
def build_wheel(
self, wheel_directory, config_settings=None, metadata_directory=None
):
+ cmd = ['bdist_wheel']
+ if metadata_directory:
+ cmd.extend(['--dist-info-dir', metadata_directory])
with suppress_known_deprecation():
return self._build_with_temp_dir(
- ['bdist_wheel'],
+ cmd,
'.whl',
wheel_directory,
config_settings, |
From https://www.python.org/dev/peps/pep-0517/#build-wheel:
https://github.com/pypa/setuptools/blob/master/setuptools/build_meta.py#L208 though ignores the passed in
metadata_directory
argument and goes to regenerate this information in the root of the project.The text was updated successfully, but these errors were encountered: