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

Fix deprecation in Python 3.12 #511

Merged
merged 3 commits into from
Dec 3, 2023
Merged

Conversation

Dreamsorcerer
Copy link
Contributor

Fixes #508.

@kurtmckee
Copy link

@spulec I recommend merging this PR. It will resolve an outstanding DeprecationWarning in Python 3.12, which was released on Monday.

@sirosen
Copy link

sirosen commented Oct 4, 2023

Hey, second person looking at the 3.12 breakage (full disclosure, @kurtmckee and I work together 🙂 )! I think the person whose attention we need is @boxed, who appears to have commit access on this repo.

@boxed
Copy link
Contributor

boxed commented Oct 5, 2023

@sirosen I do not. I have switched to time-machine long ago and I recommend you do too.

@sirosen
Copy link

sirosen commented Oct 5, 2023

I'm surprised/confused by this. The most recently merged PRs appear to be done by you in February, which is why I assumed you'd be able to help patch this.
If you don't have write access on the repo then it bodes ill for freezegun, but...

I have switched to time-machine long ago and I recommend you do too.

... thanks for this recommendation! Looking into it for all of two minutes shows that it's from a maintainer with a decent track record for keeping projects healthy long-term, and it looks like nearly a drop-in replacement. I'll start looking into this for our team's needs.

@boxed
Copy link
Contributor

boxed commented Oct 5, 2023

@sirosen This project has been functionally abandoned for several years. I tried to fix that for a while. Then I found out that time-machine exists.

@Dreamsorcerer
Copy link
Contributor Author

I have switched to time-machine long ago and I recommend you do too.

We just tried this and it doesn't support pypy, which is a bit of a blocker to migrating over.

ghickman added a commit to opensafely-core/job-server that referenced this pull request Oct 13, 2023
While working on python 3.12 compatibility fixes I found a comment from
the freezegun maintainer [1] saying the library was functionally
abandoned and that they had moved on to time-machine.

Time-machine looks well maintained and has a fairly trivial conversion
story along with docs for just that.

1: spulec/freezegun#511 (comment)
ghickman added a commit to opensafely-core/job-server that referenced this pull request Oct 13, 2023
While working on python 3.12 compatibility fixes I found a comment from
the freezegun maintainer [1] saying the library was functionally
abandoned and that they had moved on to time-machine.

Time-machine looks well maintained and has a fairly trivial conversion
story along with docs for just that.

1: spulec/freezegun#511 (comment)
@jaraco jaraco mentioned this pull request Nov 29, 2023
@Dreamsorcerer
Copy link
Contributor Author

I have switched to time-machine long ago and I recommend you do too.

We just tried this and it doesn't support pypy, which is a bit of a blocker to migrating over.

We decided to switch anyway, skipping the test on Pypy, but now we have reports from downstream packagers that time-machine segfaults when they run it. So far it is not looking like the best replacement for freezegun, and is a shame that this is not being maintained anymore...

Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for fixing this @Dreamsorcerer!

@bblommers bblommers merged commit cbcc59f into spulec:master Dec 3, 2023
@kurtmckee
Copy link

Thanks @bblommers! I see you're listed as a maintainer on PyPI -- would you be willing to push a release to address this?

@bblommers
Copy link
Collaborator

Done @kurtmckee! 1.3.0 is now out.

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.

utcnow is deprecated
6 participants