Skip to content

Commit ac4891f

Browse files
committed
Add support for Python 3.14, drop for Python 3.9
1 parent 51d2352 commit ac4891f

15 files changed

Lines changed: 69 additions & 68 deletions

.github/workflows/dockerised-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
python-versions:
77
description: 'Supported python versions'
8-
default: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
8+
default: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
99
required: false
1010
type: string
1111
postgresql:

.github/workflows/oldest-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
python-versions:
77
description: 'Supported python versions'
8-
default: '["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]'
8+
default: '["3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.11"]'
99
required: false
1010
type: string
1111
postgresql:

.github/workflows/single-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
inputs:
66
python-versions:
77
description: 'Supported python versions'
8-
default: '["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]'
8+
default: '["3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.11"]'
99
required: false
1010
type: string
1111
postgresql:

.github/workflows/tests.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,46 +19,46 @@ jobs:
1919
uses: ./.github/workflows/single-postgres.yml
2020
with:
2121
postgresql: 16
22-
python-versions: '["3.10", "3.11", "3.12", "3.13", "pypy-3.10"]'
22+
python-versions: '["3.11", "3.12", "3.13", "3.14", "pypy-3.11"]'
2323
postgresql_15:
2424
needs: [postgresql_16]
2525
uses: ./.github/workflows/single-postgres.yml
2626
with:
2727
postgresql: 15
28-
python-versions: '["3.11", "3.12", "3.13"]'
28+
python-versions: '["3.12", "3.13", "3.14"]'
2929
postgresql_14:
3030
needs: [postgresql_15]
3131
uses: ./.github/workflows/single-postgres.yml
3232
with:
3333
postgresql: 14
34-
python-versions: '["3.13"]'
34+
python-versions: '["3.14"]'
3535
postgresql_13:
3636
needs: [postgresql_14]
3737
uses: ./.github/workflows/single-postgres.yml
3838
with:
3939
postgresql: 13
40-
python-versions: '["3.13"]'
40+
python-versions: '["3.14"]'
4141
macos_postgres_17:
4242
needs: [postgresql_17]
4343
uses: ./.github/workflows/single-postgres.yml
4444
with:
4545
postgresql: 17
4646
os: macos-latest
47-
python-versions: '["3.11", "3.12", "3.13"]'
47+
python-versions: '["3.12", "3.13", "3.14"]'
4848
macos_postgres_16:
4949
needs: [postgresql_16, macos_postgres_17]
5050
uses: ./.github/workflows/single-postgres.yml
5151
with:
5252
postgresql: 16
5353
os: macos-latest
54-
python-versions: '["3.11", "3.12", "3.13"]'
54+
python-versions: '["3.12", "3.13", "3.14"]'
5555
macos_postgres_15:
5656
needs: [postgresql_15, macos_postgres_16]
5757
uses: ./.github/workflows/single-postgres.yml
5858
with:
5959
postgresql: 15
6060
os: macos-latest
61-
python-versions: '["3.12", "3.13"]'
61+
python-versions: '["3.13", "3.14"]'
6262
docker_postgresql_17:
6363
needs: [postgresql_17]
6464
uses: ./.github/workflows/dockerised-postgres.yml
@@ -69,22 +69,22 @@ jobs:
6969
uses: ./.github/workflows/dockerised-postgres.yml
7070
with:
7171
postgresql: 16
72-
python-versions: '["3.10", "3.11", "3.12", "3.13"]'
72+
python-versions: '["3.11", "3.12", "3.13", "3.14"]'
7373
docker_postgresql_15:
7474
needs: [postgresql_15, docker_postgresql_17]
7575
uses: ./.github/workflows/dockerised-postgres.yml
7676
with:
7777
postgresql: 15
78-
python-versions: '["3.11", "3.12", "3.13"]'
78+
python-versions: '["3.12", "3.13", "3.14"]'
7979
docker_postgresql_14:
8080
needs: [postgresql_14, docker_postgresql_15]
8181
uses: ./.github/workflows/dockerised-postgres.yml
8282
with:
8383
postgresql: 14
84-
python-versions: '["3.12", "3.13"]'
84+
python-versions: '["3.13", "3.14"]'
8585
docker_postgresql_13:
8686
needs: [postgresql_13, docker_postgresql_14]
8787
uses: ./.github/workflows/dockerised-postgres.yml
8888
with:
8989
postgresql: 13
90-
python-versions: '["3.13"]'
90+
python-versions: '["3.14"]'

