Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build

on:
push:
branches: ['*']
pull_request:
branches:
- master
schedule:
# run every Monday at 6am
- cron: '0 6 * * 1'

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10"]
needs:
- tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Build wheel
run: |
make clean
make package
5 changes: 3 additions & 2 deletions .github/workflows/tox.yml → .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -29,4 +29,5 @@ jobs:
pip install -r requirements-ci.txt
make clean reqs schemas
- name: "Run tox for ${{ matrix.python-version }}"
run: make check
run: |
make check
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish

jobs:
publish:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10"]
needs:
- build
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: "Set up Python ${{ matrix.python-version }}"
uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"
- name: Publish wheel
run: |
echo "TODO: make publish"
6 changes: 5 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ Unreleased

Changed
~~~~~~~
* Dropped python3.6 support.
* Dropped support for python3.6 to 3.9.
Contributed by @nzlosh
* Use pip 24.0 in virtualenv
Contributed by @nzlosh
* Aligned pinned dependencies with St2 core.
Contributed by @nzlosh
* Replaced usage of imp module by importlib
Contributed by @nzlosh
* Added support for python3.10 to 3.12.
Contributed by @nzlosh

Fixed
~~~~~
Expand Down
55 changes: 34 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
SHELL = /bin/bash
OS_ID := $(shell source /etc/os-release; echo $ID)
# Major OS version is sufficient.
OS_VERSION := $(shell source /etc/os-release; echo ${VERSION_ID%.*})

PY3 := python3
# Rocky9 requires a newer python version than the default py3.9
ifeq ($(OS_ID),rocky)
ifeq ($(OS_VERSION),9)
PY3 := python3.11
endif
endif

SYS_PY3 := $(shell which $(PY3))
PIP_VERSION = 24.0
PIP_VERSION ?= 26.1.2
SETUPTOOLS_VERSION ?= 82.0.1

# Virtual Environment
VENV_DIR ?= .venv
Expand Down Expand Up @@ -55,48 +67,49 @@ venv:

.PHONY: reqs
reqs: venv check_virtualenv
echo Install pip version $(PIP_VERSION) to match st2 core.
$(VENV_DIR)/bin/pip install --upgrade "pip==$(PIP_VERSION)"
$(VENV_DIR)/bin/pip install -r requirements.txt
$(VENV_DIR)/bin/pip install -r requirements-test.txt
$(VENV_DIR)/bin/pip install -r requirements-docs.txt
$(VENV_DIR)/bin/pip install -r requirements-ci.txt
$(VENV_DIR)/bin/python setup.py develop
echo Install pip $(PIP_VERSION) and setuptools $(SETUPTOOLS_VERSION) to match st2 core.
$(VENV_DIR)/bin/$(PY3) -m pip install --upgrade "pip==$(PIP_VERSION)"
$(VENV_DIR)/bin/$(PY3) -m pip install --upgrade "setuptools==$(SETUPTOOLS_VERSION)"
$(VENV_DIR)/bin/$(PY3) -m pip install -r requirements.txt
$(VENV_DIR)/bin/$(PY3) -m pip install -r requirements-test.txt
$(VENV_DIR)/bin/$(PY3) -m pip install -r requirements-docs.txt
$(VENV_DIR)/bin/$(PY3) -m pip install -r requirements-ci.txt
$(VENV_DIR)/bin/$(PY3) -m pip install --editable .
echo

.PHONY: check_virtualenv
check_virtualenv:
test -d $(VENV_DIR) || exit 1
test -d "$(VENV_DIR)" || exit 1

.PHONY: schemas
schemas: check_virtualenv
$(VENV_DIR)/bin/$(PY3) bin/orquesta-generate-schemas
"$(VENV_DIR)/bin/$(PY3)" bin/orquesta-generate-schemas

.PHONY: format
format: check_virtualenv
$(VENV_DIR)/bin/black orquesta bin setup.py -l 100
"$(VENV_DIR)/bin/black" orquesta bin setup.py -l 100

