-
Notifications
You must be signed in to change notification settings - Fork 127
Add support for Python 3.12 #1359
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
Conversation
There is a little overlap with #1351 where I also addressed the datetime warning. |
@wshanks Ahh right, my bad, your fix is simpler so I've switched to yours. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated cron-staging.yml as well, but otherwise this looks good!
@coruscating We have confused GitHub here. The merge queue is blocked waiting for the 3.11 tests but this PR replaces them with 3.12 tests so they will never run. Maybe you can override and merge this with your admin privileges? I hope this doesn't foul up the other pre-existing PRs with 3.11 runs. |
@wshanks Thanks for catching the cron job config! This PR merged fine after I changed the branch protection rules to look for passing 3.12 tests instead of 3.11, and existing open PRs just have to merge the changes from main and rerun their CI. |
Summary
Now that Aer supports Python 3.12 starting with 0.13.2 (Qiskit/qiskit-aer#2022), we should be able to support it as well. The only code change needed was to update the deprecated usage of
datetime.datetime.utcnow()
todatetime.datetime.now(datetime.UTC)
. I added a python version checker to handle this sincedatetime.UTC
was only introduced in 3.11.