Skip to content

Commit

Permalink
Add support for Python 3.10 (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Aug 5, 2021
1 parent de07d0a commit abf5569
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@ jobs:
# job.
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-beta.4]
os: [ubuntu-latest, macos-latest, windows-latest]
loop: [asyncio, uvloop]
exclude:
# uvloop does not support Python 3.6
- loop: uvloop
python-version: 3.6
# uvloop does not support windows
- loop: uvloop
os: windows-latest

runs-on: ${{ matrix.os }}

Expand All @@ -27,23 +35,23 @@ jobs:
shell: bash

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 50
submodules: true

- name: Check if release PR.
uses: edgedb/action-release/validate-pr@master
continue-on-error: true
id: release
with:
github_token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
missing_version_ok: yes
version_file: asyncpg/_version.py
version_line_pattern: |
__version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"])
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
if: steps.release.outputs.version == 0
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -56,28 +64,29 @@ jobs:
- name: Install Python Deps
if: steps.release.outputs.version == 0
run: |
python -m pip install -U pip setuptools
pip install -e .[test]
python -m pip install -U pip setuptools wheel
python -m pip install -e .[test]
- name: Test
if: steps.release.outputs.version == 0
env:
LOOP_IMPL: ${{ matrix.loop }}
run: |
python setup.py test
- name: Test under uvloop
if: steps.release.outputs.version == 0 && matrix.os != 'windows-latest' && matrix.python-version != '3.9'
run: |
env USE_UVLOOP=1 python setup.py test
if [ "${LOOP_IMPL}" = "uvloop" ]; then
env USE_UVLOOP=1 python setup.py test
else
python setup.py test
fi
test-postgres:
strategy:
matrix:
postgres-version: [9.5, 9.6, 10, 11, 12, 13]

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 50
submodules: true
Expand All @@ -104,7 +113,7 @@ jobs:
>> "${GITHUB_ENV}"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
if: steps.release.outputs.version == 0
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -127,7 +136,7 @@ jobs:
regression-tests:
name: "Regression Tests"
needs: [test-platforms, test-postgres]
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- run: echo OK
2 changes: 1 addition & 1 deletion asyncpg/pgproto
Submodule pgproto updated 2 files
+8 −1 buffer.pyx
+1 −0 cpythonx.pxd
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# (example breakage: https://gitlab.com/pycqa/flake8/issues/427)
'pycodestyle~=2.5.0',
'flake8~=3.7.9',
'uvloop~=0.14.0;platform_system!="Windows"',
'uvloop>=0.15.3; platform_system != "Windows" and python_version >= "3.7"',
]

# Dependencies required to build documentation.
Expand Down Expand Up @@ -263,6 +263,7 @@ def finalize_options(self):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Database :: Front-Ends',
],
Expand Down

0 comments on commit abf5569

Please sign in to comment.