Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.10 tests #102

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
---
name: Tests
on: [push]
on: [push, pull_request]
jobs:
linux-tests:
name: Python ${{matrix.python-version}} tests on Linux
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10.0-beta - 3.10", "pypy3"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can specify "3.10" here, and then, on setting up python, you can go selective:

      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
        if: ${{ matrix.python-version != '3.10' }}

      - uses: actions/setup-python@v2
        with:
          python-version: "3.10.0-alpha - 3.10.0"
        if: ${{ matrix.python-version == '3.10' }}

You could even rename python-version to python. Less typing :)


steps:
- name: Checkout repos
uses: actions/checkout@v2

- name: Set up Python
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python-version}}
architecture: x64

- name: Install Tox
run: pip install tox
run: pip install tox tox-gh-actions
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is not necessary. Please organise the test suite as it is done in psycopg:


- name: Run tests
run: tox -e ${{matrix.python-version}} -- -vrsx --color=yes
run: tox -- -vrsx --color=yes

windows-tests:
name: Python ${{matrix.python-version}} tests on Windows ${{matrix.architecture}}
runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
architecture: ['x64', 'x86']
python-version: [3.6, 3.7, 3.8, 3.9, "3.10.0-beta - 3.10"]
architecture: ["x64", "x86"]

steps:
- name: Checkout repos
Expand All @@ -44,7 +44,7 @@ jobs:
architecture: ${{matrix.architecture}}

- name: Install Tox
run: pip install tox
run: pip install tox tox-gh-actions

- name: Run tests
run: tox -e ${{matrix.python-version}} -- -vrsx --color=yes
run: tox -- -vrsx --color=yes
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Operating System :: POSIX :: Linux
Operating System :: POSIX :: BSD
Operating System :: MacOS :: MacOS X
Expand All @@ -94,6 +95,6 @@
python_requires=">=3.6",
classifiers=classifiers,
ext_modules=[mod_spt],
extras_require={"test": ["pytest>=6.1,<6.2"]},
extras_require={"test": ["pytest>=6.2.5,<6.3"]},
**kwargs
)
21 changes: 16 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
[gh-actions]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for sure, as it runs in psycopg test suite:

[tox]
envlist = {3.6,3.7,3.8,3.9,3.10}
isolated_build = True

[testenv]
commands =
    pytest {posargs}
extras = test

gh-actions is not necessary.

python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
3.10: py310

[tox]
envlist = 3.6, 3.7, 3.8, 3.9, pypy3
envlist = py36, py37, py38, py39, py310, pypy3

[testenv]
commands =
pytest {posargs}
extras =
test

[testenv:3.6]
[testenv:py36]
basepython = python3.6

[testenv:3.7]
[testenv:py37]
basepython = python3.7

[testenv:3.8]
[testenv:py38]
basepython = python3.8

[testenv:3.9]
[testenv:py39]
basepython = python3.9

[testenv:py310]
basepython = python3.10