Skip to content

ENH: use oldest-supported-numpy in pyproject.toml #43141

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

Closed
henryiii opened this issue Aug 20, 2021 · 4 comments
Closed

ENH: use oldest-supported-numpy in pyproject.toml #43141

henryiii opened this issue Aug 20, 2021 · 4 comments
Labels
Build Library building on various platforms Duplicate Report Duplicate issue or pull request

Comments

@henryiii
Copy link

Is your feature request related to a problem?

Currently using Pandas on Python 3.10 RC 1 gets the wrong version of numpy (1.19) and builds the wheel manually, instead of getting the first wheel for NumPy + Python 3.10 (1.21).

Describe the solution you'd like

This problem has already been solved by https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg - by using SciPy (the org, not the package)'s oldest-supported-numpy, you get a thorough and up-to-date listing of the oldest supported numpy's for compiling. You can further control it using normal requirements (such as setting a higher requirement for some version, etc). That's literally all the package does, and is maintained by NumPy maintainers.

API breaking implications

None, just a build improvement.

Describe alternatives you've considered

Otherwise, the contents of https://github.com/scipy/oldest-supported-numpy/blob/master/setup.cfg should be placed in pyproject.toml and maintained for each new Python release - 3.10 is currently missing.

Additional context

Before:

    # Numpy requirements for different OS/architectures
    # Copied from https://github.com/scipy/scipy/blob/master/pyproject.toml (which is also licensed under BSD)
    "numpy==1.17.3; python_version=='3.7' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
    "numpy==1.18.3; python_version=='3.8' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
    "numpy==1.19.3; python_version>='3.9' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
    # Aarch64(Python 3.9 requirements are the same as AMD64)
    "numpy==1.19.2; python_version=='3.7' and platform_machine=='aarch64'",
    "numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64'",
    # Darwin Arm64
    "numpy>=1.20.0; python_version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'",
    "numpy>=1.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darwin'"

After:

    "oldest-supported-numpy"

(Optionally pinned if you want)

@henryiii henryiii added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 20, 2021
@jreback
Copy link
Contributor

jreback commented Aug 20, 2021

we already do this - i suppose it needs updating for 3.10

@TomAugspurger
Copy link
Contributor

I think the proposal is to replace

pandas/pyproject.toml

Lines 8 to 19 in 5410fb7

# Numpy requirements for different OS/architectures
# Copied from https://github.com/scipy/scipy/blob/master/pyproject.toml (which is also licensed under BSD)
"numpy==1.17.3; python_version=='3.7' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
"numpy==1.18.3; python_version=='3.8' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
"numpy==1.19.3; python_version>='3.9' and (platform_machine!='arm64' or platform_system!='Darwin') and platform_machine!='aarch64'",
# Aarch64(Python 3.9 requirements are the same as AMD64)
"numpy==1.19.2; python_version=='3.7' and platform_machine=='aarch64'",
"numpy==1.19.2; python_version=='3.8' and platform_machine=='aarch64'",
# Darwin Arm64
"numpy>=1.20.0; python_version=='3.8' and platform_machine=='arm64' and platform_system=='Darwin'",
"numpy>=1.20.0; python_version=='3.9' and platform_machine=='arm64' and platform_system=='Darwin'"
]
with just "oldest-supported-numpy", which will keep things up to date for us. That sounds great to me.

@lithomas1
Copy link
Member

Duplicate of #40307.

@lithomas1 lithomas1 added Build Library building on various platforms Duplicate Report Duplicate issue or pull request and removed Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 21, 2021
@lithomas1 lithomas1 added this to the No action milestone Aug 21, 2021
@henryiii
Copy link
Author

Duplicate of #40307.

I searched for the string oldest-supported-numpy before opening and didn't see anything, guess because it was in a link?

I think the proposal is to replace

Yes, it was.

we already do this - i suppose it needs updating for 3.10

That was the point (and this is something in this issue not in the issue from 6 months ago), the current list needs updating, but instead of continually updating it, it's better to just take oldest-supported-numpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

4 participants