From c2aee6970f02cfe1370d2105615fe0f261b96a56 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Wed, 26 Oct 2022 12:39:45 -0700 Subject: [PATCH] Test on Python 3.11 and PostgreSQL 15, fix workflow deprecations --- .github/workflows/release.yml | 28 ++++++++++++++-------------- .github/workflows/tests.yml | 12 ++++++------ README.rst | 2 +- docs/index.rst | 2 +- tests/test_connect.py | 4 +++- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01b97a84..7f89128e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: mkdir -p dist/ echo "${VERSION}" > dist/VERSION - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: dist path: dist/ @@ -50,7 +50,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 50 submodules: true @@ -63,7 +63,7 @@ jobs: pip install -U setuptools wheel pip python setup.py sdist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: dist path: dist/*.tar.* @@ -74,7 +74,7 @@ jobs: outputs: include: ${{ steps.set-matrix.outputs.include }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v4 - run: pip install cibuildwheel==2.10.2 - id: set-matrix @@ -86,7 +86,7 @@ jobs: && cibuildwheel --print-build-identifiers --platform windows --arch x86,AMD64 | grep cp | jq -Rc '{"only": inputs, "os": "windows-latest"}' } | jq -sc ) - echo ::set-output name=include::"$MATRIX_INCLUDE" + echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT build-wheels: needs: build-wheels-matrix @@ -106,11 +106,11 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 50 submodules: true - + - name: Set up QEMU if: runner.os == 'Linux' uses: docker/setup-qemu-action@v2 @@ -123,7 +123,7 @@ jobs: CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: name: dist path: wheelhouse/*.whl @@ -137,7 +137,7 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 5 submodules: true @@ -153,7 +153,7 @@ jobs: make htmldocs - name: Checkout gh-pages - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 5 ref: gh-pages @@ -179,12 +179,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 5 submodules: false - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: dist path: dist/ @@ -193,7 +193,7 @@ jobs: id: relver run: | set -e - echo ::set-output name=version::$(cat dist/VERSION) + echo "version=$(cat dist/VERSION)" >> $GITHUB_OUTPUT rm dist/VERSION - name: Merge and tag the PR @@ -219,7 +219,7 @@ jobs: ls -al dist/ - name: Upload to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f451cff8..f2340b5c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: # job. strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11.0-rc.2"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest, macos-latest, windows-latest] loop: [asyncio, uvloop] exclude: @@ -35,7 +35,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 50 submodules: true @@ -51,7 +51,7 @@ jobs: __version__\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 if: steps.release.outputs.version == 0 with: python-version: ${{ matrix.python-version }} @@ -76,7 +76,7 @@ jobs: test-postgres: strategy: matrix: - postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14"] + postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15"] runs-on: ubuntu-latest @@ -84,7 +84,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 50 submodules: true @@ -111,7 +111,7 @@ jobs: >> "${GITHUB_ENV}" - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 if: steps.release.outputs.version == 0 - name: Install Python Deps diff --git a/README.rst b/README.rst index 01a28c00..e5212156 100644 --- a/README.rst +++ b/README.rst @@ -14,7 +14,7 @@ framework. You can read more about asyncpg in an introductory `blog post `_. asyncpg requires Python 3.7 or later and is supported for PostgreSQL -versions 9.5 to 14. Older PostgreSQL versions or other databases implementing +versions 9.5 to 15. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. diff --git a/docs/index.rst b/docs/index.rst index ee9f85d4..93671abc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,7 +15,7 @@ of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. **asyncpg** requires Python 3.7 or later and is supported for PostgreSQL -versions 9.5 to 14. Older PostgreSQL versions or other databases implementing +versions 9.5 to 15. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Contents diff --git a/tests/test_connect.py b/tests/test_connect.py index c8da7e29..4903fc03 100644 --- a/tests/test_connect.py +++ b/tests/test_connect.py @@ -1287,6 +1287,7 @@ def setUp(self): create_script = [] create_script.append('CREATE ROLE ssl_user WITH LOGIN;') + create_script.append('GRANT ALL ON SCHEMA public TO ssl_user;') self._add_hba_entry() @@ -1301,6 +1302,7 @@ def tearDown(self): self.cluster.trust_local_connections() drop_script = [] + drop_script.append('REVOKE ALL ON SCHEMA public FROM ssl_user;') drop_script.append('DROP ROLE ssl_user;') drop_script = '\n'.join(drop_script) self.loop.run_until_complete(self.con.execute(drop_script)) @@ -1461,7 +1463,7 @@ async def test_executemany_uvloop_ssl_issue_700(self): ) finally: try: - await con.execute('DROP TABLE test_many') + await con.execute('DROP TABLE IF EXISTS test_many') finally: await con.close()