We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36a88fb commit b2fcd06Copy full SHA for b2fcd06
.github/workflows/ci.yml
@@ -32,7 +32,7 @@ jobs:
32
strategy:
33
fail-fast: true
34
matrix:
35
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
+ python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
36
pydantic-version: ["1.10", "2.0"]
37
sqla-version: ["1.4", "2"]
38
exclude:
.sourcery.yaml
@@ -15,7 +15,7 @@ rule_settings:
15
- refactoring
16
- suggestion
17
- comment
18
- python_version: "3.8"
+ python_version: "3.10"
19
20
rules: []
21
docs/conf.py
@@ -105,7 +105,7 @@
105
autodoc_member_order = "bysource"
106
autodoc_typehints_format = "short"
107
108
-auto_pytabs_min_version = (3, 8)
+auto_pytabs_min_version = (3, 10)
109
auto_pytabs_max_version = (3, 11)
110
auto_pytabs_compat_mode = True
111
docs/examples/configuration/test_example_11.py
@@ -6,7 +6,7 @@
6
from polyfactory.factories import DataclassFactory
7
8
# Define a recursive type using forward reference
9
-RecursiveType = Union[list["RecursiveType"], int]
+RecursiveType = list["RecursiveType"] | int
10
11
12
@dataclass
docs/reference/constants.rst
polyfactory/constants.py
@@ -3,15 +3,6 @@
3
from collections import abc, defaultdict, deque
4
from collections.abc import Iterable, Mapping, Sequence
5
from random import Random
-from typing import (
- Union,
-)
-
-try:
- from types import UnionType
-except ImportError:
13
- UnionType = Union # type: ignore[misc,assignment]
14
# Mapping of type annotations into concrete types.
TYPE_MAPPING = {
@@ -29,7 +20,6 @@
29
abc.Mapping: dict,
30
abc.Sequence: list,
31
22
abc.Set: set,
- UnionType: Union,
23
}
24
25
polyfactory/factories/odmantic_odm_factory.py
@@ -18,7 +18,7 @@
msg = "odmantic is not installed"
raise MissingDependencyException(msg) from e
-T = TypeVar("T", bound=Union[Model, EmbeddedModel])
+T = TypeVar("T", bound=Model | EmbeddedModel)
if TYPE_CHECKING:
from typing import TypeGuard
polyfactory/value_generators/constrained_strings.py
@@ -7,7 +7,7 @@
from polyfactory.value_generators.primitives import create_random_bytes, create_random_string
from polyfactory.value_generators.regex import RegexFactory
-T = TypeVar("T", bound=Union[bytes, str])
+T = TypeVar("T", bound=bytes | str)
pyproject.toml
@@ -17,7 +17,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
- "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@@ -36,7 +35,7 @@ version = "3.2.0"
description = "Mock data generation factories"
readme = "docs/PYPI_README.md"
license = { text = "MIT" }
39
-requires-python = ">=3.9,<4.0"
+requires-python = ">=3.10,<4.0"
40
dependencies = ["faker>=5.0.0", "typing-extensions>=4.6.0"]
41
42
[project.optional-dependencies]
@@ -184,7 +183,7 @@ exclude_lines = [
184
183
[tool.ruff]
185
line-length = 120
186
src = ["polyfactory", "tests", "docs/examples"]
187
-target-version = "py39"
+target-version = "py310"
188
189
[tool.ruff.format]
190
docstring-code-format = true
tests/constraints/test_list_constraints.py
@@ -1,12 +1,9 @@
1
-import sys
2
from typing import Any
import pytest
from hypothesis import given
from hypothesis.strategies import integers
-from pydantic import VERSION
from polyfactory.exceptions import ParameterException
from polyfactory.factories.pydantic_factory import ModelFactory, PydanticFieldMeta
from polyfactory.value_generators.constrained_collections import (
@@ -74,10 +71,6 @@ def test_handle_constrained_list_with_min_items(
74
71
assert len(result) >= min_items
75
72
76
73
77
-@pytest.mark.skipif(
78
- sys.version_info < (3, 9) and VERSION.startswith("2"),
79
- reason="fails on python 3.8 with pydantic v2",
80
81
@pytest.mark.parametrize("t_type", tuple(ModelFactory.get_provider_map()))
82
def test_handle_constrained_list_with_different_types(t_type: Any) -> None:
83
field_meta = PydanticFieldMeta.from_type(list[t_type], name="test")
0 commit comments