newsfragments/+6028688d.break.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Dropped support for Python 3.9 as it has reached End of Life
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Marked support for Python 3.14

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ classifiers = [
1717
"Operating System :: OS Independent",
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
2423
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
2525
"Programming Language :: Python :: 3 :: Only",
2626
"Topic :: Software Development :: Libraries :: Python Modules",
2727
"Topic :: Software Development :: Testing",
@@ -34,7 +34,7 @@ dependencies = [
3434
"packaging",
3535
"psycopg >= 3.0.0"
3636
]
37-
requires-python = ">= 3.9"
37+
requires-python = ">= 3.10"
3838

3939
[project.urls]
4040
"Source" = "https://github.com/dbfixtures/pytest-postgresql"
@@ -65,7 +65,7 @@ norecursedirs = "examples"
6565

6666
[tool.black]
6767
line-length = 100
68-
target-version = ['py39']
68+
target-version = ['py310']
6969
include = '.*\.pyi?$'
7070

7171
[tool.ruff]

pytest_postgresql/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Plugin's configuration."""
22

33
from pathlib import Path
4-
from typing import Any, List, Optional, TypedDict, Union
4+
from typing import Any, TypedDict
55

66
from _pytest._py.path import LocalPath
77
from pytest import FixtureRequest
@@ -12,15 +12,15 @@ class PostgresqlConfigDict(TypedDict):
1212

1313
exec: str
1414
host: str
15-
port: Optional[str]
15+
port: str | None
1616
port_search_count: int
1717
user: str
1818
password: str
1919
options: str
2020
startparams: str
2121
unixsocketdir: str
2222
dbname: str
23-
load: List[Union[Path, str]]
23+
load: list[Path | str]
2424
postgres_options: str
2525
drop_test_database: bool
2626

@@ -52,9 +52,9 @@ def get_postgresql_option(option: str) -> Any:
5252
)
5353

5454

55-
def detect_paths(load_paths: List[Union[LocalPath, str]]) -> List[Union[Path, str]]:
55+
def detect_paths(load_paths: list[LocalPath | str]) -> list[Path | str]:
5656
"""Convert path to sql files to Path instances."""
57-
converted_load_paths: List[Union[Path, str]] = []
57+
converted_load_paths: list[Path | str] = []
5858
for path in load_paths:
5959
if isinstance(path, LocalPath):
6060
path = str(path)

pytest_postgresql/executor_noop.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with pytest-postgresql. If not, see <http://www.gnu.org/licenses/>.
1818
"""PostgreSQL Noop executor providing connection details for postgres client."""
19-
from typing import Any, Optional, Union
19+
from typing import Any
2020

2121
import psycopg
2222
from packaging.version import parse
@@ -33,11 +33,11 @@ class NoopExecutor:
3333
def __init__(
3434
self,
3535
host: str,
36-
port: Union[str, int],
36+
port: str | int,
3737
user: str,
3838
options: str,
3939
dbname: str,
40-
password: Optional[str] = None,
40+
password: str | None = None,
4141
):
4242
"""Initialize nooperator executor mock.
4343

pytest_postgresql/factories/client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with pytest-postgresql. If not, see <http://www.gnu.org/licenses/>.
1818
"""Fixture factory for postgresql client."""
19-
from typing import Callable, Iterator, Optional, Union
19+
from typing import Callable, Iterator
2020

2121
import psycopg
2222
import pytest
@@ -31,8 +31,8 @@
3131

3232
def postgresql(
3333
process_fixture_name: str,
34-
dbname: Optional[str] = None,
35-
isolation_level: "Optional[psycopg.IsolationLevel]" = None,
34+
dbname: str | None = None,
35+
isolation_level: "psycopg.IsolationLevel | None" = None,
3636
) -> Callable[[FixtureRequest], Iterator[Connection]]:
3737
"""Return connection fixture factory for PostgreSQL.
3838
@@ -50,7 +50,7 @@ def postgresql_factory(request: FixtureRequest) -> Iterator[Connection]:
5050
:param request: fixture request object
5151
:returns: postgresql client
5252
"""
53-
proc_fixture: Union[PostgreSQLExecutor, NoopExecutor] = request.getfixturevalue(
53+
proc_fixture: PostgreSQLExecutor | NoopExecutor = request.getfixturevalue(
5454
process_fixture_name
5555
)
5656
config = get_config(request)

0 commit comments

Comments
 (0)