Skip to content

Conversation

silv-io
Copy link
Member

@silv-io silv-io commented Mar 11, 2025

Motivation

As in dependent repositories, we have an issue with the ASF updates since the latest ruff update. The definition of the Python 3.9 target version in linting/formatting leads to syntax errors when enabling preview features like we do in the ASF update action.

To fix that, we need to define our versions correctly depending on if the code runs in the CLI or in the runtime (container)

Changes

  • Set target version to py311 matching our .python-version
  • Set per-file-target-version to py39 for all code accessed in the CLI matching our minimum required version
  • Apply changes that are made necessary by upgrading the target version to py311
  • Make code that can be reached by the CLI py39 compatible (remove match statement from usage.py)

@silv-io silv-io added the semver: patch Non-breaking changes which can be included in patch releases label Mar 11, 2025
Comment on lines +196 to +203
# Only allow minimum version for code used in the CLI
"localstack-core/localstack/cli/**" = "py39"
"localstack-core/localstack/packages/**" = "py39"
"localstack-core/localstack/config.py" = "py39"
"localstack-core/localstack/constants.py" = "py39"
"localstack-core/localstack/utils/analytics/**" = "py39"
"localstack-core/localstack/utils/bootstrap.py" = "py39"
"localstack-core/localstack/utils/json.py" = "py39"
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm unsure whether this set of files is correct or maybe even too much (e.g., in the case of the analytics code where I even had to remove a match statement)

Copy link
Member

Choose a reason for hiding this comment

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

i think this is good for now! we can always remove files from here

Copy link

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 53m 55s ⏱️ + 2m 30s
4 125 tests ±0  3 805 ✅ ±0  320 💤 ±0  0 ❌ ±0 
4 127 runs  ±0  3 805 ✅ ±0  322 💤 ±0  0 ❌ ±0 

Results for commit b641829. ± Comparison against base commit 118016f.

Copy link
Member

@thrau thrau left a comment

Choose a reason for hiding this comment

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

LGTM! thanks for cleaning up 🚀

Comment on lines +196 to +203
# Only allow minimum version for code used in the CLI
"localstack-core/localstack/cli/**" = "py39"
"localstack-core/localstack/packages/**" = "py39"
"localstack-core/localstack/config.py" = "py39"
"localstack-core/localstack/constants.py" = "py39"
"localstack-core/localstack/utils/analytics/**" = "py39"
"localstack-core/localstack/utils/bootstrap.py" = "py39"
"localstack-core/localstack/utils/json.py" = "py39"
Copy link
Member

Choose a reason for hiding this comment

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

i think this is good for now! we can always remove files from here

@silv-io silv-io merged commit da04939 into master Mar 11, 2025
31 checks passed
@silv-io silv-io deleted the fix-asf-updates branch March 11, 2025 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants