diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e7fea6c..f039f83 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] # Service containers to run with `container-job` services: @@ -78,7 +78,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 diff --git a/piccolo_api/crud/exceptions.py b/piccolo_api/crud/exceptions.py index 42ccb9b..b66caf0 100644 --- a/piccolo_api/crud/exceptions.py +++ b/piccolo_api/crud/exceptions.py @@ -11,10 +11,14 @@ from asyncpg.exceptions import ( ForeignKeyViolationError, NotNullViolationError, + RestrictViolationError, UniqueViolationError, ) except ImportError: + class RestrictViolationError(Exception): # type: ignore + pass + class ForeignKeyViolationError(Exception): # type: ignore pass @@ -82,7 +86,7 @@ async def inner(*args, **kwargs): }, status_code=422, ) - except ForeignKeyViolationError as exception: + except (ForeignKeyViolationError, RestrictViolationError) as exception: # This is raised when we have an `ON DELETE RESTRICT` constraint # on a foreign key, which prevents us from deleting a row if it's # referenced by a foreign key. diff --git a/setup.py b/setup.py index 8aa7e28..5528c59 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ def extras_require() -> dict[str, list[str]]: long_description_content_type="text/markdown", author="Daniel Townsend", author_email="dan@dantownsend.co.uk", - python_requires=">=3.9.0", + python_requires=">=3.10.0", url="https://github.com/piccolo-orm/piccolo_api", packages=find_packages(exclude=("tests",)), package_data={ @@ -84,11 +84,11 @@ def extras_require() -> dict[str, list[str]]: "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", ], )