Skip to content

chore: drop Python 3.9 support for running SAM, add Python 3.12-3.14 to CI#3893

Open
roger-zhangg wants to merge 5 commits intoaws:developfrom
roger-zhangg:drop3.9
Open

chore: drop Python 3.9 support for running SAM, add Python 3.12-3.14 to CI#3893
roger-zhangg wants to merge 5 commits intoaws:developfrom
roger-zhangg:drop3.9

Conversation

@roger-zhangg
Copy link
Member

@roger-zhangg roger-zhangg commented Mar 17, 2026

What

Drop Python 3.9 as a supported version for running the SAM translator itself, and extend CI coverage to Python 3.12, 3.13, and 3.14.

Important distinction

This change only drops Python 3.9 as a version for running SAM. Python 3.9 as a Lambda runtime in SAM templates is still fully supported. Test fixtures that use Runtime: python3.9 are intentionally left unchanged.

Changes

  • setup.pypython_requires bumped to >=3.10, classifiers updated to 3.10–3.14
  • .github/workflows/build.yml — test matrix now runs 3.10, 3.11, 3.12, 3.13, 3.14(after pydantic v1 support added)
  • pyproject.toml — Black target_version updated to py310–py314
  • ruff.toml / tests/ruff.toml / integration/ruff.tomltarget-version bumped to py310
  • requirements/base.txt — simplified pydantic dependency (removed 3.8/3.9 conditional pins)
  • DEVELOPMENT_GUIDE.md — updated supported versions and pyenv install instructions

Drop Python 3.9 as a supported version for running SAM CLI/translator
itself. This does NOT affect Python 3.9 as a Lambda runtime — SAM
templates using python3.9 as a Lambda runtime continue to work as before.

Changes:
- setup.py: bump python_requires to >=3.10, update classifiers to 3.10-3.14
- .github/workflows/build.yml: test matrix now runs 3.10, 3.11, 3.12, 3.13, 3.14
- pyproject.toml: black target_version updated to py310-py314
- ruff.toml, tests/ruff.toml, integration/ruff.toml: target-version bumped to py310
- requirements/base.txt: simplified pydantic pin (removed 3.8/3.9 conditionals)
- DEVELOPMENT_GUIDE.md: updated supported versions and pyenv instructions
@roger-zhangg roger-zhangg requested a review from a team as a code owner March 17, 2026 20:38
# checking policy action
actions = dlq_policy_statement["Action"]
action_list = actions if isinstance(actions, list) == list else [actions]
action_list = actions if actions is list else [actions]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is correct.

type(actions) is list would work, but actions is list will never be True (and it's not the same that we had before).

This is probably why you had to add an exception for this in the ruff.toml file, but ruff complaining about this usage of is is exactly what we want on this line

Copy link
Contributor

Choose a reason for hiding this comment

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

wait, I'm reading this code again. The previous code was very weird too!
isinstance(actions, list) == list will always be false too. Because isinstance returns a boolean!

Probably that's why this new code is so weird too. I guess we never go in the if and apparently the test works well in that case. (because it's waiting only one element in the next line).

Let's still fix this, but at least I see that the implementation had problems before

"**/*.py" = [
"S101", # Use of `assert` detected
"PLR", # pylint-refactor
"E721", # Use `is` and `is not` for type comparisons
Copy link
Contributor

Choose a reason for hiding this comment

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

I added another comment mentioning that we might not want to add this (at least another part when there's actually an error that should have been caught by this). Are there other parts that are failing with this rule?

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