Skip to content

MAINT force NumPy version for building scikit-learn for CPython 3.10 in Windows #24742

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

Merged
merged 6 commits into from
Oct 25, 2022

Conversation

glemaitre
Copy link
Member

@glemaitre glemaitre commented Oct 24, 2022

closes #24604

As specified in #24604 (comment), SciPy requires at least NumPy 1.22.3 with CPython 3.10 in Windows.
Unfortunately, oldest-supported-numpy set the minimum version to 1.21.6 in this configuration and we, therefore, need to overwrite the NumPy version for this configuration.

@glemaitre glemaitre changed the title MAINT force numpy version of config Python=3.10 and Windows platform. MAINT force numpy version of config Python=3.10 and Windows platform Oct 24, 2022
pyproject.toml Outdated
@@ -9,6 +9,7 @@ requires = [
# wheels on PyPI
#
# see: https://github.com/scipy/oldest-supported-numpy/blob/main/setup.cfg
"numpy==1.22.3; python_version=='3.10' and platform_system=='Windows' and platform_python_implementation != 'PyPy'",
"oldest-supported-numpy",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The marker not does not exist in the grammar defined by the PEP508.
I am wondering if changing the order would be enough then:

  • if we have the first match then it will install NumPy 1.22.3
  • otherwise, it will default to the oldest compatible NumPy

@ogrisel do you know if the ordering has an impact?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea. Maybe @rgommers knows?

Otherwise, we can compute the negation ourselves:

"oldest-supported-numpy; python_version!='3.10' or platform_system!='Windows' or platform_python_implementation=='PyPy'",
"numpy==1.22.3; python_version=='3.10' and platform_system=='Windows' and platform_python_implementation != 'PyPy'",

I am not sure if python_version != '3.10' is the exact negation of python_version= ='3.10' and I am not sure about the use of whitespaces around operators.

BTW could you include a link to the original issue with the discussion that led to this PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glemaitre glemaitre changed the title MAINT force numpy version of config Python=3.10 and Windows platform MAINT force NumPy version for building scikit-learn for CPython 3.10 in Windows Oct 24, 2022
@thomasjpfan thomasjpfan added the To backport PR merged in master that need a backport to a release branch defined based on the milestone. label Oct 24, 2022
Copy link
Member

@thomasjpfan thomasjpfan left a 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 fix!

@thomasjpfan thomasjpfan added this to the 1.1.3 milestone Oct 24, 2022
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@ogrisel ogrisel merged commit a71c535 into scikit-learn:main Oct 25, 2022
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Oct 26, 2022
…in Windows (scikit-learn#24742)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre added a commit that referenced this pull request Oct 26, 2022
…in Windows (#24742)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
glemaitre added a commit to glemaitre/scikit-learn that referenced this pull request Oct 31, 2022
…in Windows (scikit-learn#24742)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
andportnoy pushed a commit to andportnoy/scikit-learn that referenced this pull request Nov 5, 2022
…in Windows (scikit-learn#24742)

Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To backport PR merged in master that need a backport to a release branch defined based on the milestone.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not able to install on python 3.10 with pip
3 participants