Skip to content

Commit

Permalink
Update minimum numpy version for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
richli committed Aug 22, 2023
1 parent 6894176 commit c640b72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=41.2", "cython>=0.29.20", "wheel", "oldest-supported-numpy"]
requires = ["setuptools>=41.2", "cython>=0.29.20", "wheel", "oldest-supported-numpy; python_version<'3.12.0.rc1'", "numpy>=1.26.0b1; python_version>='3.12.0.rc1'"]
build-backend = "setuptools.build_meta"
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
numpy>1.13.3
numpy>1.13.3; python_version<'3.12.0.rc1'
numpy>=1.26.0b1; python_version>='3.12.0.rc1'

3 comments on commit c640b72

@opoplawski
Copy link

Choose a reason for hiding this comment

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

Could you expand on why numpy >= 1.26.0b1 is required when running with Python 3.12? I'd like to update Fedora 39 to cftime 1.6.3, but it has Python 3.12 and numpy 1.24.4.

@richli
Copy link
Contributor Author

@richli richli commented on c640b72 Feb 21, 2024

Choose a reason for hiding this comment

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

The version constraint here was based on this comment. And it's because numpy 1.26 was the first release to support Python 3.12. (The beta version was only temporarily needed because the final release wasn't out at the time of this commit.)

It looks like the Fedora package had to backport some fixes to get numpy 1.24.4 working with Python 3.12. I don't think there's anything intrinsically in cftime that requires numpy 1.26, so the Fedora package for cftime could ignore this constraint as long as the patched numpy package is working.

@opoplawski
Copy link

Choose a reason for hiding this comment

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

Thank you very much for the response.

Please sign in to comment.