From fba096c078bd401ea91c7f7b852f0954e253ffaa Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 20 Jun 2022 20:55:34 +0300 Subject: [PATCH] Add support for Python 3.11 and PyPy, drop EOL 3.6 --- .github/workflows/lint.yml | 6 ++++-- .github/workflows/test.yml | 12 ++++++++++-- .pre-commit-config.yaml | 13 +++++-------- pyproject.toml | 2 +- setup.py | 8 +++++--- tox.ini | 2 +- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 649ca66..c78a405 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,5 +8,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v2.0.3 + - uses: actions/setup-python@v4 + with: + python-version: "3.x" + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d456cea..e2a0973 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,14 +11,14 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["pypy-3.8", "3.7", "3.8", "3.9", "3.10", "3.11-dev"] os: [windows-latest, macos-latest, ubuntu-latest] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: pip @@ -39,3 +39,11 @@ jobs: with: flags: ${{ matrix.os }} name: ${{ matrix.os }} Python ${{ matrix.python-version }} + + success: + needs: test + runs-on: ubuntu-latest + name: test successful + steps: + - name: Success + run: echo Test successful diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c48486..6d2b15d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,18 +1,15 @@ repos: - repo: https://github.com/asottile/pyupgrade - rev: v2.32.0 + rev: v2.34.0 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: [--py37-plus] - repo: https://github.com/psf/black rev: 22.3.0 hooks: - id: black - args: ["--target-version", "py36"] - # override until resolved: https://github.com/psf/black/issues/402 - files: \.pyi?$ - types: [] + args: [--target-version=py37] - repo: https://github.com/PyCQA/isort rev: 5.10.1 @@ -31,7 +28,7 @@ repos: - id: python-check-blanket-noqa - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: check-merge-conflict - id: check-toml @@ -50,7 +47,7 @@ repos: - id: tox-ini-fmt - repo: https://github.com/pre-commit/mirrors-prettier - rev: v2.6.2 + rev: v2.7.1 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88] diff --git a/pyproject.toml b/pyproject.toml index 73ff2a7..a27c84d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -target_version = ["py36"] +target_version = ["py37"] [tool.isort] profile = "black" diff --git a/setup.py b/setup.py index 67900dd..ae761dd 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ long_description = f.read() -def local_scheme(version): +def local_scheme(version: str) -> str: """Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2) to be able to upload to Test PyPI""" return "" @@ -58,7 +58,7 @@ def local_scheme(version): use_scm_version={"local_scheme": local_scheme}, setup_requires=["setuptools_scm"], extras_require={"tests": ["pytest", "pytest-cov"]}, - python_requires=">=3.6", + python_requires=">=3.7", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -67,12 +67,14 @@ def local_scheme(version): "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 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Terminals", ], ) diff --git a/tox.ini b/tox.ini index 8ce41fd..db8dfdb 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = lint - py{310, 39, 38, 37, 36} + py{py3, 311, 310, 39, 38, 37} [testenv] passenv =