.PHONY: check
check: check_virtualenv
$(VENV_DIR)/bin/tox
"$(VENV_DIR)/bin/tox"

.PHONY: docs
docs: reqs
rm -rf $(BUILDDIR)
. $(VENV_DIR)/bin/activate; $(SPHINXBUILD) -W -b html $(SOURCEDIR) $(BUILDDIR)/html
rm -rf "$(BUILDDIR)"
. "$(VENV_DIR)/bin/activate"; "$(SPHINXBUILD)" -W -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"

.PHONY: livedocs
livedocs: reqs
rm -rf $(BUILDDIR)
. $(VENV_DIR)/bin/activate; $(SPHINXAUTO) -H 0.0.0.0 -b html $(SOURCEDIR) $(BUILDDIR)/html
rm -rf "$(BUILDDIR)"
. "$(VENV_DIR)/bin/activate"; "$(SPHINXAUTO)" -H 0.0.0.0 -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"

.PHONY: package
package: check_virtualenv
rm -rf $(PKGDISTDIR)
rm -rf $(PKGBUILDDIR)
$(VENV_DIR)/bin/$(PY3) setup.py sdist bdist_wheel
package: reqs
rm -rf "$(PKGDISTDIR)"
rm -rf "$(PKGBUILDDIR)"
"$(VENV_DIR)/bin/$(PY3)" -m build --outdir "${PKGDISTDIR}"

.PHONY: publish
publish: package
$(VENV_DIR)/bin/$(PY3) -m twine upload dist/*
"$(VENV_DIR)/bin/$(PY3)" -m twine upload dist/*

6 changes: 3 additions & 3 deletions orquesta/tests/hacking/import_modules_rule.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 imp
import importlib
import inspect
import sys
import traceback
Expand Down Expand Up @@ -54,10 +54,10 @@ def check_is_module(mod, search_path=sys.path):

while "." in mod_name:
pack_name, _sep, mod_name = mod_name.partition(".")
f, p, d = imp.find_module(pack_name, search_path)
f, p, d = importlib.util.find_spec(pack_name, search_path)
search_path = [p]

imp.find_module(mod_name, search_path)
importlib.util.find_spec(mod_name, search_path)
except ImportError:
try:
# Handle namespace modules
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 The StackStorm Authors.
# Copyright 2021-2026 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -234,7 +234,7 @@ def test_empty_task_list(self):
expected_errors = {
"syntax": [
{
"message": "{} does not have enough properties",
"message": "{} should be non-empty",
"schema_path": "properties.tasks.minProperties",
"spec_path": "tasks",
}
Expand Down
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ pytest-cov==4.1.0
pep8==1.7.1
pylint==3.1.0
twine
build
# 202404: Use forked version for flake8 v7.0.0 to align requirements with st2 test-requirements
hacking @ git+https://github.com/nzlosh/hacking@flake8v7
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
chardet>=3.0.2
eventlet
jinja2>=2.11 # BSD License (3 clause)
jsonschema>=3,<4 # MIT
# networkx v3.2 and greater does not support Python3.8.
networkx>=2.6,<3.2
jsonschema==4.26.0
# networkx v3.5 and greater does not support Python3.10.
networkx>=2.6,<3.4
python-dateutil
pyyaml>=5.3.1 # MIT
six>=1.14.0
stevedore>=1.3.0 # Apache-2.0
ujson>=1.35 # BSD License
yaql>=1.1.0 # Apache-2.0
yaql>=3.2.0 # Apache-2.0
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ def get_requirements():
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
entry_points={
"orquesta.composers": [
Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[tox]
envlist = py38,py39,py310,py311,pep8,docs
envlist = py310,py311,py312,pep8,docs
minversion = 1.6
skipsdist = True

[gh-actions]
python =
3.8: py38,pep8,docs
3.9: py39
3.10: py310
3.10: py310,pep8,docs
3.11: py311
3.12: py312

[testenv]
usedevelop = True
Expand Down
Loading