Skip to content

Commit 489630d

Browse files
authored
drop Python 3.9 and adds support for Python 3.14 (#317)
* drop Python 3.9 and adds support for Python 3.14 * trying to blindly solve the error by adding a RestrictViolationError because everything works locally * fix typo
1 parent fee5d97 commit 489630d

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
runs-on: ubuntu-latest
3232
strategy:
3333
matrix:
34-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3535

3636
# Service containers to run with `container-job`
3737
services:
@@ -78,7 +78,7 @@ jobs:
7878
runs-on: ubuntu-latest
7979
strategy:
8080
matrix:
81-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
81+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
8282

8383
steps:
8484
- uses: actions/checkout@v4

piccolo_api/crud/exceptions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
from asyncpg.exceptions import (
1212
ForeignKeyViolationError,
1313
NotNullViolationError,
14+
RestrictViolationError,
1415
UniqueViolationError,
1516
)
1617
except ImportError:
1718

19+
class RestrictViolationError(Exception): # type: ignore
20+
pass
21+
1822
class ForeignKeyViolationError(Exception): # type: ignore
1923
pass
2024

@@ -82,7 +86,7 @@ async def inner(*args, **kwargs):
8286
},
8387
status_code=422,
8488
)
85-
except ForeignKeyViolationError as exception:
89+
except (ForeignKeyViolationError, RestrictViolationError) as exception:
8690
# This is raised when we have an `ON DELETE RESTRICT` constraint
8791
# on a foreign key, which prevents us from deleting a row if it's
8892
# referenced by a foreign key.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def extras_require() -> dict[str, list[str]]:
6868
long_description_content_type="text/markdown",
6969
author="Daniel Townsend",
7070
author_email="[email protected]",
71-
python_requires=">=3.9.0",
71+
python_requires=">=3.10.0",
7272
url="https://github.com/piccolo-orm/piccolo_api",
7373
packages=find_packages(exclude=("tests",)),
7474
package_data={
@@ -84,11 +84,11 @@ def extras_require() -> dict[str, list[str]]:
8484
"License :: OSI Approved :: MIT License",
8585
"Programming Language :: Python",
8686
"Programming Language :: Python :: 3",
87-
"Programming Language :: Python :: 3.9",
8887
"Programming Language :: Python :: 3.10",
8988
"Programming Language :: Python :: 3.11",
9089
"Programming Language :: Python :: 3.12",
9190
"Programming Language :: Python :: 3.13",
91+
"Programming Language :: Python :: 3.14",
9292
"Programming Language :: Python :: Implementation :: CPython",
9393
],
9494
)

0 commit comments

Comments
 (0)