Skip to content

Revert "CI temporarily pin numpy" #50706

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 3 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asv_bench/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
// pip (with all the conda available packages installed first,
// followed by the pip installed packages).
"matrix": {
"numpy": ["1.23.5"], // https://github.com/pandas-dev/pandas/pull/50356
"numpy": [],
"Cython": ["0.29.32"],
"matplotlib": [],
"sqlalchemy": [],
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-310-numpydev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ dependencies:
- "cython"
- "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple"
- "--pre"
- "numpy<1.24"
- "numpy"
- "scipy"
2 changes: 1 addition & 1 deletion ci/deps/actions-310.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:

# required dependencies
- python-dateutil
- numpy<1.24
- numpy
- pytz

# optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38-downstream_compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:

# required dependencies
- python-dateutil
- numpy<1.24
- numpy
- pytz

# optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:

# required dependencies
- python-dateutil
- numpy<1.24
- numpy
- pytz

# optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-39.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:

# required dependencies
- python-dateutil
- numpy<1.24
- numpy
- pytz

# optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-pypy-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ dependencies:
- hypothesis>=5.5.3

# required
- numpy<1.24
- numpy
- python-dateutil
- pytz
2 changes: 1 addition & 1 deletion ci/deps/circle-38-arm64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:

# required dependencies
- python-dateutil
- numpy<1.24
- numpy
- pytz

# optional dependencies
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:

# required dependencies
- python-dateutil
- numpy<1.24
- numpy
- pytz

# optional dependencies
Expand Down
1 change: 1 addition & 0 deletions pandas/compat/numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
np_version_under1p21 = _nlv < Version("1.21")
np_version_under1p22 = _nlv < Version("1.22")
np_version_gte1p22 = _nlv >= Version("1.22")
np_version_gte1p24 = _nlv >= Version("1.24")
Copy link
Member

Choose a reason for hiding this comment

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

Was this added since this PR is to be backported and it's in the 1.5.x branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added it in the second commit (the one after the pure revert, which also catches the SystemError)

TBH I accidentally left it in after I was trying things out, and then figured I'd just leave it here as it'll probably be useful at some point. Reckon it needs removing?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I would opt to only add this until we really need it (and IIRC you may have wanted to remove these in favor of direct version checks in the code?)

Copy link
Member Author

Choose a reason for hiding this comment

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

that was only for the Python version, because pyupgrade will rewrite them (they don't rewrite based on 3rd party libraries)

OK, sure, I'll remove this line - is the rest alright?

Copy link
Member

Choose a reason for hiding this comment

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

Yup the rest LGTM

is_numpy_dev = _nlv.dev is not None
_min_numpy_ver = "1.20.3"

Expand Down
7 changes: 7 additions & 0 deletions pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def safe_import(mod_name: str, min_version: str | None = None):
mod = __import__(mod_name)
except ImportError:
return False
except SystemError:
# TODO: numba is incompatible with numpy 1.24+.
# Once that's fixed, this block should be removed.
if mod_name == "numba":
return False
else:
raise

if not min_version:
return mod
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ psutil
pytest-asyncio>=0.17
coverage
python-dateutil
numpy<1.24
numpy
pytz
beautifulsoup4
blosc
Expand Down