Closed hroncok closed 3 weeks ago
Reverting https://github.com/pypa/wheel/commit/e43f2fcb296c2ac63e8bac2549ab596ab79accd0 makes it go away. I don't know what exactly makes the name go blank in this commit.
This also reproduces with Python 3.11, hence it is not Python 3.12 specific.
Does it happen with any other projects with C extensions? If it did, someone would probably have raised an alarm earlier.
mplcairo is the only project in Fedora that we were able to identify. I don't know yet what makes it special.
It could be the build trickery it engages in in its setup.py
.
cc @QuLogic and @anntzer from mplcairo
The extension module is called (empty string)
It could be the build trickery it engages in in its setup.py.
I used to do very weird things in setup.py, which date back to setup_requires and the pre-pyproject.toml days. Probably the whole thing could use a migration to pyproject.toml and a much more streamlined setup.py (I'd rather stick to setuptools for now), but I can't guarantee any timeline (a PR would be welcome).
I think mplcario
is depending on the order commands run in. This is suspect, I think:
https://github.com/matplotlib/mplcairo/blob/37f64dbbd5aa03209464f6d5ad10756c5fdd08c5/setup.py#L67
class build_ext(build_ext):
def finalize_options(self):
if not self.distribution.have_run.get("egg_info", 1):
# Just listing the MANIFEST; setup_requires are not available yet.
super().finalize_options()
return
# Body of build_ext here ...
If egg_info
is not finalized, I think this doesn't get listed in have_run
, so the default of 1 is used, causing this to run. Now it's initialized, due to
egg_info = self.distribution.get_command_obj("egg_info")
egg_info.ensure_finalized() # needed for correct `wheel_dist_name`
So this is is 0 causing this to be skipped. That if statement, which assumes a missing "egg_info"
is "True" is suspect, IMO. This looks like something that is trying to check something by looking at a totally different condition that also once happened be in sync with what it really cares about - these are always fragile.
But it could be something else in this custom build_ext
that depends on the finalization order.
Thanks for the investigation. Looks like the if
check and early return are actually unnecessary since https://github.com/pypa/setuptools/pull/1150 (which installs setup_requires very early); I pushed a commit on mplcairo that removes it and the build still seems fine.
When running the impact check of wheel 0.41 in Fedora, we have noticed a regression since 0.40 in our mplcairo package. To reproduce, run:
The content of setup.cfg does not matter:
Build the wheel. The extension module is called (empty string) and the file will be named just
.cpython-312-x86_64-linux-gnu.so
. Using pip also reproduces it.Using an older version of wheel, the extension module is called
mplcairo._mplcairo
and the file will be namedmplcairo/_mplcairo.cpython-312-x86_64-linux-gnu.so
.