Skip to content

Conversation

@eerovaher
Copy link
Contributor

@eerovaher eerovaher commented Nov 7, 2025

I would like to add type annotations to astropy.coordinates, and because pyerfa is a very important dependency then having type annotations in pyerfa would help a lot. Currently pyerfa supports numpy>=1.19.3, which is a problem for type annotations because numpy.typing wasn't introduced until 1.20 and numpy.typing.NDArray wasn't introduced until 1.21. This also came up in #176.

numpy 1.21 was released in 2021, so this complies with SPEC 0.

UPDATE: Given that Python 3.9 has reached end-of-life, it is a good idea to start requiring Python >= 3.10. The oldest version of numpy that supports Python 3.10 is 1.21.3, so the numpy requirement has been updated accordingly. (numpy 1.21.2 provided wheels for Python 3.10rc1, but does not claim to support Python 3.10).

description =
run tests
devdeps: with the latest developer version of key dependencies
olddeps: with medium old versions of key dependencies
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there are concerns that the range of supported numpy versions is so wide that the devdeps and oldestdeps CI jobs are not enough then I suggest following the advice of SPEC 0 and limiting the range of supported versions.

# The following provides some specific pinnings for key packages
deps =
oldestdeps: numpy==1.19.* # astropy LTS
olddeps: numpy==1.20.* # something potentially problematic (see gh-101)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find any useful details in #101.

@neutrinoceros
Copy link
Contributor

coincidentally, numpy 1.21.2 was the first version to support Python 3.10, and with 3.9 now being officially EOL, I think we could very much consider dropping 3.9 and requiring numpy>=1.21.2 in the same PR

Copy link
Member

@avalentino avalentino left a comment

Choose a reason for hiding this comment

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

LGTM

@eerovaher
Copy link
Contributor Author

I thought the idea of dropping support for Python 3.9 was a good one and I would have been willing to implement it, but because this PR got approved as it is then I'll refrain from updating it.

@avalentino
Copy link
Member

@eerovaher please feel free to go on with 3.9 removal and request a new approval when you have finished

@eerovaher eerovaher force-pushed the drop-np-lt-1.21 branch 3 times, most recently from e1eae4e to 7fba65b Compare November 12, 2025 14:56
@eerovaher eerovaher changed the title Drop support for numpy<1.21 Drop support for Python 3.9 Nov 12, 2025
@eerovaher
Copy link
Contributor Author

I've updated this PR to drop support for Python 3.9. SPEC 0 allows dropping support for Python 3.11 and numpy 1.26, but at the moment I am not aware of any reasons why we should.

Comment on lines -606 to -608
if self.name == 'zpv':
# Works on newer numpy
return "np.__version__ < '1.21', reason='needs numpy >= 1.21'"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't notice this earlier, but we don't have to worry about numpy < 1.21 anymore.

The oldest supported version of `numpy` has been updated accordingly.
@avalentino
Copy link
Member

Sorry @eerovaher , is this ready to me verged now?
@mhvk is it OK for you?

@avalentino avalentino requested a review from mhvk December 2, 2025 14:39
Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

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

Yes, happy to upgrade. It is just that there hasn't been a new SOFA for a long time that there seemed to be no reason to upgrade python/numpy either.

@mhvk
Copy link
Contributor

mhvk commented Dec 2, 2025

Actually, sorry, would be good to add an entry in CHANGES.rst as well, that the minimum supported versions have changes.

@eerovaher
Copy link
Contributor Author

There aren't any minimum supported Python or numpy version update announcements in CHANGES.rst, expect perhaps

- Min numpy version in ``tox.ini`` updated to fix CI issues.
but I don't see how that could possibly be helpful for any users, so it's a useless entry.

@neutrinoceros
Copy link
Contributor

Seems like a good opportunity to start documenting these

@mhvk
Copy link
Contributor

mhvk commented Dec 2, 2025

I agree we should be better, but am fine with not doing it now, but rather at the release. Let me just merge this.

@mhvk mhvk merged commit 6ad7ee3 into liberfa:main Dec 2, 2025
26 checks passed
@eerovaher eerovaher deleted the drop-np-lt-1.21 branch December 2, 2025 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants