Skip to content

Adequate custom build_py command to changes in setuptools v64#313

Merged
effigies merged 1 commit into
python-versioneer:masterfrom
abravalheri:integration-setuptools-64
Aug 12, 2022
Merged

Adequate custom build_py command to changes in setuptools v64#313
effigies merged 1 commit into
python-versioneer:masterfrom
abravalheri:integration-setuptools-64

Conversation

@abravalheri

Copy link
Copy Markdown
Contributor

setuptools v64 introduces the new PEP 660 hooks, which seems to be incompatible with versioneer (as per pypa/setuptools#3501)

The idea of this PR is to try finding a way to make the integration with the new version work properly.

Disclaimer: I am not very familiar with python-versioneer, so please forgive me if there is something wrong here.

Deep explanation

This means that when pip install -e . runs, it will try to use the new editable_wheel command instead of develop.

Previously, the develop command special-cased build_py and build_ext and treated each command considering the knowledge on what they do.

This was problematic because custom build steps could not run during an editable install.

editable_wheel tries to use a more generic approach and fix the problem of custom build steps:

  • all the build subcommands should run.
  • each command have the opportunity to early return by checking if the current build is an editable install or not.

For versioneer the implication is that the build_lib directory may not contain a _version.py file.

@abravalheri abravalheri marked this pull request as ready for review August 11, 2022 21:28
@effigies

Copy link
Copy Markdown
Contributor

Thanks @abravalheri! This looks completely sensible. I think our existing guards in build_ext are probably already avoiding this case as well. It might be good to try to unify these to be more consistent between commands, but given that this seems to need fixing for many people on a short time scale, I'm inclined to merge and release.

@effigies effigies merged commit 1643ebb into python-versioneer:master Aug 12, 2022
@abravalheri abravalheri deleted the integration-setuptools-64 branch August 12, 2022 12:31
@abravalheri

Copy link
Copy Markdown
Contributor Author

Thank you very much @effigies. I also added some contingency to setuptools. Probably the later releases are much less problematic. Sorry if it caused any disruption.

It might be good to try to unify these to be more consistent between commands, but given that this seems to need fixing for many people on a short time scale, I'm inclined to merge and release.

In build_ext the inplace and the editable_mode attributes should work in unison with the new editable installs (they are pretty much exchangeable). I don't know if this helps to open the doors for some refactoring.

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