From 5d6c79ffd44745bc770e69c6243d0265bdd00e37 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sun, 21 Aug 2022 15:00:24 +0200 Subject: [PATCH 1/2] CI: start testing Python 3.11 (no mypy for now) --- .github/workflows/ci-tests.yml | 6 +++- setup.py | 3 +- tox.ini | 59 +++++++++++++++++----------------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index b7abd1cdd..03ff3ff8e 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,8 +20,12 @@ jobs: strategy: matrix: py-ver-major: [3] - py-ver-minor: [6, 7, 8, 9, 10] + py-ver-minor: [6, 7, 8, 9, 10, 11] step: [lint, unit, mypy] + exclude: + - py-ver-major: 3 + py-ver-minor: 11 + step: mypy env: py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }} diff --git a/setup.py b/setup.py index d34b6365d..ab50856d0 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ "develop", "bdist_egg", "editable_wheel", + "test", ] ): mypyc_targets = [ @@ -117,7 +118,7 @@ download_url="https://github.com/common-workflow-language/schema_salad/releases", ext_modules=ext_modules, license="Apache 2.0", - python_requires=">=3.6,<3.11", + python_requires=">=3.6,<=3.11", setup_requires=pytest_runner + ["setuptools_scm"], packages=["schema_salad", "schema_salad.tests", "schema_salad.avro"], package_data={ diff --git a/tox.ini b/tox.ini index a771ed905..2d095c526 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,11 @@ [tox] envlist = - py{36,37,38,39,310}-lint, - py{36,37,38,39,310}-unit, - py{37,38,39,310}-bandit, + py{36,37,38,39,310,311}-lint, + py{36,37,38,39,310,311}-unit, + py{37,38,39,310,311}-bandit, py{36,37,38,39,310}-mypy, - py39-lintreadme, - py39-pydocstyle + py310-lintreadme, + py310-pydocstyle skip_missing_interpreters = True @@ -20,52 +20,53 @@ python = 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 [testenv] description = - py{36,37,38,39,310}-unit: Run the unit tests - py{36,37,38,39,310}-lint: Lint the Python code - py{37,38,39,310}-bandit: Search for common security issues + py{36,37,38,39,310,311}-unit: Run the unit tests + py{36,37,38,39,310,311}-lint: Lint the Python code + py{37,38,39,310,311}-bandit: Search for common security issues py{36,37,38,39,310}-mypy: Check for type safety - py39-pydocstyle: docstring style checker - py39-lintreadme: Lint the README.rst->.md conversion + py310-pydocstyle: docstring style checker + py310-lintreadme: Lint the README.rst->.md conversion passenv = CI GITHUB_* deps = - py{36,37,38,39,310}-{unit,mypy}: -rrequirements.txt - py{36,37,38,39,310}-{unit,mypy}: -rtest-requirements.txt - py{36,37,38,39,310}-lint: flake8-bugbear - py{36,37,38,39,310}-lint: black - py{37,38,39,310}-bandit: bandit + py{36,37,38,39,310,311}-{unit,mypy}: -rrequirements.txt + py{36,37,38,39,310,311}-{unit,mypy}: -rtest-requirements.txt + py{36,37,38,39,310,311}-lint: flake8-bugbear + py{36,37,38,39,310,311}-lint: black + py{37,38,39,310,311}-bandit: bandit py{36,37,38,39,310}-mypy: -rmypy-requirements.txt setenv = - py{36,37,38,39,310}-unit: LC_ALL = C.UTF-8 + py{36,37,38,39,310,311}-unit: LC_ALL = C.UTF-8 commands = - py{36,37,38,39,310}-unit: python -m pip install -U pip setuptools wheel - py{36,37,38,39,310}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs} - py{37,38,39,310}-bandit: bandit --recursive --exclude schema_salad/tests/ schema_salad - py{36,37,38,39,310}-lint: make flake8 - py{36,37,38,39,310}-lint: make format-check + py{36,37,38,39,310,311}-unit: python -m pip install -U pip setuptools wheel + py{36,37,38,39,310,311}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs} + py{37,38,39,310,311}-bandit: bandit --recursive --exclude schema_salad/tests/ schema_salad + py{36,37,38,39,310,311}-lint: make flake8 + py{36,37,38,39,310,311}-lint: make format-check py{36,37,38,39,310}-mypy: make mypy py{36,37,38,39,310}-mypy: make mypyc whitelist_externals = - py{36,37,38,39,310}-lint: flake8 - py{36,37,38,39,310}-lint: black - py{36,37,38,39,310}-{mypy,shellcheck,lint,unit}: make + py{36,37,38,39,310,311}-lint: flake8 + py{36,37,38,39,310,311}-lint: black + py{36,37,38,39,310,311}-{mypy,shellcheck,lint,unit}: make skip_install = - py{36,37,38,39,310}-lint: true - py{37,38,39,310}-bandit: true + py{36,37,38,39,310,311}-lint: true + py{37,38,39,310,311}-bandit: true extras = - py{36,37,38,39,310}-unit: pycodegen + py{36,37,38,39,310,311}-unit: pycodegen -[testenv:py39-pydocstyle] +[testenv:py310-pydocstyle] whitelist_externals = make commands = make diff_pydocstyle_report deps = @@ -73,7 +74,7 @@ deps = diff-cover skip_install = true -[testenv:py39-lintreadme] +[testenv:py310-lintreadme] description = Lint the README.rst->.md conversion commands = python setup.py sdist From b60d663efd65fc0e0b53d077230129bb3362c9fa Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Sun, 21 Aug 2022 15:49:22 +0200 Subject: [PATCH 2/2] CI: special case Python 3.11 --- .github/workflows/ci-tests.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 03ff3ff8e..6cd535943 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -35,10 +35,18 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python + if: matrix.py-ver-minor != 11 uses: actions/setup-python@v4 with: python-version: ${{ env.py-semver }} + - name: Set up Python 3.11.0-rc.1 + if: matrix.py-ver-minor == 11 + uses: actions/setup-python@v4 + with: + python-version: 3.11.0-rc.1 + + - name: Cache for pip uses: actions/cache@v3 with: