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

MAINT: Raise RuntimeError if setuptools version is too recent. #20795

Merged
merged 1 commit into from Jan 11, 2022

Conversation

charris
Copy link
Member

@charris charris commented Jan 11, 2022

Backport of #20759.

NumPy does not build with setuptools versions greater than '60.0.0'.
Check the version when setuptools is imported in setup.py and raise
a RuntimeError if the version is too recent. That way we avoid people
opening issues when their build fails for that reason.

Closes #20692.

NumPy does not build with setuptools versions greater than '60.0.0'.
Check the version when setuptools is imported in setup.py and raise
a RuntimeError if the version is too recent. That way we avoid people
opening issues when their build fails for that reason.

Closes numpy#20692.
@charris charris added 03 - Maintenance 08 - Backport Used to tag backport PRs labels Jan 11, 2022
@charris charris added this to the 1.22.1 release milestone Jan 11, 2022
@charris charris added the 36 - Build Build related PR label Jan 11, 2022
@charris charris merged commit 4877d60 into numpy:maintenance/1.22.x Jan 11, 2022
@charris charris deleted the fix-20692 branch January 11, 2022 22:59
@thesamesam
Copy link
Contributor

thesamesam commented Jan 14, 2022

Wouldn't it be sufficient to fail when vendored distutils is used? Setuptools 60+ supports using SETUPTOOLS_USE_DISTUTILS=stdlib to avoid this kind of issues without forcing the whole system to use buggy unmaintained setuptools versions.

Trying this out and it seems to work fine so far for numpy (and test suite passed).

@charris
Copy link
Member Author

charris commented Jan 14, 2022

buggy unmaintained setuptools versions.

They work for NumPy and we have no assurance that setuptools won't stop working again. We plan to change build systems over the next year.

EDIT: The main purpose is to avoid people creating issues that result from using newer setuptools. We have been getting those.

@thesamesam
Copy link
Contributor

thesamesam commented Jan 14, 2022

buggy unmaintained setuptools versions.

They work for NumPy and we have no assurance that setuptools won't stop working again. We plan to change build systems over the next year.

I understand. Only reason I am asking is because it's hard for downstream packagers if something is pinning a hard < requirement. The only breakage known so far is to do with distutils and this knob exists for that reason. Setting it reverts to the old behaviour as it bypasses the setuptools implementation entirely.

I'm not asking you to sort out the distutils issues in general or anything, I'm just wondering if that setting seems to work for you too, as it does for me and I expect it to. My understanding is that it should mitigate anything to do with the ongoing transition in setuptools right now.

(I wasn't sure if maybe nobody had realised it existed.)

But if we need to just do this downstream, I get that too. Thanks in any case for working on a new build system!

@charris
Copy link
Member Author

charris commented Jan 14, 2022

One possibility is to add a check for SETUPTOOLS_USE_DISTUTILS=stdlib if the version is >= 60. That said, I don't see documentation of that option.

@kloczek
Copy link

kloczek commented Jan 15, 2022

Can someone make PR with such modyfication or post here patch for that?

@ahesford
Copy link
Contributor

ahesford commented Feb 1, 2022

#20963 attempts to resolve problems around this change.

@rgommers
Copy link
Member

rgommers commented Feb 9, 2022

I'm just wondering if that setting seems to work for you too, as it does for me and I expect it to. My understanding is that it should mitigate anything to do with the ongoing transition in setuptools right now.

This may or may not work - it's a completely untested combination, so YMMV.

Only reason I am asking is because it's hard for downstream packagers if something is pinning a hard < requirement.

Just seeing this now. If you get weird build issues you may still have to downgrade, or go debug the issue by yourself. So I'm not at all sure that this will be better for packagers. It's almost guaranteed to break eventually - but it may stay working for a while.

@thesamesam
Copy link
Contributor

I'm just wondering if that setting seems to work for you too, as it does for me and I expect it to. My understanding is that it should mitigate anything to do with the ongoing transition in setuptools right now.

This may or may not work - it's a completely untested combination, so YMMV.

Only reason I am asking is because it's hard for downstream packagers if something is pinning a hard < requirement.

Just seeing this now. If you get weird build issues you may still have to downgrade, or go debug the issue by yourself. So I'm not at all sure that this will be better for packagers. It's almost guaranteed to break eventually - but it may stay working for a while.

It works for us in Gentoo and seemingly other downstreams. We'll know to keep an eye out if we get failures anyway as it's going to end up being setuptools related, but this hack is there for other packages too. I don't really expect numpy to support it, but would appreciate patches being merged as we go if we find some easy workarounds which don't affect normal cases.

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
03 - Maintenance 08 - Backport Used to tag backport PRs 36 - Build Build related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants