From 5fb85951c76abe392a3dc13474b06c2d58638c71 Mon Sep 17 00:00:00 2001 From: sinisaos Date: Fri, 24 Oct 2025 09:36:06 +0200 Subject: [PATCH 1/3] drop Python 3.9 and adds support for Python 3.14 --- .github/workflows/tests.yaml | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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", ], ) From 7f38f83956b83e52974bd66a7151742a2a6ea6ed Mon Sep 17 00:00:00 2001 From: sinisaos Date: Fri, 24 Oct 2025 12:22:27 +0200 Subject: [PATCH 2/3] trying to blindly solve the error by adding a RestrictViolationError because everything works locally --- piccolo_api/crud/exceptions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/piccolo_api/crud/exceptions.py b/piccolo_api/crud/exceptions.py index 42ccb9b..cd40f5f 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 RestrictViolationErro(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. From 5899d9f268f9dfb89a72832470f849f6146462f1 Mon Sep 17 00:00:00 2001 From: sinisaos Date: Fri, 24 Oct 2025 12:33:17 +0200 Subject: [PATCH 3/3] fix typo --- piccolo_api/crud/exceptions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/piccolo_api/crud/exceptions.py b/piccolo_api/crud/exceptions.py index cd40f5f..b66caf0 100644 --- a/piccolo_api/crud/exceptions.py +++ b/piccolo_api/crud/exceptions.py @@ -16,7 +16,7 @@ ) except ImportError: - class RestrictViolationErro(Exception): # type: ignore + class RestrictViolationError(Exception): # type: ignore pass class ForeignKeyViolationError(Exception): # type: ignore