Skip to content

Commit bbe101f

Browse files
committed
chore: drop Python 3.10 support
1 parent 5c91aa3 commit bbe101f

27 files changed

Lines changed: 81 additions & 277 deletions

‎.github/workflows/tests.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
- '3.13'
2929
- '3.12'
3030
- '3.11'
31-
- '3.10'
3231
steps:
3332
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
3433
- name: Install uv

‎.pre-commit-config.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,4 @@ repos:
3333
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
3434
hooks:
3535
- id: codespell
36-
language: python
37-
additional_dependencies:
38-
- tomli==2.4.1
3936
args: [--write-changes]

‎doc/changelog.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Changelog
22
=========
33

4+
[Unreleased]
5+
------------
6+
7+
Changed
8+
^^^^^^^
9+
- Python 3.11 is now the minimum supported version.
10+
- The enumerations, such as :class:`~scim2_models.Mutability`, are :class:`~enum.StrEnum`:
11+
:class:`str` and f-strings give their value, ``readOnly`` rather than ``Mutability.read_only``.
12+
413
[0.8.2] - 2026-09-25
514
--------------------
615

‎pyproject.toml‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ keywords = ["scim", "scim2", "provisioning", "pydantic", "rfc7643", "rfc7644"]
1414
classifiers = [
1515
"Intended Audience :: Developers",
1616
"Development Status :: 3 - Alpha",
17-
"Programming Language :: Python :: 3.10",
1817
"Programming Language :: Python :: 3.11",
1918
"Programming Language :: Python :: 3.12",
2019
"Programming Language :: Python :: 3.13",
@@ -25,7 +24,7 @@ classifiers = [
2524
"Operating System :: OS Independent",
2625
]
2726

28-
requires-python = ">= 3.10"
27+
requires-python = ">= 3.11"
2928
dependencies = [
3029
"lark>=1.3",
3130
"pydantic[email]>=2.12.0",
@@ -146,7 +145,6 @@ warn_required_dynamic_aliases = true
146145
requires = ["tox>=4.19"]
147146
env_list = [
148147
"style",
149-
"py310",
150148
"py311",
151149
"py312",
152150
"py313",
@@ -173,7 +171,7 @@ commands = [
173171
[tool.tox.env.minversions]
174172
runner = "uv-venv-runner"
175173
uv_resolution = "lowest-direct"
176-
base_python = ["3.10"]
174+
base_python = ["3.11"]
177175

178176
[tool.tox.env.doc]
179177
dependency_groups = ["doc"]

‎scim2_models/annotations.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from enum import Enum
2+
from enum import StrEnum
23

34

4-
class Mutability(str, Enum):
5+
class Mutability(StrEnum):
56
"""A single keyword indicating the circumstances under which the value of the attribute can be (re)defined."""
67

78
read_only = "readOnly"
@@ -48,7 +49,7 @@ class Mutability(str, Enum):
4849
_default = read_write
4950

5051

51-
class Returned(str, Enum):
52+
class Returned(StrEnum):
5253
"""A single keyword that indicates when an attribute and associated values are returned in response to a GET request or in response to a PUT, POST, or PATCH request."""
5354

5455
always = "always" # cannot be excluded
@@ -88,7 +89,7 @@ class Returned(str, Enum):
8889
_default = default
8990

9091

91-
class Uniqueness(str, Enum):
92+
class Uniqueness(StrEnum):
9293
"""A single keyword value that specifies how the service provider enforces uniqueness of attribute values.
9394
9495
Unlike the other attribute characteristics, this one carries no validation:

‎scim2_models/attributes.py‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
from enum import Enum
1+
from enum import StrEnum
22
from inspect import isclass
33
from typing import Annotated
44
from typing import Any
55
from typing import ClassVar
6+
from typing import Self
67
from typing import get_origin
78

89
from pydantic import Field
910
from pydantic import GetJsonSchemaHandler
1011
from pydantic.json_schema import JsonSchemaValue
1112
from pydantic_core import CoreSchema
12-
from typing_extensions import Self
1313

1414
from .annotations import Mutability
1515

@@ -18,17 +18,14 @@
1818
from .reference import Reference
1919

2020

21-
class ExtensibleStringEnum(str, Enum):
21+
class ExtensibleStringEnum(StrEnum):
2222
"""String enum accepting values beyond its canonical ones.
2323
2424
:rfc:`RFC7643 §2.3.1 <7643#section-2.3.1>` and :rfc:`§7 <7643#section-7>`
2525
define ``canonicalValues`` as suggestions that service providers MAY restrict,
2626
so unknown values are kept as-is instead of being rejected.
2727
"""
2828

29-
def __str__(self) -> str:
30-
return str(self.value)
31-
3229
@classmethod
3330
def __get_pydantic_json_schema__(
3431
cls, core_schema: CoreSchema, handler: GetJsonSchemaHandler

‎scim2_models/base.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import ClassVar
88
from typing import NamedTuple
99
from typing import NoReturn
10+
from typing import Self
1011
from typing import cast
1112
from typing import get_args
1213
from typing import get_origin
@@ -27,7 +28,6 @@
2728
from pydantic.fields import FieldInfo
2829
from pydantic_core import InitErrorDetails
2930
from pydantic_core import PydanticCustomError
30-
from typing_extensions import Self
3131

3232
from scim2_models.annotations import CaseExact
3333
from scim2_models.annotations import Mutability

‎scim2_models/messages/bulk.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from enum import Enum
1+
from enum import StrEnum
22
from typing import Annotated
33
from typing import Any
44
from typing import ClassVar
55
from typing import Generic
6+
from typing import Self
67
from typing import TypeVar
78
from typing import Union
89
from typing import get_args
@@ -15,7 +16,6 @@
1516
from pydantic import field_validator
1617
from pydantic import model_validator
1718
from pydantic_core import PydanticCustomError
18-
from typing_extensions import Self
1919

2020
from ..annotations import Required
2121
from ..annotations import Returned
@@ -43,7 +43,7 @@ class BulkOperation(_ResourceParameterized, ComplexAttribute, Generic[ResourceT]
4343
``BulkOperation[User]``.
4444
"""
4545

46-
class Method(str, Enum):
46+
class Method(StrEnum):
4747
post = "POST"
4848
put = "PUT"
4949
patch = "PATCH"

‎scim2_models/messages/list_response.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from typing import Any
22
from typing import Generic
3+
from typing import Self
34

45
from pydantic import Field
56
from pydantic import ValidationInfo
67
from pydantic import ValidatorFunctionWrapHandler
78
from pydantic import model_validator
89
from pydantic_core import PydanticCustomError
9-
from typing_extensions import Self
1010

1111
from ..context import Context
1212
from ..resources.resource import AnyResource

‎scim2_models/messages/patch_op.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from collections.abc import Iterator
2-
from enum import Enum
2+
from enum import StrEnum
33
from inspect import isclass
44
from typing import Annotated
55
from typing import Any
66
from typing import Generic
7+
from typing import Self
78
from typing import TypeVar
89
from typing import cast
910
from typing import get_origin
@@ -13,7 +14,6 @@
1314
from pydantic import ValidationInfo
1415
from pydantic import field_validator
1516
from pydantic import model_validator
16-
from typing_extensions import Self
1717

1818
from ..annotations import Mutability
1919
from ..annotations import Required
@@ -206,7 +206,7 @@ def _diff(
206206

207207

208208
class PatchOperation(ComplexAttribute, Generic[ResourceT]):
209-
class Op(str, Enum):
209+
class Op(StrEnum):
210210
replace_ = "replace"
211211
remove = "remove"
212212
add = "add"

0 commit comments

Comments
 (0)