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 Python 3.12 support #1761

Merged
merged 11 commits into from
Oct 29, 2023
Merged

Conversation

micahellison
Copy link
Member

@micahellison micahellison commented Jun 26, 2023

Fixes #1750. Adds Python 3.12 to continuous integration and updates sub-dependencies for 3.12 compatibility.

Checklist

  • I have read the contributing doc.
  • I have included a link to the relevant issue number.
  • I have checked to ensure there aren't other open pull requests
    for the same issue.
  • I have written new tests for these changes, as needed.

@micahellison
Copy link
Member Author

It looks like flakeheaven--or our particular setup--isn't ready for Python 3.12 beta. Replacing flakeheaven with ruff is also on my agenda right now so I'll leave this unresolved until that's taken care of.

@micahellison
Copy link
Member Author

We're fine with linting now, but the next step is to deal with the ansiwrap issue in #1693.

@micahellison
Copy link
Member Author

micahellison commented Aug 3, 2023

It looks like we have issues with two sub-dependencies:

  • For some reason, pyyaml (dependency of mkdocs) downgrades from 6.0.1 to 6.0 on my machine when poetry is installing in Python 3.12. I don't know why. It's also a dependency of another mkdocs dependency pyyaml-env-tag, but both of their version specs should match 6.0.1. Here's the output from poetry show --tree:
|-- pyyaml >=5.1
|-- pyyaml-env-tag >=0.1
|   `-- pyyaml * 

I'll probably wait at least a couple more weeks before revisiting this. Once the deps are ready, we'll still have to address any potential new test failures.

@micahellison
Copy link
Member Author

I still see the same problem with cryptography's sub-dependency cffi, though it looks like the maintainer is planning on fixing it soon.

@micahellison
Copy link
Member Author

I don't think we'll be ready to support Python 3.12 by the October 2nd release date at this rate. The cryptography/cffi issue remains, though I do see that there is ongoing work on it upstream. I'll keep checking in the coming weeks.

@micahellison
Copy link
Member Author

I resolved the pyyaml issue simply by running poetry lock. We don't run this often because renovate handles most of its functionality via PRs. However, it's been leaving the sub-dependencies untouched whenever possible, and some of these sub-dependencies like pyyaml and cffi needed to be updated for Python 3.12. With annual Python releases, I don't think we need to change our process to address this since they show up as failures in our Python version PRs and are appropriately fixed there.

@micahellison
Copy link
Member Author

All the tests are passing in CI now, but jrnl will not work in a normal Windows environment with Python 3.12 right now.

I can't install jrnl on my Windows 10 machine because there are no wheels for ruamel.yaml's sub-dependency ruamel.yaml.clib. I filed an issue in ruamel.yaml.clib and the maintainer is already aware of it. This problem leads to this error when I run poetry install --sync:

  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

I am assuming that the CI build for Windows in Python 3.12 is green right now because the GitHub Actions Windows runner has all sorts of Microsoft build tools pre-installed. It must have built the sub-dependency. But we absolutely don't want to require these build tools for Windows jrnl users, so let's hold off until that wheel is available.

@micahellison
Copy link
Member Author

Still waiting for a wheel from ruamel.yaml.clib, which doesn't have Python 3.12 Windows wheels because the Appveyor service that builds it doesn't support 3.12. I'll check back after the related issue is resolved: appveyor/ci#3879

@micahellison micahellison changed the title Add python 3.12 beta to PR tests and testing schedule Add Python 3.12 support Oct 17, 2023
@micahellison
Copy link
Member Author

ruamel.yaml.clib just released the Python 3.12 Windows wheels, and it is installing just fine on my machine. This is ready for review now.

@micahellison micahellison marked this pull request as ready for review October 22, 2023 16:46
@micahellison micahellison merged commit a8f5f54 into jrnl-org:develop Oct 29, 2023
11 checks passed
@EwoutH
Copy link

EwoutH commented Oct 31, 2023

Still waiting for a wheel from ruamel.yaml.clib, which doesn't have Python 3.12 Windows wheels because the Appveyor service that builds it doesn't support 3.12.

AppVeyor updated their images with Python 3.12 (appveyor/ci#3879).

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.

Add Python 3.12 support
2 participants