From abf556991521b2056d44bc0e1d8cde7762cbcd2d Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Thu, 5 Aug 2021 11:38:23 -0700 Subject: [PATCH] Add support for Python 3.10 (#795) --- .github/workflows/tests.yml | 43 ++++++++++++++++++++++--------------- asyncpg/pgproto | 2 +- setup.py | 3 ++- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e55e282b..9d5a3216 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} @@ -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 }} @@ -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 @@ -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 }} @@ -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 diff --git a/asyncpg/pgproto b/asyncpg/pgproto index 719c7c76..1720f8af 160000 --- a/asyncpg/pgproto +++ b/asyncpg/pgproto @@ -1 +1 @@ -Subproject commit 719c7c76ee92988f094c447bae18b47ab04a2185 +Subproject commit 1720f8af63725d79454884cfa787202a50eb5430 diff --git a/setup.py b/setup.py index 606620cd..3bdc97ab 100644 --- a/setup.py +++ b/setup.py @@ -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. @@ -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', ],