From c9d041de7cca539c84653d64a2c0977478f399f4 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Fri, 25 Oct 2024 18:23:52 +0200 Subject: [PATCH] CI: Validate on Python 3.6+ You never know how you possibly save someone's life with that. --- .github/workflows/test.yaml | 41 +++++++++++++++++++++++++++++++++---- setup.py | 14 ++++++++++--- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 20a1b84e..acc7db31 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -19,12 +19,16 @@ jobs: fail-fast: false matrix: os: [ - "ubuntu-latest", + "ubuntu-20.04", "macos-12", "macos-latest", "windows-latest", ] python-version: [ + "3.6", + "3.7", + "3.8", + "3.9", "3.10", "3.11", "3.12", @@ -32,11 +36,40 @@ jobs: "pypy3.10", ] + exclude: + + # Exclude test matrix slots that are no longer supported by GHA runners. + - os: 'macos-latest' + python-version: '3.6' + - os: 'macos-latest' + python-version: '3.7' + + # Exclude Python 3.7 on Windows, because GHA fails on it. + # + # SyntaxError: Non-UTF-8 code starting with '\x83' in file + # C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts\poe.exe + # on line 2, but no encoding declared; + # see http://python.org/dev/peps/pep-0263/ for details + # + # https://github.com/kennethreitz/responder/actions/runs/11526258626/job/32090071392?pr=546#step:6:73 + - os: 'windows-latest' + python-version: '3.7' + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - uses: yezz123/setup-uv@v4 - - run: uv pip install --editable '.[graphql,develop,test]' --system - - run: poe check + + - name: Install package and run software tests (Python 3.6) + if: matrix.python-version == '3.6' + run: | + pip install '.[graphql,develop,test]' + poe test + + - name: Install and completely validate package (Python >=3.6) + if: matrix.python-version != '3.6' + run: | + uv pip install '.[graphql,develop,test]' --system + poe check diff --git a/setup.py b/setup.py index c672a3aa..c22d3b5d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,6 @@ "aiofiles", "apispec>=1.0.0b1", "chardet", - "docopt-ng", "marshmallow", "requests", "requests-toolbelt", @@ -76,11 +75,16 @@ def run(self): url="https://github.com/kennethreitz/responder", packages=find_packages(exclude=["tests"]), package_data={}, - python_requires=">=3.10", + python_requires=">=3.6", setup_requires=[], install_requires=required, extras_require={ - "develop": ["poethepoet", "pyproject-fmt", "ruff", "validate-pyproject"], + "develop": [ + "poethepoet", + "pyproject-fmt; python_version>='3.7'", + "ruff; python_version>='3.7'", + "validate-pyproject", + ], "graphql": ["graphene"], "release": ["build", "twine"], "test": ["pytest", "pytest-cov", "pytest-mock", "flask"], @@ -95,6 +99,10 @@ def run(self): "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",