Skip to content

Commit

Permalink
Merge branch 'master' into inspect-performance-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
guzzijones authored Feb 8, 2024
2 parents 2cd3065 + 08c41ed commit 61148cd
Show file tree
Hide file tree
Showing 20 changed files with 158 additions and 70 deletions.
3 changes: 1 addition & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ exclude_lines =
if __name__ == .__main__.:

ignore_errors = True
omit = orquesta/tests/*

omit =
tests/*
14 changes: 7 additions & 7 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ on:

jobs:
tests:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.8"]
python-version: ["3.6", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
pip install -r requirements-ci.txt
make clean reqs schemas
- name: "Run tox for ${{ matrix.python-version }}"
run: |
tox
run: make check
21 changes: 21 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
Changelog
=========

1.6.0
-----

Changed
~~~~~~~

* Update deprecated `collections` imports to `collections.abc` to be forward-compatible with Python3.10
Contributed by @AndroxxTraxxon
* Migrate from `nosetest` to `pytest` for Python test runner.
Contributed by @AndroxxTraxxon
* Add Python versions 3.9, 3.10, and 3.11 to the test matrix
Contributed by @AndroxxTraxxon

Fixed
~~~~~

* Update networkx >=2.6 for Python 3.8 to fix insecure deserialization #255 (security fix)
Contributed by @Stealthii
* Update jsonschema requirements to allow 3.2 (security fix)
Contributed by @james-bellamy

1.5.0
-----

Expand Down
51 changes: 25 additions & 26 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

# -- Project information -----------------------------------------------------

project = u'StackStorm Orquesta'
copyright = u'2018, StackStorm'
author = u'StackStorm'
project = "StackStorm Orquesta"
copyright = "2018-2023, StackStorm"
author = "StackStorm"

# The short X.Y version
version = u''
version = ""
# The full version, including alpha/beta/rc tags
release = u''
release = ""


# -- General configuration ---------------------------------------------------
Expand All @@ -40,43 +40,43 @@
# ones.
extensions = [
# Add theme as extension so sitemap.xml is generated
'sphinx_rtd_theme'
"sphinx_rtd_theme"
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
exclude_patterns = []

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -87,7 +87,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -103,7 +103,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Orquestadoc'
htmlhelp_basename = "Orquestadoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -112,15 +112,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -130,19 +127,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Orquesta.tex', u'Orquesta Documentation',
u'StackStorm', 'manual'),
(master_doc, "Orquesta.tex", "Orquesta Documentation", "StackStorm", "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'orquesta', u'Orquesta Documentation',
[author], 1)
]
man_pages = [(master_doc, "orquesta", "Orquesta Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -151,7 +144,13 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Orquesta', u'Orquesta Documentation',
author, 'Orquesta', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Orquesta",
"Orquesta Documentation",
author,
"Orquesta",
"One line description of project.",
"Miscellaneous",
),
]
2 changes: 1 addition & 1 deletion orquesta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = "1.5.0"
__version__ = "1.6.0"
4 changes: 3 additions & 1 deletion orquesta/conducting.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ def log_entry(
result=None,
data=None,
):

# Check entry type.
if entry_type not in ["info", "warn", "error"]:
raise exc.WorkflowLogEntryError('The log entry type "%s" is not valid.' % entry_type)
Expand Down Expand Up @@ -629,6 +628,9 @@ def _evaluate_task_actions(self, task):
active_items = list(filter(lambda x: x[1]["status"] in statuses.ACTIVE_STATUSES, all_items))

if task["concurrency"] is not None:
# Concurrency below 1 prevents scheduling of tasks.
if task["concurrency"] <= 0:
task["concurrency"] = 1
availability = task["concurrency"] - len(active_items)
candidates = list(zip(*notrun_items[:availability]))
task["actions"] = list(candidates[0]) if candidates and availability > 0 else []
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
2 changes: 0 additions & 2 deletions orquesta/tests/hacking/import_aliases_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@


def get_alias(logical_line):

parts = logical_line.split()

if (
Expand All @@ -68,7 +67,6 @@ def get_alias(logical_line):
and parts[1] != "__future__"
and not core.is_import_exception(parts[1])
):

# from path.to.module import module
if len(parts) == 4:
return ".".join([parts[1], parts[3]]), None
Expand Down
2 changes: 0 additions & 2 deletions orquesta/tests/unit/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ def format_task_item(
items_count=None,
items_concurrency=None,
):

if not actions and items_count is None:
actions = [{"action": spec.action, "input": spec.input}]

Expand Down Expand Up @@ -285,7 +284,6 @@ def assert_task_items(
concurrency=None,
mock_ac_ex_results=None,
):

# Set up test cases.
tests = list(zip(mock_ac_ex_statuses, expected_task_statuses, expected_workflow_statuses))
tk_ex_result = [None] * len(items)
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


class WorkflowConductorDataFlowTest(test_base.WorkflowConductorTest):

wf_def_yaql = """
version: 1.0
Expand Down Expand Up @@ -157,14 +156,14 @@ def assert_data_flow(self, input_value):

def assert_unicode_data_flow(self, input_value):
inputs = {
u"a1": (
"a1": (
str_util.unicode(input_value, encoding_type="utf-8", force=True)
if six.PY2
else input_value
)
}

expected_output = {u"a5": inputs["a1"], u"b5": inputs["a1"]}
expected_output = {"a5": inputs["a1"], "b5": inputs["a1"]}

self._assert_data_flow(inputs, expected_output)

Expand Down
Loading

0 comments on commit 61148cd

Please sign in to comment.