Skip to content

REF: use oldest-supported-numpy #43146

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
wants to merge 2 commits into from
Closed

Conversation

henryiii
Copy link

This code is currently hand-copied from SciPy, now there's a package that exists to do just that. As a bonus, NumPy will no longer need to build wheels on 3.10 (Linux 64-bit only currently)

Two things to consider: first, for Python 3.7, this sets an older build time requirement for NumPy than is there currently. According to the NumPy devs, this is fine, older build time requirements than the run requirement is okay. But we could use selectors and manually set NumPy for this one case, it's not something that changes.

Second, we could pin here, but given that this just pins old versions, I don't think it needs pinning. We could set a minimum, though, >=0.10 for example.

@jreback
Copy link
Contributor

jreback commented Aug 21, 2021

looks fine, do we need to somehow add this to our build configuration on CI?

@jreback jreback added the Build Library building on various platforms label Aug 21, 2021
@jreback jreback added this to the 1.4 milestone Aug 21, 2021
@henryiii
Copy link
Author

henryiii commented Aug 21, 2021

do we need to somehow add this to our build configuration on CI

Well, it's already being built in most the jobs, but the important thing is what version of NumPy the PEP 517 build process downloads. It seems the build I checked (sdist / build) doesn't build verbosely, so you can't tell what version of NumPy it installed in the build environment, you can just see the runtime one. If there's a test that builds Pandas (either as a wheel or as an install such as pip install .) and then installs (if installing wheel) or rolls back (if installing directly) the version of NumPy to the oldest you support, then runs the tests, that would be perfect.

The reason this (the old list of NumPy versions and the package that maintains that list) exists is that you can't use newer runtime NumPy than you built with.

As long as the Python 3.7 tests pass and we can verify it is downloading a pinned NumPy version, I think it's pretty safe. I don't actually see Python 3.7 listed in the checks, though?

@henryiii
Copy link
Author

henryiii commented Aug 21, 2021

Is actions-38.yaml, not slow and not network and not clipboard known to be flaky, perhaps? That had one memory address failure, but that seems to be a conda build, and conda doesn't use pyproject.toml, so don't think that could be affected?

FAILED pandas/tests/frame/methods/test_rename.py::TestRename::test_rename_inplace

Here,

python -m pip install --no-build-isolation -e .
the pyproject.toml deps are disabled. So this shouldn't be affected at all by this patch?

@henryiii henryiii changed the title refactor: use oldest-supported-numpy REF: use oldest-supported-numpy Aug 21, 2021
@jreback
Copy link
Contributor

jreback commented Aug 21, 2021

just because the CI passes doesn't mean this change actually works. We don't build wheels in this repo. We are no longer on 3.7

@henryiii
Copy link
Author

Ah, looks like master has dropped Python 3.7, so I guess 1.4 is planned for after December 26, which is the NEP 29 drop date for Python 3.7. However, there needs to be a Python 3.10 supporting release before December 26. Python 3.10 hits fully in October (and ideally packages are supposed to pick up support during the RC phase). Should this be backported to the 1.3 branch? I'm guessing that's where the Python 3.7 tests are.

(Sort of assuming Pandas is following NEP 29, seems to be in #29034 (comment) for example)

@jreback
Copy link
Contributor

jreback commented Aug 21, 2021

Ah, looks like master has dropped Python 3.7, so I guess 1.4 is planned for after December 26, which is the NEP 29 drop date for Python 3.7. However, there needs to be a Python 3.10 supporting release before December 26. Python 3.10 hits fully in October (and ideally packages are supposed to pick up support during the RC phase). Should this be backported to the 1.3 branch? I'm guessing that's where the Python 3.7 tests are.

(Sort of assuming Pandas is following NEP 29, seems to be in #29034 (comment) for example)

yes we can backport this

@jreback jreback modified the milestones: 1.4, 1.3.3 Aug 21, 2021
@henryiii
Copy link
Author

henryiii commented Aug 21, 2021

python -m pip install dist/*.gz

This builds from SDist, which builds via PEP 517 with PEP 518 requirements (the comment in the pyproject.toml is wrong, by the way, using the implied default build-backend = "setuptools.build_meta:__legacy__" instead of build-backend = "setuptools.build_meta" does not disable PEP 517). That literally builds a wheel then installs the wheel.

What about slightly modifying that test, both to add "-v" for verbose output, as well as installing the oldest supported NumPy (not the package, just the version) after the build and then running at least one test that touches NumPy?

henryiii and others added 2 commits August 21, 2021 11:38
This code is currently hand-copied from SciPy, now there's a package that exists to do just that. As a bonus, NumPy will no longer need to build wheels on 3.10 (Linux 64-bit only currently)
@henryiii
Copy link
Author

I didn't add a test, the current job just does a simple import, which might not trigger the error. Any ideas for a simple test that would touch the NumPy portions?

- name: Force oldest supported NumPy
run: |
case "${{matrix.python-version}}" in
3.8)
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs 3.7 as well (as this is going to be backported); will need to followup and then remove 3.7 on master. so this is complicated. let's just leave these additions to the sdist workflow for a followup PR instead. alt we can simply target master (maybe a better idea).

@jreback jreback modified the milestones: 1.3.3, 1.4 Aug 26, 2021
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Sep 26, 2021
@lithomas1 lithomas1 removed this from the 1.4 milestone Oct 5, 2021
@henryiii
Copy link
Author

henryiii commented Oct 6, 2021

What's the status here? From what I understood, "we can simply target master (maybe a better idea)." is the current state, and there also was a suggestion to backport and add 3.7 to this list.

@jreback
Copy link
Contributor

jreback commented Oct 6, 2021

this PR overlaps with #43729 (now wouldn't mind adding the specific CI job that you are adding).

@henryiii
Copy link
Author

Replaced by #43729

@henryiii henryiii closed this Oct 12, 2021
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 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use oldest-supported-numpy in pyproject.toml
3 participants