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

Add support for python3.12 #808

Merged
merged 1 commit into from
Aug 26, 2023
Merged

Add support for python3.12 #808

merged 1 commit into from
Aug 26, 2023

Conversation

sirosen
Copy link
Member

@sirosen sirosen commented Aug 15, 2023

  • Test on 3.12.0rc1
  • Add a changelog entry for this (the phrasing is a little bit "early", since 3.12.0 hasn't released yet, but this is the changeset which adds support for everything expected in 3.12.0)
  • Update test dependencies to get the latest coverage version, for 3.12.0rc1 support
  • Add py312 to the tox env list
  • One minor tweak in the testsuite: datetime.datetime.utcnow() is deprecated because it produces a naive timestamp. Swap it to datetime.datetime.now() which is similar, still naive, and shouldn't trip things up much or at all.

📚 Documentation preview 📚: https://globus-sdk-python--808.org.readthedocs.build/en/808/

@sirosen
Copy link
Member Author

sirosen commented Aug 15, 2023

Two issues right now:

  • need to specify as 3.12.0-rc1 for the github action (annoying but fine)
  • the latest versions of some transitive dependencies in mindeps dropped py3.7 (it was going to happen sooner or later)

I'll probably do a separate body of work for the mindeps issue, possibly start on dropping 3.7 ourselves, etc.
Once I sort that out, I'll rebase and fix the py312 specifier for github.

@kurtmckee
Copy link
Member

need to specify as 3.12.0-rc1 for the github action (annoying but fine)

That is recently no longer true!

You can set allow-prereleases: true and then just specify "3.12" as the target version. If there isn't a GA release then it'll fall back to the latest prerelease version.

python-version: "3.12"
allow-prereleases: true

Copy link
Member

@kurtmckee kurtmckee left a comment

Choose a reason for hiding this comment

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

It may be possible to add constraints for the dependencies that hinge on Python 3.7...? I don't recall if we have deprecation plans of our own for Python 3.7 support yet.

.github/workflows/build.yaml Outdated Show resolved Hide resolved
changelog.d/20230815_161655_sirosen_test_on_py3_12.rst Outdated Show resolved Hide resolved
@sirosen
Copy link
Member Author

sirosen commented Aug 16, 2023

It may be possible to add constraints for the dependencies that hinge on Python 3.7...? I don't recall if we have deprecation plans of our own for Python 3.7 support yet.

Yeah, we don't have a plan yet, but we should. I want to try to whip something up which will read our python_requires from package data and validate it... against our CI config.
Plus, use that same data source when running the freezedeps script to get a pip-compile run on the correct python.

We'll see if I commit anything -- I give myself a 50/50 shot at writing something non-disastrous.

Copy link
Member

@kurtmckee kurtmckee left a comment

Choose a reason for hiding this comment

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

The pip-compile command is being run with Python 3.11.

Can it be run with Python 3.7 to resolve the Python 3.7 pinning problems? Alternatively, I cooked up a Python-by-Python requirements generator from within tox that can be used to generate the requirements files for all supported versions of Python.

@sirosen
Copy link
Member Author

sirosen commented Aug 16, 2023

Yeah, I was wanting to tackle at least a py37-test-mindeps.txt generator in a separate PR. Let's treat that as "fixing our py37" build, separately, and I'll rebase off of it.
If you want to take a crack at it, feel free. Otherwise, I'll try to do something.

Copy link
Member

@kurtmckee kurtmckee left a comment

Choose a reason for hiding this comment

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

I'll leave it to you to tackle the Python 3.7 compatibility.

This PR gets a big ol' 👍!

@sirosen sirosen marked this pull request as ready for review August 26, 2023 04:06
- Add py312 to the 'freezedeps' tox matrix
- Add py312 to the tox env list
- Update test dependencies to get the new package versions for the 312
  build
- Test on 3.12 (rc1) in GitHub Actions
- Add a changelog entry for this (the phrasing is a little bit
  "early", since 3.12.0 hasn't released yet, but this is the changeset
  which adds support for everything expected in 3.12.0)
- One minor tweak in the testsuite: `datetime.datetime.utcnow()` is
  deprecated because it produces a naive timestamp. Swap it to
  `datetime.datetime.now()` which is similar, still naive, and
  shouldn't trip things up much or at all.

Co-authored-by: Kurt McKee <[email protected]>
@sirosen
Copy link
Member Author

sirosen commented Aug 26, 2023

I had to do a little bit of tinkering post-rebase, mostly to get the 3.12 requirements regenerated.
Now that I've sorted that out, I'm going to let CI run and merge based on the prior approval when it passes.

@sirosen sirosen merged commit 15b4b79 into globus:main Aug 26, 2023
14 checks passed
@sirosen sirosen deleted the support-py312 branch August 26, 2023 05:04
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.

2 participants