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

update builtin collections imports to be forward-compatible with Python3.10+ #253

Merged
merged 25 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6772632
Update workflow.py to be python3.10+ compatible
AndroxxTraxxon May 2, 2023
c030c33
Update base.py to be python3.10+ compatible
AndroxxTraxxon May 2, 2023
524eff2
Update base.py to be compatible back to 3.6
AndroxxTraxxon May 2, 2023
0d75e0b
Update workflow.py to also be backwards compatible to python 3.6
AndroxxTraxxon May 2, 2023
5fda72b
Update tox.yml
AndroxxTraxxon May 2, 2023
f105c00
Update tox.yml for old Python compatibility
AndroxxTraxxon May 2, 2023
79eb36c
Update tox.yml with more comprehensive test matrix to fit dependency …
AndroxxTraxxon May 2, 2023
209f988
Update tox.yml -- move exclusions to inside the strategy matrix
AndroxxTraxxon May 2, 2023
4167882
Update tox.yml - removing Python3.10 testing because nose tests are s…
AndroxxTraxxon May 2, 2023
d0d977d
Update test_task_rendering_for_with_items.py
AndroxxTraxxon May 2, 2023
97e3244
Update CHANGELOG.rst
AndroxxTraxxon Sep 20, 2023
e916994
Update CHANGELOG.rst
AndroxxTraxxon Sep 21, 2023
4cdefb6
Merge branch 'master' into master
AndroxxTraxxon Oct 10, 2023
5bb925b
Update tox.yml
AndroxxTraxxon Oct 10, 2023
15b4ee7
Update tox.yml
AndroxxTraxxon Oct 10, 2023
9836b06
Update requirements-ci.txt
AndroxxTraxxon Oct 10, 2023
7ba729d
Update tox.yml
AndroxxTraxxon Oct 10, 2023
1a70b40
replacing nose with pytest, testing python 3.8-3.11
AndroxxTraxxon Oct 10, 2023
015f618
correcting gitlab ci matrix
AndroxxTraxxon Oct 10, 2023
91106ff
tweak the pytest command
AndroxxTraxxon Oct 10, 2023
410b034
attempting python path patching for docs schema generation
AndroxxTraxxon Oct 10, 2023
abda276
switching to use development mode install for docs generation
AndroxxTraxxon Oct 10, 2023
e5917ae
applying formatting, attempting more path shenanigans to get docs wor…
AndroxxTraxxon Oct 10, 2023
f20280b
doing some cleanup for consistency
AndroxxTraxxon Oct 10, 2023
12ee053
re-add Python 3.6 to the test matrix for the patch release before dro…
AndroxxTraxxon Oct 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,23 @@ on:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.8"]
os: [ubuntu-latest, ubuntu-22.04, ubuntu-20.04]
exclude:
- python-version: "3.10"
os: ubuntu-20.04
- python-version: "3.6"
os: ubuntu-22.04
- python-version: "3.6"
os: ubuntu-latest
runs-on: ${{matrix.os}}
Copy link
Member

Choose a reason for hiding this comment

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

image

Because we're testing python and not OS at this level, from this build matrix, I think it makes sense to just have 1 environment for reach python version:

  • 3.6, ubuntu-20.04
  • 3.8, ubuntu-22.04

should simplify it a bit, unless you had specific reason to have a wider build matrix

Copy link
Member

Choose a reason for hiding this comment

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

Here https://github.com/StackStorm/orquesta/pull/256/files#diff-8a1944567ec5d9e12aaaac28489c47e6567e13b58d861815379f9b8d3aeb2623R15 the build was green by using ubuntu-20.04 environment for both py3.6 and py3.8.
Maybe that's the reason of so many unit test fails in this PR build? Worth checking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, those are some really useful points.

Copy link
Member

Choose a reason for hiding this comment

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

@AndroxxTraxxon The CI is fixed here #257 and is now ✅ on master, thanks to @amanda11 and @nzlosh.

Please sync your work with the master branch.

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
uses: actions/checkout@v3
- name: "Set up Python ${{ matrix.python-version }} on ${{matrix.os}}"
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
Expand All @@ -30,3 +38,4 @@ jobs:
- name: "Run tox for ${{ matrix.python-version }}"
run: |
tox

8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

In Development
--------------

Changed
~~~~~~~
* Update deprecated `collections` imports to `collections.abc`
AndroxxTraxxon marked this conversation as resolved.
Show resolved Hide resolved
Contributed by @AndroxxTraxxon

1.5.0
-----

Expand Down
6 changes: 3 additions & 3 deletions orquesta/expressions/functions/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import collections
import collections.abc

from orquesta import constants
from orquesta import exceptions as exc
Expand Down Expand Up @@ -117,8 +117,8 @@ def item_(context, key=None):
if not key:
return current_item

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

if key not in current_item:
raise exc.ExpressionEvaluationException('Item does not have key "%s".' % key)
Expand Down
4 changes: 2 additions & 2 deletions orquesta/specs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import collections
import collections.abc
import inspect
import json
import jsonschema
Expand Down Expand Up @@ -613,7 +613,7 @@ def update(self, *args, **kwargs):
raise NotImplementedError()


class SequenceSpec(Spec, collections.MutableSequence):
class SequenceSpec(Spec, collections.abc.MutableSequence):
def __init__(self, spec, name=None, member=False):
super(SequenceSpec, self).__init__(spec, name=name, member=member)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_bad_item_type(self):
"type": "error",
"message": (
"YaqlEvaluationException: Unable to evaluate expression '<% item(x) %>'. "
"ExpressionEvaluationException: Item is not type of collections.Mapping."
"ExpressionEvaluationException: Item is not type of collections.abc.Mapping."
),
"task_id": "task1",
"route": 0,
Expand Down
Loading