Skip to content

add support for python 3.13#685

Open
branchv wants to merge 4 commits intojuju:masterfrom
branchv:py313
Open

add support for python 3.13#685
branchv wants to merge 4 commits intojuju:masterfrom
branchv:py313

Conversation

@branchv
Copy link

@branchv branchv commented Dec 2, 2024

This PR contains a couple of fixes for python 3.13:

Fixes #681

Checklist

  • Are all your commits [logically] grouped and squashed appropriately?
  • Does this patch have code coverage?
  • Does your code pass make test?

Copy link
Collaborator

@freyes freyes left a comment

Choose a reason for hiding this comment

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

Hi, thanks for this PR, this is something we must definitively want to have, I just left one comment inline, which prompts me to think that maybe we would need to cut a new major release (charm-tools 4.x ) to drop older versions of python

exclude = ["*tests*"]

[build-system]
requires = ["setuptools>=68"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is an aspect that makes be concerned, how compatible this is with older versions of python, do you know what versions can we support with pyproject.toml ?

Copy link
Author

Choose a reason for hiding this comment

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

Yea compatibility is determined by the build backend. If you want to stick with setuptools (the only setuptools-specific feature this currently uses is setting the dynamic version), they added initial support for pyproject.toml in 61.0.0, which supports >=3.7 and later stabilized in 68.1.0, which supports >=3.8

If you need to support even older pythons, you can pick another build backend (flit for example supported >=3 for a while but it can only read version from a static file)

What python versions do you need to support? I will note that most core packaging projects use only pyproject.toml themselves these days, including pip, setuptools, packaging, etc

Copy link
Collaborator

Choose a reason for hiding this comment

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

3.8 (focal) is fine, that's the oldest we support :-)

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good, added a requires-python to make that support explicit

Copy link
Collaborator

@freyes freyes left a comment

Choose a reason for hiding this comment

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

Add 3.13 to the testing matrix please, - https://github.com/juju/charm-tools/blob/master/.github/workflows/tests.yml#L16 - also we need a maintainer to allow this PR to run the CI

The former was renamed due to PyPI classifying the project as critical and requiring 2FA: CheetahTemplate3/cheetah3@673259b
As shown with `python3.12 -m compileall -f $(git ls-files '*.py')`
@daeho-ro
Copy link

What about 3.14 ? ruamel.yaml need to be updated for 0.18.15.

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.

No module named 'cgi' under py3.13

3 participants