Skip to content

Commit

Permalink
drop Python 3.6, 3.7; add 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed Aug 14, 2023
1 parent d0cc2ce commit 265ade0
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 60 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,12 @@ jobs:
tox:
name: CI tests via Tox

runs-on: ubuntu-20.04 # 22.04 doesn't support Python 3.6
runs-on: ubuntu-22.04
strategy:
matrix:
py-ver-major: [3]
py-ver-minor: [6, 7, 8, 9, 10, 11]
py-ver-minor: [8, 9, 10, 11, 12]
step: [lint, unit, mypy]
exclude:
- py-ver-major: 3
py-ver-minor: 6
step: mypy
- py-ver-major: 3
py-ver-minor: 6
step: lint

env:
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
Expand All @@ -50,10 +43,12 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.py-semver }}
allow-prereleases: true
cache: pip
cache-dependency-path: |
requirements.txt
Expand Down Expand Up @@ -85,14 +80,14 @@ jobs:
tox-style:
name: CI linters via Tox

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
step: [lintreadme, pydocstyle]

env:
py-semver: "3.11"
py-semver: 3.11
TOXENV: ${{ format('py311-{0}', matrix.step) }}

steps:
Expand Down Expand Up @@ -144,7 +139,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11" # quoted, otherwise that turns into the number 3.1
python-version: 3.11
cache: pip
cache-dependency-path: |
requirements.txt
Expand Down
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ EXTRAS=
# `[[` conditional expressions.
PYSOURCES=$(wildcard cwlupgrader/**.py tests/*.py) setup.py
DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
isort wheel autoflake flake8-bugbear pyupgrade bandit build\
-rtest-requirements.txt -rmypy-requirements.txt
isort wheel autoflake flake8-bugbear pyupgrade bandit build \
auto-walrus -rtest-requirements.txt -rmypy-requirements.txt
DEBDEVPKGS=pylint python3-coverage sloccount \
python3-flake8 shellcheck
VERSION=1.2.8 # please also update setup.py
VERSION=2.0.0 # please also update setup.py

## all : default task (install cwl-upgrader in dev mode)
all: dev
Expand Down Expand Up @@ -160,22 +160,14 @@ list-author-emails:

mypy3: mypy
mypy: $(PYSOURCES)
if ! test -f $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))')/py.typed ; \
then \
rm -Rf mypy-stubs/ruamel/yaml ; \
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
mypy-stubs/ruamel/ ; \
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^

mypy_3.6: $(filter-out setup.py,$(PYSOURCES))
MYPYPATH=$$MYPYPATH:mypy-stubs mypy --python-version 3.6 $^

shellcheck: FORCE
shellcheck conformance-test.sh release-test.sh

pyupgrade: $(PYSOURCES)
pyupgrade --exit-zero-even-if-changed --py36-plus $^
pyupgrade --exit-zero-even-if-changed --py38-plus $^
auto-walrus $^

release-test: FORCE
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ See https://github.com/sbg/sevenbridges-cwl-draft2-upgrader for upgrading from `
It does not check for correctness of the input document, for that one can use
`the CWL reference implementation <https://github.com/common-workflow-language/cwltool>`_ (``cwltool --validate``).

This is written and tested for Python 3.6, 3.7, 3.8, 3.9, and 3.10.
This is written and tested for Python 3.8, 3.9, 3.10, 3.11, and 3.12.

Install
-------
Expand Down
13 changes: 5 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name="cwl-upgrader",
version="1.2.8",
version="2.0.0",
description="Common Workflow Language standalone document upgrader",
long_description=open(README).read(),
author="Common Workflow Language contributors",
Expand All @@ -27,14 +27,11 @@
package_data={"cwlupgrader.tests": ["../testdata/**/*.cwl"]},
install_requires=[
"setuptools",
"ruamel.yaml >= 0.16.0, < 0.18;python_version>='3.10'",
"ruamel.yaml >= 0.15.98, < 0.18;python_version>='3.9'",
"ruamel.yaml >= 0.15.78, < 0.18;python_version>='3.8'",
"ruamel.yaml >= 0.15.71, < 0.18",
"ruamel.yaml >= 0.16.0, < 0.18",
"schema_salad",
],
entry_points={"console_scripts": ["cwl-upgrader = cwlupgrader.main:main"]},
python_requires=">=3.6, <4",
python_requires=">=3.8, <4",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -45,11 +42,11 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"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",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
Expand Down
50 changes: 24 additions & 26 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tox]
envlist =
py{36,37,38,39,310,311}-lint,
py{36,37,38,39,310,311}-unit,
py3{8,9,10,11,12}-lint,
py3{8,9,10,11,12}-unit,

py{37,38,39,310,311}-mypy,
py39-lintreadme,
py39-pydocstyle
py3{8,9,10,11,12}-mypy,
py311-lintreadme,
py311-pydocstyle

skip_missing_interpreters = True

Expand All @@ -14,49 +14,47 @@ addopts=-n auto

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
description =
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}-mypy: Check for type safety
py3{8,9,10,11,12}-unit: Run the unit tests
py3{8,9,10,11,12}-lint: Lint the Python code
py3{8,9,10,11,12}-mypy: Check for type safety
py311-pydocstyle: docstring style checker
py311-lintreadme: Lint the README.rst->.md conversion

passenv =
CI
GITHUB_*
deps =
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}-mypy: -rmypy-requirements.txt
py3{8,9,10,11,12}-{unit,mypy}: -rrequirements.txt
py3{8,9,10,11,12}-{unit,mypy}: -rtest-requirements.txt
py3{8,9,10,11,12}-lint: flake8-bugbear
py3{8,9,10,11,12}-lint: black
py3{8,9,10,11,12}-mypy: -rmypy-requirements.txt

setenv =
py{36,37,38,39,310,311}-unit: LC_ALL = C.UTF-8
py3{8,9,10,11,12}-unit: LC_ALL = C.UTF-8

commands =
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{36,37,38,39,310,311}-lint: make flake8
py{36,37,38,39,310,311}-lint: make format-check
py{37,38,39,310,311}-mypy: make mypy
py3{8,9,10,11,12}-unit: python -m pip install -U pip setuptools wheel
py3{8,9,10,11,12}-unit: make coverage-report coverage.xml PYTEST_EXTRA="{posargs}"
py3{8,9,10,11,12}-lint: make flake8
py3{8,9,10,11,12}-lint: make format-check
py3{8,9,10,11,12}-mypy: make mypy

allowlist_externals =
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
py37-mypy: make mypy_3.6
py3{8,9,10,11,12}-lint: flake8
py3{8,9,10,11,12}-lint: black
py3{8,9,10,11,12}-{mypy,shellcheck,lint,unit}: make

skip_install =
py{36,37,38,39,310,311}-lint: true
py3{8,9,10,11,12}-lint: true

[testenv:py311-pydocstyle]
allowlist_externals = make
Expand Down

0 comments on commit 265ade0

Please sign in to comment.