From df8b14ccb815a7276d6a3879d844552949b7665c Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Sun, 8 Oct 2023 14:42:29 -0700 Subject: [PATCH] Test on Python 3.12 and PostgreSQL 16 --- .github/workflows/release.yml | 16 ++++++++-------- .github/workflows/tests.yml | 11 +++++++---- README.rst | 2 +- asyncpg/exceptions/__init__.py | 5 +++++ docs/index.rst | 2 +- pyproject.toml | 7 ++++--- 6 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a294f9c3..52daf01a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,7 +50,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 submodules: true @@ -76,11 +76,11 @@ jobs: outputs: include: ${{ steps.set-matrix.outputs.include }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: "3.x" - - run: pip install cibuildwheel==2.13.1 + - run: pip install cibuildwheel==2.16.2 - id: set-matrix run: | MATRIX_INCLUDE=$( @@ -109,7 +109,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 submodules: true @@ -118,7 +118,7 @@ jobs: if: runner.os == 'Linux' uses: docker/setup-qemu-action@v2 - - uses: pypa/cibuildwheel@v2.13.1 + - uses: pypa/cibuildwheel@fff9ec32ed25a9c576750c91e06b410ed0c15db7 # v2.16.2 with: only: ${{ matrix.only }} env: @@ -138,7 +138,7 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 5 submodules: true @@ -154,7 +154,7 @@ jobs: make htmldocs - name: Checkout gh-pages - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 5 ref: gh-pages @@ -180,7 +180,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 5 submodules: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c069709..7fc77b38 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,13 +17,16 @@ jobs: # job. strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, macos-latest, windows-latest] loop: [asyncio, uvloop] exclude: # uvloop does not support windows - loop: uvloop os: windows-latest + # No 3.12 release yet + - loop: uvloop + python-version: "3.12" runs-on: ${{ matrix.os }} @@ -35,7 +38,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 submodules: true @@ -76,7 +79,7 @@ jobs: test-postgres: strategy: matrix: - postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15"] + postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15", "16"] runs-on: ubuntu-latest @@ -84,7 +87,7 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 50 submodules: true diff --git a/README.rst b/README.rst index ef2678db..438b4c44 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.8 or later and is supported for PostgreSQL -versions 9.5 to 15. Older PostgreSQL versions or other databases implementing +versions 9.5 to 16. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. diff --git a/asyncpg/exceptions/__init__.py b/asyncpg/exceptions/__init__.py index c5b5ccc4..8c97d5a0 100644 --- a/asyncpg/exceptions/__init__.py +++ b/asyncpg/exceptions/__init__.py @@ -397,6 +397,10 @@ class SQLJsonScalarRequiredError(DataError): sqlstate = '2203F' +class SQLJsonItemCannotBeCastToTargetTypeError(DataError): + sqlstate = '2203G' + + class IntegrityConstraintViolationError(_base.PostgresError): sqlstate = '23000' @@ -1163,6 +1167,7 @@ class IndexCorruptedError(InternalServerError): 'ReadingExternalRoutineSQLDataNotPermittedError', 'ReadingSQLDataNotPermittedError', 'ReservedNameError', 'RestrictViolationError', 'SQLJsonArrayNotFoundError', + 'SQLJsonItemCannotBeCastToTargetTypeError', 'SQLJsonMemberNotFoundError', 'SQLJsonNumberNotFoundError', 'SQLJsonObjectNotFoundError', 'SQLJsonScalarRequiredError', 'SQLRoutineError', 'SQLStatementNotYetCompleteError', diff --git a/docs/index.rst b/docs/index.rst index dd4768b4..02a8457d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ of PostgreSQL server binary protocol for use with Python's ``asyncio`` framework. **asyncpg** requires Python 3.8 or later and is supported for PostgreSQL -versions 9.5 to 15. Older PostgreSQL versions or other databases implementing +versions 9.5 to 16. Older PostgreSQL versions or other databases implementing the PostgreSQL protocol *may* work, but are not being actively tested. Contents diff --git a/pyproject.toml b/pyproject.toml index c9e4bdd9..72812da1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Database :: Front-Ends", ] @@ -32,8 +33,8 @@ github = "https://github.com/MagicStack/asyncpg" [project.optional-dependencies] test = [ - 'flake8~=5.0', - 'uvloop>=0.15.3; platform_system != "Windows"', + 'flake8~=6.1', + 'uvloop>=0.15.3; platform_system != "Windows" and python_version < "3.12.0"', ] docs = [ 'Sphinx~=5.3.0', @@ -46,7 +47,7 @@ requires = [ "setuptools>=60", "wheel", - "Cython(>=0.29.24,<0.30.0)" + "Cython(>=0.29.24,<3.0.0)" ] build-backend = "setuptools.build_meta"