Skip to content

BLD: Pin numpy to < 2 #55488

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 4 commits into from
Oct 12, 2023
Merged

BLD: Pin numpy to < 2 #55488

merged 4 commits into from
Oct 12, 2023

Conversation

lithomas1
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@lithomas1 lithomas1 added Build Library building on various platforms CI Continuous Integration Compat pandas objects compatability with Numpy or Python functions labels Oct 11, 2023
@lithomas1 lithomas1 added this to the 2.1.2 milestone Oct 11, 2023
@lithomas1 lithomas1 marked this pull request as ready for review October 12, 2023 12:53
@lithomas1 lithomas1 requested a review from mroeschke as a code owner October 12, 2023 12:53
@@ -25,8 +25,8 @@ runs:
- name: Build Pandas
run: |
if [[ ${{ inputs.editable }} == "true" ]]; then
pip install -e . --no-build-isolation -v
pip install -e . --no-build-isolation -v --no-deps
Copy link
Member

Choose a reason for hiding this comment

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

Curious why do we need the --no-deps flag now?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's needed so numpydev can install dev numpy, otherwise the pin will force pip to install 1.26 there which isn't what we want.

@mroeschke mroeschke merged commit fe07fd5 into pandas-dev:main Oct 12, 2023
@mroeschke
Copy link
Member

Thanks @lithomas1

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Oct 12, 2023
@lithomas1 lithomas1 deleted the pin-np-2.0 branch October 12, 2023 22:45
mroeschke pushed a commit that referenced this pull request Oct 13, 2023
Backport PR #55488: BLD: Pin numpy to < 2

Co-authored-by: Thomas Li <[email protected]>
@rhshadrach
Copy link
Member

When NumPy 2.0 does come out, I think doing pip install pandas~=x where x is say 1.3-2.0 will result in invalid installations. Do we want to release patch versions to handle this?

@mroeschke
Copy link
Member

That would probably be a good idea, but I'll let @lithomas1 comment if he has bandwidth to tackle that

@lithomas1
Copy link
Member Author

When NumPy 2.0 does come out, I think doing pip install pandas~=x where x is say 1.3-2.0 will result in invalid installations. Do we want to release patch versions to handle this?

I don't think this is such a good idea. Rebuilding those older versions is likely going to be a PITA, and the gain isn't likely to be worth it.

As you might know, this is only going to be an issue for pip (conda has some special mechanism to retroactively apply the pins), so I'm happy telling people to either switch to conda, or follow CI best practices in freezing your package versions.

@rhshadrach
Copy link
Member

so I'm happy telling people to either switch to conda

From JetBrains 2021 survey, only 21% report using conda. I do not believe it is our role to tell people how they should manage their dependencies.

or follow CI best practices in freezing your package versions

I don't think there is any data here, but I'd guess from my experience we can't rely on this.

Once NumPy 2.0 comes out, users can always specify numpy < 2.0 themselves with pip. It might bit a bit of an issue at first, but once the first set of error messages is answered on Stack Overflow, it should be easy to solve 😆. So since it's any harder than just putting up a small PR to add the pin, I'm good with not doing so.

@lithomas1
Copy link
Member Author

Yeah, I'm totally happy to pin an issue about this.

@lithomas1
Copy link
Member Author

I opened #55519.

I'll also post something via the pandas Twitter/Mastodon, if I have time, later today.

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 CI Continuous Integration Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants