-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MNT simplify pyproject.toml by using oldest-supported-numpy #18900
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
MNT simplify pyproject.toml by using oldest-supported-numpy #18900
Conversation
Thoughts @alfaro96 / @ogrisel ? This is just marked as a draft so it doesn't get merged before the updates are released to PyPI. @ogrisel you had raised that this project may not want to match the exact versions from |
pyproject.toml
Outdated
# platform_python_implementation!='CPython' not needed >= Python 3.7 which is numpy 1.14.5 | ||
"numpy==1.13.3; python_version=='3.6' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation=='CPython'", | ||
"numpy==1.14.0; python_version=='3.6' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation!='CPython'", | ||
"numpy==1.14.0; python_version=='3.6' and platform_machine!='aarch64' and platform_system!='AIX' and platform_python_implementation=='PyPy'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this to specifically call out PyPy since this is what PyPy reports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #18879, I have realized that numpy==1.19.0
has to be used for PyPy
(the wheels are available from this version). Otherwise, numpy
is compiled from source and this is something that we should avoid.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change doesn't change anything there so it's not problematic immediately (not a regression and might not be something that should block this PR). I do think that if I were to bump this here I'd need to also add your change here 9c27b7e#diff-83a4b90ed0c61f5e1a834555270a9d1e687cd4ece074262fcd18e7fcf160e6d5L9-R9 and it might make sense to bump the version in #18879 unless you think that will merge before this (and I could update this to match master
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyPy support PR for oldest-supported-numpy
: scipy/oldest-supported-numpy#15
I have realized that
numpy==1.19.0
has to be used forPyPy
(the wheels are available from this version). Otherwise,numpy
is compiled from source and this is something that we should avoid.
That sounds right to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we could rely on oldest-supported-numpy
for PyPy
. Then we would not need to keep track of the NumPy
wheels available for each architecture (as @rth stated in #18900 (comment)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, I think that we need to update the minimum version of NumPy
for PyPy
in sklearn/_min_dependencies.py
.
CC @thomasjpfan.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, I think that we need to update the minimum version of
NumPy
forPyPy
insklearn/_min_dependencies.py
.CC @thomasjpfan.
That's actually what I meant about bumping the min supported numpy 😅
Let me post a couple of corrections to that comment:
Scikit-learn has more resources that most projects, so I won't advocate for or against this PR, but I hope that |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @terencehonles !
With this change we will be delegating this responsibility to oldest-support-numpy
. This kind of pushes pyproject.toml
as the "source of truth" for specifying the version of our build dependencies, which I am okay with.
@terencehonles May you push a commit with [cd build]
in the commit message to trigger the wheel building pipeline?
|
||
# ARM needs numpy >= 1.19.0 | ||
# platform_machine!='aarch64' not needed >= Python 3.9 which is numpy 1.19.3 | ||
"numpy==1.19.0; python_version=='3.6' and platform_machine=='aarch64'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a reference, this is 1.19.2
in https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg but I am okay with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a result of @rgommers comment here scipy/oldest-supported-numpy#13 (comment)
e219e84
to
de8a72c
Compare
@thomasjpfan they look like they built properly. The See: https://github.com/scikit-learn/scikit-learn/runs/1450732587?check_suite_focus=true |
I'm also not opposed to outsource the decision on the minimal supported numpy version to the
Which seems to be the case if I understand #18900 (comment) correctly We would need more feedback before approving this PR though. cc @jeremiedbb @ogrisel @NicolasHug @glemaitre @alfaro96 |
Also I think the main selling point of this PR is not that it simplifies the |
de8a72c
to
45b1ae9
Compare
Updated based on #18900 (comment), and I bumped the min numpy version for PyPy as per the change in #18879 (see #18900 (comment) ). I realized that |
It seems good to me, thanks for PR and thanks @rgommers for the explanation. It seems it will indeed reduce maintenance efforts. My only concern is, would it be possible to get inconsistent build configuration between this dependency in But our nightly builds should be able to detect those cases if they happen and maybe we can adapt on the fly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for merging once a release of oldest-supported-numpy with scipy/oldest-supported-numpy#15 is online.
Note: We should remember to trigger the |
The only situation where I can imagine that happening is for more exotic platforms where By the way, |
@ogrisel should the build tooling emit the version pulled in by
That way it would be at least correct at build time for the wheel, but obviously it wouldn't necessarily match a rebuild if |
Moving foward, we can link to
On a side note, once https://www.python.org/dev/peps/pep-0621/ gets approved, we can move most of the metadata into |
That's basically what I was suggesting, but when building the wheels you'd have that version installed and you could just save the numpy version. Otherwise you'd have to fetch the package or source and parse setup.cfg which the package manager would have already done for you when "installing" My question is more of: "is this necessary" / "of value"? If linking to |
Looks like |
That would be great. At leas the scikit-learn My concern is who can we find the version of numpy was used to build a given, old, version of the scikit-learn wheel. Maybe we could embed this info into some kind of generated private python submodule of sklearn package and shipped into the wheel. Ideally this would not part of the sdist / .tar.gz distribution, just the wheels and conda packages. But we can do this improvement in a later PR. |
+1 for merging this PR as it is if the Between 0.24.0 and 1.0.0 we will have plenty of time to see if this new way to define the build dependencies overtime. In particular I am not sure how it will impact the scikit-learn-feedstock on conda-forge. |
|
The codecov diff failure looks to be the only thing not passing and I believe I had previously ran |
Was there anything that needs to be updated here? |
Hi @terencehonles thanks for your patience! Do you mind synchronizing with upstream? Renaming the main branch made some checks to fail. Thanks! |
c7da13e
to
d6b4348
Compare
Done, but I believe they may have already failed before and I believe they were just CI errors (but it looks like at least the one I checked its history is lost so we'll see after this run). |
The rest of failures are unrelated with this PR. See: #19316. Therefore, LGTM 😉. |
Ok let's give it a try. We still have to to revert it before 1.0 if we discover problems in the mean time. |
Reference Issues/PRs
Follows up on comment by @alfaro96 #18761 (comment)
What does this implement/fix? Explain your changes.
Uses
oldest-supported-numpy
as it now matches the versions specified inpyproject.toml
(@master
but not released, see: scipy/oldest-supported-numpy#13)On the comment #18761 (comment) we resolved we may not be able to upstream the PyPy requirements, but I realized we could constrain
oldest-supported-numpy
to only be used when not matching PyPy.Any other comments?
This should be merged only pending a new release of
oldest-supported-numpy
. I'm asking about the release schedule now.