Skip to content

Commit efd5bb4

Browse files
authored
Merge pull request #253 from AndroxxTraxxon/master
update builtin collections imports to be forward-compatible with Python3.10+
2 parents d9a029b + 12ee053 commit efd5bb4

File tree

14 files changed

+29
-35
lines changed

14 files changed

+29
-35
lines changed

.coveragerc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@ exclude_lines =
2121
if __name__ == .__main__.:
2222

2323
ignore_errors = True
24+
omit = orquesta/tests/*
2425

25-
omit =
26-
tests/*

.github/workflows/tox.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ on:
1212

1313
jobs:
1414
tests:
15-
#python 3.6 not available on ubuntu-latest
1615
runs-on: ubuntu-20.04
1716
strategy:
1817
matrix:
19-
python-version: ["3.6", "3.8"]
18+
python-version: ["3.6", "3.8", "3.9", "3.10", "3.11"]
2019
steps:
2120
- name: Checkout repository
2221
uses: actions/checkout@v4
@@ -30,5 +29,4 @@ jobs:
3029
pip install -r requirements-ci.txt
3130
make clean reqs schemas
3231
- name: "Run tox for ${{ matrix.python-version }}"
33-
run: |
34-
make check
32+
run: make check

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ In Development
77
Changed
88
~~~~~~~
99

10+
* Update deprecated `collections` imports to `collections.abc` to be forward-compatible with Python3.10
11+
Contributed by @AndroxxTraxxon
12+
* Migrate from `nosetest` to `pytest` for Python test runner.
13+
Contributed by @AndroxxTraxxon
14+
* Add Python versions 3.9, 3.10, and 3.11 to the test matrix
15+
Contributed by @AndroxxTraxxon
1016
* Update networkx >=2.6 for Python 3.8 to fix insecure deserialization #255 (improvement)
1117
Contributed by @Stealthii
1218
* Update jsonschema requirements to allow 3.2 (improvement)

orquesta/conducting.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ def log_entry(
370370
result=None,
371371
data=None,
372372
):
373-
374373
# Check entry type.
375374
if entry_type not in ["info", "warn", "error"]:
376375
raise exc.WorkflowLogEntryError('The log entry type "%s" is not valid.' % entry_type)

orquesta/expressions/functions/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import collections
15+
import collections.abc
1616

1717
from orquesta import constants
1818
from orquesta import exceptions as exc
@@ -117,8 +117,8 @@ def item_(context, key=None):
117117
if not key:
118118
return current_item
119119

120-
if not isinstance(current_item, collections.Mapping):
121-
raise exc.ExpressionEvaluationException("Item is not type of collections.Mapping.")
120+
if not isinstance(current_item, collections.abc.Mapping):
121+
raise exc.ExpressionEvaluationException("Item is not type of collections.abc.Mapping.")
122122

123123
if key not in current_item:
124124
raise exc.ExpressionEvaluationException('Item does not have key "%s".' % key)

orquesta/specs/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
import collections
16+
import collections.abc
1717
import inspect
1818
import json
1919
import jsonschema
@@ -613,7 +613,7 @@ def update(self, *args, **kwargs):
613613
raise NotImplementedError()
614614

615615

616-
class SequenceSpec(Spec, collections.MutableSequence):
616+
class SequenceSpec(Spec, collections.abc.MutableSequence):
617617
def __init__(self, spec, name=None, member=False):
618618
super(SequenceSpec, self).__init__(spec, name=name, member=member)
619619

orquesta/tests/hacking/import_aliases_rule.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959

6060

6161
def get_alias(logical_line):
62-
6362
parts = logical_line.split()
6463

6564
if (
@@ -68,7 +67,6 @@ def get_alias(logical_line):
6867
and parts[1] != "__future__"
6968
and not core.is_import_exception(parts[1])
7069
):
71-
7270
# from path.to.module import module
7371
if len(parts) == 4:
7472
return ".".join([parts[1], parts[3]]), None

orquesta/tests/unit/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ def format_task_item(
156156
items_count=None,
157157
items_concurrency=None,
158158
):
159-
160159
if not actions and items_count is None:
161160
actions = [{"action": spec.action, "input": spec.input}]
162161

@@ -285,7 +284,6 @@ def assert_task_items(
285284
concurrency=None,
286285
mock_ac_ex_results=None,
287286
):
288-
289287
# Set up test cases.
290288
tests = list(zip(mock_ac_ex_statuses, expected_task_statuses, expected_workflow_statuses))
291289
tk_ex_result = [None] * len(items)

orquesta/tests/unit/conducting/native/test_task_rendering_for_with_items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_bad_item_type(self):
8181
"type": "error",
8282
"message": (
8383
"YaqlEvaluationException: Unable to evaluate expression '<% item(x) %>'. "
84-
"ExpressionEvaluationException: Item is not type of collections.Mapping."
84+
"ExpressionEvaluationException: Item is not type of collections.abc.Mapping."
8585
),
8686
"task_id": "task1",
8787
"route": 0,

orquesta/tests/unit/specs/native/test_workflow_rehearsal_spec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ def test_init_test_spec_with_mock_action_execution_yml_result_path(self):
211211
def test_init_test_spec_with_base_path(self):
212212
shutil.copy(self.get_wf_file_path("sequential"), "/tmp/sequential.yaml")
213213

214-
fd, path = tempfile.mkstemp(suffix=".json")
215-
214+
fd, path = tempfile.mkstemp(suffix=".json", dir="/tmp")
216215
with os.fdopen(fd, "w") as tmp:
217216
tmp.write('{"foo": "bar"}\n')
218217

0 commit comments

Comments
 (0)