diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fb052f7928..6d87e8379e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -70,11 +70,19 @@ jobs: task: 'ci-compile' python-version-short: '3.8' python-version: '3.8.10' + - name: 'Lint Checks (black, flake8, etc.)' + task: 'ci-checks' + python-version-short: '3.9' + python-version: '3.9.14' + - name: 'Compile (pip deps, pylint, etc.)' + task: 'ci-compile' + python-version-short: '3.9' + python-version: '3.9.14' env: TASK: '${{ matrix.task }}' COLUMNS: '120' - PYLINT_CONCURRENCY: '4' + PYLINT_CONCURRENCY: '6' steps: - name: Checkout repository uses: actions/checkout@v2 @@ -174,6 +182,18 @@ jobs: nosetests_node_index: 1 python-version-short: '3.8' python-version: '3.8.10' + - name: 'Unit Tests (chunk 1)' + task: 'ci-unit' + nosetests_node_total: 2 + nosetests_node_index: 0 + python-version-short: '3.9' + python-version: '3.9.14' + - name: 'Unit Tests (chunk 2)' + task: 'ci-unit' + nosetests_node_total: 2 + nosetests_node_index: 1 + python-version-short: '3.9' + python-version: '3.9.14' # This job is slow so we only run in on a daily basis # - name: 'Micro Benchmarks' # task: 'micro-benchmarks' @@ -359,6 +379,24 @@ jobs: nosetests_node_index: 1 python-version-short: '3.8' python-version: '3.8.10' + - name: 'Pack Tests' + task: 'ci-packs-tests' + nosetests_node_total: 1 + nosetests_node_index: 0 + python-version-short: '3.9' + python-version: '3.9.14' + - name: 'Integration Tests (chunk 1)' + task: 'ci-integration' + nosetests_node_total: 2 + nosetests_node_index: 0 + python-version-short: '3.9' + python-version: '3.9.14' + - name: 'Integration Tests (chunk 2)' + task: 'ci-integration' + nosetests_node_total: 2 + nosetests_node_index: 1 + python-version-short: '3.9' + python-version: '3.9.14' services: mongo: image: mongo:4.4 diff --git a/.github/workflows/microbenchmarks.yaml b/.github/workflows/microbenchmarks.yaml index fcc7b5cca0..9477b256f8 100644 --- a/.github/workflows/microbenchmarks.yaml +++ b/.github/workflows/microbenchmarks.yaml @@ -46,6 +46,12 @@ jobs: nosetests_node_index: 0 python-version-short: '3.8' python-version: '3.8.10' + - name: 'Microbenchmarks' + task: 'micro-benchmarks' + nosetests_node_total: 1 + nosetests_node_index: 0 + python-version-short: '3.9' + python-version: '3.9.14' services: mongo: image: mongo:4.4 diff --git a/.github/workflows/orquesta-integration-tests.yaml b/.github/workflows/orquesta-integration-tests.yaml index 5e0a4ebeef..84913a1cd3 100644 --- a/.github/workflows/orquesta-integration-tests.yaml +++ b/.github/workflows/orquesta-integration-tests.yaml @@ -67,6 +67,12 @@ jobs: nosetests_node_index: 0 python-version-short: '3.8' python-version: '3.8.10' + - name: 'Integration Tests (Orquesta)' + task: 'ci-orquesta' + nosetests_node_total: 1 + nosetests_node_index: 0 + python-version-short: '3.9' + python-version: '3.9.14' services: mongo: image: mongo:4.4 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 334479b702..172c0cd64d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -38,6 +38,9 @@ jobs: - name: 'Test (pants runs: pytest)' python-version-short: '3.8' python-version: '3.8.10' + - name: 'Test (pants runs: pytest)' + python-version-short: '3.9' + python-version: '3.9.14' services: mongo: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ad8cb12637..a267a04fed 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -40,6 +40,9 @@ Added * Expose environment variable ST2_ACTION_DEBUG to all StackStorm actions. Contributed by @maxfactor1 +* Python 3.9 support. #5730 + Contributed by Amanda McGuinness (@amanda11 intive) + Changed ~~~~~~~ * Remove `distutils` dependencies across the project. #5992 diff --git a/lockfiles/st2.lock b/lockfiles/st2.lock index 852a04be5b..1d97f6325d 100644 --- a/lockfiles/st2.lock +++ b/lockfiles/st2.lock @@ -6,7 +6,7 @@ // { // "version": 3, // "valid_for_interpreter_constraints": [ -// "CPython<3.9,>=3.6" +// "CPython<3.10,>=3.6" // ], // "generated_with_requirements": [ // "PyYAML", @@ -5089,7 +5089,7 @@ "zstandard" ], "requires_python": [ - "<3.9,>=3.6" + "<3.10,>=3.6" ], "resolver_version": "pip-2020-resolver", "style": "universal", diff --git a/pants.toml b/pants.toml index 42f4a886e9..04435830d0 100644 --- a/pants.toml +++ b/pants.toml @@ -108,8 +108,8 @@ enable_resolves = true default_resolve = "st2" interpreter_constraints = [ # python_distributions needs a single constraint (vs one line per python version). - # officially, we exclude 3.7 support, but that adds unnecessary complexity: "CPython>=3.6,!=3.7.*,<3.9", - "CPython>=3.6,<3.9", + # officially, we exclude 3.7 support, but that adds unnecessary complexity: "CPython>=3.6,!=3.7.*,<3.10", + "CPython>=3.6,<3.10", # NB: constraints for tools defined below ] diff --git a/pylint_plugins/api_models.py b/pylint_plugins/api_models.py index a5b3cf00bf..d2b7d7e9b3 100644 --- a/pylint_plugins/api_models.py +++ b/pylint_plugins/api_models.py @@ -147,11 +147,24 @@ def transform(cls: nodes.ClassDef): if ( isinstance(target, nodes.Subscript) and target.value.value.name == "schema" - and target.value.slice.value.value == "properties" ): - property_name_node = target.slice.value + if ( + isinstance(target.value.slice.value, nodes.Const) + and target.value.slice.value.value == "properties" + ): + # python <3.9 + property_name_node = target.slice.value + elif ( + isinstance(target.value.slice, nodes.Const) + and target.value.slice.value == "properties" + ): + # python 3.9+ + property_name_node = target.slice + else: + # not schema["properties"] + continue else: - # not schema["properties"] + # not schema[...] continue except AttributeError: continue @@ -197,7 +210,12 @@ def transform(cls: nodes.ClassDef): # schema = {"properties": {"action": REQUIRED_ATTR_SCHEMAS["action"]}} if isinstance(property_data_node, nodes.Subscript): var_name = property_data_node.value.name - subscript = property_data_node.slice.value.value + if isinstance(property_data_node.slice.value, nodes.Const): # python <3.9 + subscript = property_data_node.slice.value.value + elif isinstance(property_data_node.slice, nodes.Const): # python 3.9+ + subscript = property_data_node.slice.value + else: + continue # lookup var by name (assume its at module level) var_node = next(cls.root().igetattr(var_name))