Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python3.9 to GHA #5730

Merged
merged 11 commits into from
Oct 13, 2023
40 changes: 39 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/microbenchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/orquesta-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lockfiles/st2.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// {
// "version": 3,
// "valid_for_interpreter_constraints": [
// "CPython<3.9,>=3.6"
// "CPython<3.10,>=3.6"
// ],
// "generated_with_requirements": [
// "PyYAML",
Expand Down Expand Up @@ -5089,7 +5089,7 @@
"zstandard"
],
"requires_python": [
"<3.9,>=3.6"
"<3.10,>=3.6"
],
"resolver_version": "pip-2020-resolver",
"style": "universal",
Expand Down
4 changes: 2 additions & 2 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down
26 changes: 22 additions & 4 deletions pylint_plugins/api_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down