Skip to content
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

Remove deprecated call to astropy helpers. #554

Merged
merged 9 commits into from
Dec 4, 2024

Conversation

wtgee
Copy link
Contributor

@wtgee wtgee commented Jun 1, 2023

Removes the function call and defaults to pytest just showing the warning at end of test run. Thanks @pllim for pointing out.

Edit: Astropy issue here astropy/astropy#9718 and PR astropy/astropy#14670

Closes #553

P.S. I feel like there is some kind of meta irony in us not noticing this was deprecated...

@pllim
Copy link
Member

pllim commented Jun 1, 2023

To retain the functionality you are removing here, you need to change

[tool:pytest]

to turn warning into exceptions using

https://docs.pytest.org/en/stable/how-to/capture-warnings.html

@wtgee
Copy link
Contributor Author

wtgee commented Jun 2, 2023

Now I'm confused why this wasn't working before. Currently passing PRs show deprecations as warnings rather than raising actual exceptions.

@pllim
Copy link
Member

pllim commented Jun 2, 2023

The pytest way is probably more sensitive than what astropy was providing.

@pllim
Copy link
Member

pllim commented Jun 2, 2023

You should probably drop Python 3.7. It is picking up a very old astropy (4.3.1).

@wtgee
Copy link
Contributor Author

wtgee commented Jun 2, 2023

You should probably drop Python 3.7. It is picking up a very old astropy (4.3.1).

@bmorris3 I was going to make the same recommendation. End of life for 3.7 is at the end of this month so seems like a good time to remove.

Edit: The test matrix in general could probably use some updating as it specifies older astropy versions specifically in addition to python 3.7. The tox.ini and ci_tests.yml also don't match up, although that's probably okay (?).

@bmorris3
Copy link
Contributor

bmorris3 commented Jun 5, 2023

Hi @wtgee, sorry to begin reviewing this PR after making and merging #558, which I believe has the same effect as this PR. Shall we close this one?

@wtgee
Copy link
Contributor Author

wtgee commented Jun 5, 2023

Hey @bmorris3, this PR properly turns on the deprecations as exceptions via pytest, which replaces the functionality that was supposed to be working with enable_deprecations_as_exception. #558 removes that but doesn't add the pytest filter.

It's up to you if that should be in the repo but adding it in shows a bunch of other deprecations that should probably be dealt with soon (hence the follow-up issues about python 3.7, etc), so it's arguably nice to retain that functionality.

@pllim pllim merged commit bf5e26d into astropy:main Dec 4, 2024
8 checks passed
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.

Remove deprecated astropy helper functions.
3 participants