Skip to content

Commit ad197cd

Browse files
[pre-commit.ci] pre-commit autoupdate (#414)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.9 → v0.11.4](astral-sh/ruff-pre-commit@v0.9.9...v0.11.4) - [github.com/python-jsonschema/check-jsonschema: 0.31.2 → 0.32.1](python-jsonschema/check-jsonschema@0.31.2...0.32.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Address ruff issues --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Loria <sloria1@gmail.com>
1 parent 31d9448 commit ad197cd

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ ci:
22
autoupdate_schedule: monthly
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.9.9
5+
rev: v0.11.4
66
hooks:
77
- id: ruff
88
- id: ruff-format
99
- repo: https://github.com/python-jsonschema/check-jsonschema
10-
rev: 0.31.2
10+
rev: 0.32.1
1111
hooks:
1212
- id: check-github-workflows
1313
- repo: https://github.com/asottile/blacken-docs

src/environs/__init__.py

+15-14
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,24 @@
2121
EnvValidationError,
2222
ParserConflictError,
2323
)
24-
from .types import (
25-
DictFieldMethod,
26-
EnumFieldMethod,
27-
ErrorMapping,
28-
FieldFactory,
29-
FieldMethod,
30-
ListFieldMethod,
31-
ParserMethod,
32-
Subcast,
33-
)
3424

3525
if typing.TYPE_CHECKING:
3626
import datetime as dt
3727
import decimal
3828
import uuid
3929
from urllib.parse import ParseResult
4030

31+
from .types import (
32+
DictFieldMethod,
33+
EnumFieldMethod,
34+
ErrorMapping,
35+
FieldFactory,
36+
FieldMethod,
37+
ListFieldMethod,
38+
ParserMethod,
39+
Subcast,
40+
)
41+
4142
try:
4243
from dj_database_url import DBConfig
4344
except ImportError:
@@ -102,7 +103,7 @@ def method(
102103
)
103104
else:
104105
parsed_subcast = _make_subcast_field(subcast) if subcast else ma.fields.Raw
105-
field = typing.cast(FieldFactory, field_or_factory)(
106+
field = typing.cast("FieldFactory", field_or_factory)(
106107
subcast=parsed_subcast,
107108
validate=validate,
108109
load_default=load_default,
@@ -133,7 +134,7 @@ def method(
133134
self._errors[parsed_key].extend(error.messages)
134135
else:
135136
self._values[parsed_key] = value
136-
return typing.cast(typing.Optional[_T], value)
137+
return typing.cast("typing.Optional[_T]", value)
137138

138139
method.__name__ = method_name
139140
return method
@@ -180,7 +181,7 @@ def method(
180181
self._errors[parsed_key].extend(messages)
181182
else:
182183
self._values[parsed_key] = value
183-
return typing.cast(typing.Optional[_T], value)
184+
return typing.cast("typing.Optional[_T]", value)
184185

185186
method.__name__ = method_name
186187
return method
@@ -218,7 +219,7 @@ def _preprocess_list(
218219
) -> typing.Iterable:
219220
if ma.utils.is_iterable_but_not_string(value) or value is None:
220221
return value
221-
return typing.cast(str, value).split(delimiter) if value != "" else []
222+
return typing.cast("str", value).split(delimiter) if value != "" else []
222223

223224

224225
def _preprocess_dict(

src/environs/fields.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,5 @@ def deserialize( # type: ignore[override]
9595
data: typing.Mapping[str, typing.Any] | None = None,
9696
**kwargs,
9797
) -> ParseResult:
98-
ret = typing.cast(str, super().deserialize(value, attr, data, **kwargs))
98+
ret = typing.cast("str", super().deserialize(value, attr, data, **kwargs))
9999
return urlparse(ret)

uv.lock

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)