Skip to content

feat: add Python 3.15 support - #4764

Merged
kddejong merged 5 commits into
aws-cloudformation:mainfrom
botantony:python-3.15-support
Oct 22, 2026
Merged

kddejong merged 5 commits into
aws-cloudformation:mainfrom
botantony:python-3.15-support

Conversation

@botantony

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

Add Python 3.15 support and adjust a few tests. I changed test_getatt_resource_with_list as it failed for me even before my changes and inverted sys.version_info comparison in test_validate_by_py_version (droppin pre 3.9 check as only 3.10+ is supported). Verified changes by running tox. TestUpdateResourceSchemas.test_update_force did not pass on 3.10 for whatever reason and 3.12 refused to install on my system:

py312: commands[0]> pip install -e '.[full]'
Traceback (most recent call last):
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/bin/pip", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 47, in main
    from pip._internal.cli.autocompletion import autocomplete
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py", line 12, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py", line 11, in <module>
    from pip._internal.cli import cmdoptions
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py", line 28, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/cli/parser.py", line 20, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/configuration.py", line 22, in <module>
    from pip._internal.exceptions import (
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_internal/exceptions.py", line 23, in <module>
    from pip._vendor.packaging.requirements import InvalidRequirement
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py", line 8, in <module>
    from ._parser import parse_requirement as _parse_requirement
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_vendor/packaging/_parser.py", line 12, in <module>
    from ._tokenizer import DEFAULT_RULES, Tokenizer
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_vendor/packaging/_tokenizer.py", line 8, in <module>
    from .specifiers import Specifier
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_vendor/packaging/specifiers.py", line 71, in <module>
    _MIN_VERSION: Final[Version] = Version("0.dev0")
                                   ^^^^^^^^^^^^^^^^^
  File "/Users/antonmelnikov/tmp2/cfn-lint/.tox/py312/lib/python3.12/site-packages/pip/_vendor/packaging/version.py", line 438, in __init__
    raise InvalidVersion(f"Invalid version: {version!r}")
pip._vendor.packaging.version.InvalidVersion: Invalid version: '0.dev0'
py312: exit 1 (0.11 seconds) /Users/antonmelnikov/tmp2/cfn-lint> pip install -e '.[full]' pid=54222
py312: FAIL ✖ in 0.13 seconds

Everything else passed fine:

  py310: FAIL code 1 (101.68=setup[0.03]+cmd[2.04,0.26,99.34] seconds)
  py311: OK (92.45=setup[0.02]+cmd[1.86,0.21,89.34,1.02] seconds)
  py312: FAIL code 1 (0.13=setup[0.01]+cmd[0.11] seconds)
  py313: OK (87.34=setup[0.01]+cmd[1.90,0.27,84.19,0.97] seconds)
  py314: OK (66.99=setup[0.01]+cmd[1.99,0.24,63.59,1.17] seconds)
  py315: OK (79.69=setup[0.01]+cmd[2.59,0.27,75.83,0.98] seconds)
  style: OK (17.89=setup[0.01]+cmd[0.27,17.62] seconds)

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kddejong
kddejong force-pushed the python-3.15-support branch from f459fc8 to c5a6f55 Compare October 21, 2026 18:15
Add Python 3.15 support and adjust a few tests.

Signed-off-by: botantony <antonsm21@gmail.com>
@kddejong
kddejong force-pushed the python-3.15-support branch from c5a6f55 to b6d0a5c Compare October 21, 2026 20:30
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.68%. Comparing base (07673d3) to head (dce7f17).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4764      +/-   ##
==========================================
+ Coverage   94.67%   94.68%   +0.01%     
==========================================
  Files         439      439              
  Lines       15973    15973              
  Branches     3097     3097              
==========================================
+ Hits        15122    15124       +2     
+ Misses        468      467       -1     
+ Partials      383      382       -1     
Flag Coverage Δ
unittests 94.67% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pyproject.toml Resolved
@kddejong
kddejong merged commit e8f395b into aws-cloudformation:main Oct 22, 2026
24 checks passed
@botantony
botantony deleted the python-3.15-support branch October 22, 2026 18:32
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