Closed larsoner closed 3 months ago
This looks fine to me, apart from commit cosmetics - code itself seems fine:
Wrt. NumPy 2: I see that Ubuntu 22.04 ships with Python 3.10, but I can't see NumPy 2 in the repository. I assume I could still test build locally if I wanted to? Haven't test rebuild the Python version in years.
This looks fine to me, apart from commit cosmetics
Okay force-pushed three more verbose commits, let me know if these are good enough or need further tweaks!
Wrt. NumPy 2: I see that Ubuntu 22.04 ships with Python 3.10, but I can't see NumPy 2 in the repository. I assume I could still test build locally if I wanted to? Haven't test rebuild the Python version in years.
Yep you can! The nice thing about all this build-system
stuff in pyproject.toml
is that it doesn't really matter what NumPy you actually have installed on your system, or what Ubuntu 22.04 ships with, etc. pip
nowadays uses the build-system
specs to create an isolated build environment (which will have NumPy 2.0 after this PR, at least on Python 3.9+), build the wheel, and then install that back in the original environment. And the NumPy folks made sure that code built with NumPy 2.0 is backward compatible with NumPy 1.x installs, so it should all work okay even if you have NumPy 1.x installed.
Better. Nitpick: The commit summary line ideally should have proper capitalization, ie, "Set the description..." and "Prefer NumPy..." and end with a . - Like a mostly proper sentence. Similar in the commit text for commit 2, a properly terminated sentence. And it would be good to add the links to those NumPy 2 release notes and the testing with Alex's wheels. Basically what is now in your pull request message but not in the commit messages. You almost can't be to verbose on the PTB side.
Thanks -- done!
Perfect, thanks.
setup.py
, without ittwine check --strict
complains.build-system
when possible (i.e., on Python 3.9 or later). This will create code that is compatible with both NumPy 1.x and 2.x.PyArray_REFCOUNT
with the drop-in replacementPy_REFCNT
(the former is gone in NumPy 2.0)The first commit is the content-type fix. The next commit contains the two changes that make things compatible with NumPy 2.0, done following suggestions in their release notes.
I've tested that the wheels produced using this branch work on Linux as well in https://github.com/aforren1/ptb-wheels/pull/10.