Skip to content

Commit 09e4e97

Browse files
authored
Merge branch 'master' into enh/show-trashed-at-date
2 parents 86dc4f4 + 73c3b1c commit 09e4e97

File tree

10 files changed

+48
-28
lines changed

10 files changed

+48
-28
lines changed

ci/helpers/install_pylint.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PYLINT_VERSION="$(grep pylint== $REQUIREMENTS | awk '{print $1}')"
1616
uv pip install "$PYLINT_VERSION"
1717

1818
# Minimal packages to pass linter
19-
echo "$CURDIR/requirements.txt"
20-
uv pip install -r "$CURDIR/requirements.txt"
19+
echo "$CURDIR/requirements/requirements.txt"
20+
uv pip install -r "$CURDIR/requirements/requirements.txt"
2121

2222
echo "INFO:" "$(pylint --version)" "@" "$(command -v pylint)"

ci/helpers/requirements/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# Targets to pip-compile requirements
3+
#
4+
include ../../../requirements/base.Makefile
5+
6+
# Add here any extra explicit dependency: e.g. _migration.txt: _base.txt

ci/helpers/requirements.in renamed to ci/helpers/requirements/requirements.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#
33
# Installing these void e.g. E0611: No name 'UploadFile' in module 'fastapi' (no-name-in-module)
44
#
5-
--constraint ../../requirements/constraints.txt
5+
--constraint ../../../requirements/constraints.txt
66

77
aiohttp
88
fastapi
9+
docker
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
# This file was autogenerated by uv via the following command:
2-
# uv pip compile requirements.in -o requirements.txt
31
aiohttp==3.9.5
4-
# via
5-
# -c ../../requirements/constraints.txt
6-
# -r requirements.in
72
aiosignal==1.3.1
83
# via aiohttp
94
annotated-types==0.7.0
@@ -12,36 +7,43 @@ anyio==4.3.0
127
# via starlette
138
attrs==23.2.0
149
# via aiohttp
10+
certifi==2024.12.14
11+
# via requests
12+
charset-normalizer==3.4.1
13+
# via requests
14+
docker==7.1.0
1515
fastapi==0.115.0
16-
# via -r requirements.in
1716
frozenlist==1.4.1
1817
# via
1918
# aiohttp
2019
# aiosignal
2120
idna==3.7
2221
# via
2322
# anyio
23+
# requests
2424
# yarl
2525
multidict==6.0.5
2626
# via
2727
# aiohttp
2828
# yarl
29-
pydantic==2.9.2
30-
# via
31-
# -c ../../requirements/constraints.txt
32-
# fastapi
33-
pydantic-core==2.23.4
29+
pydantic==2.10.5
30+
# via fastapi
31+
pydantic-core==2.27.2
3432
# via pydantic
33+
requests==2.32.3
34+
# via docker
3535
sniffio==1.3.1
3636
# via anyio
3737
starlette==0.38.6
38-
# via
39-
# -c ../../requirements/constraints.txt
40-
# fastapi
41-
typing-extensions==4.11.0
38+
# via fastapi
39+
typing-extensions==4.12.2
4240
# via
4341
# fastapi
4442
# pydantic
4543
# pydantic-core
44+
urllib3==2.3.0
45+
# via
46+
# docker
47+
# requests
4648
yarl==1.9.4
4749
# via aiohttp

packages/common-library/tests/test_pydantic_fields_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ class MyModel(BaseModel):
6969
],
7070
)
7171
def test_field_fn(fn: Callable[[Any], Any], expected: Any, name: str):
72-
assert expected == fn(MyModel.model_fields[name])
72+
assert expected == fn(MyModel.model_fields.get(name))

packages/models-library/src/models_library/user_preferences.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,30 @@ def to_db(self) -> dict:
9898

9999
@classmethod
100100
def update_preference_default_value(cls, new_default: Any) -> None:
101-
expected_type = get_type(cls.model_fields["value"])
101+
expected_type = get_type(
102+
cls.model_fields["value"] # pylint: disable=unsubscriptable-object
103+
)
102104
detected_type = type(new_default)
103105
if expected_type != detected_type:
104106
msg = (
105107
f"Error, {cls.__name__} {expected_type=} differs from {detected_type=}"
106108
)
107109
raise TypeError(msg)
108110

109-
if cls.model_fields["value"].default is None:
110-
cls.model_fields["value"].default_factory = lambda: new_default
111+
if (
112+
cls.model_fields["value"].default # pylint: disable=unsubscriptable-object
113+
is None
114+
):
115+
cls.model_fields[ # pylint: disable=unsubscriptable-object
116+
"value"
117+
].default_factory = lambda: new_default
111118
else:
112-
cls.model_fields["value"].default = new_default
113-
cls.model_fields["value"].default_factory = None
119+
cls.model_fields[ # pylint: disable=unsubscriptable-object
120+
"value"
121+
].default = new_default
122+
cls.model_fields[ # pylint: disable=unsubscriptable-object
123+
"value"
124+
].default_factory = None
114125

115126
cls.model_rebuild(force=True)
116127

packages/models-library/tests/test_rest_ordering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def test_ordering_query_model_class__defaults():
197197
model = OrderQueryParamsModel.model_validate({"order_by": {"field": "name"}})
198198
assert model.order_by
199199
assert model.order_by.field == "name"
200-
assert model.order_by.direction == OrderBy.model_fields["direction"].default
200+
assert model.order_by.direction == OrderBy.model_fields.get("direction").default
201201

202202
# direction alone is invalid
203203
with pytest.raises(ValidationError) as err_info:

packages/service-integration/src/service_integration/oci_image_spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class LabelSchemaAnnotations(BaseModel):
164164
@classmethod
165165
def create_from_env(cls) -> "LabelSchemaAnnotations":
166166
data = {}
167-
for field_name in cls.model_fields:
167+
for field_name in cls.model_fields.keys():
168168
if value := os.environ.get(field_name.upper()):
169169
data[field_name] = value
170170
return cls.model_validate(data)

packages/settings-library/src/settings_library/utils_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def _compose_url(
128128
isinstance(v, (str, int)) or v is None for v in kwargs.values()
129129
) # nosec
130130

131-
composed_url: str = str(AnyUrl.build(**kwargs)) # type: ignore[arg-type]
131+
composed_url: str = str(AnyUrl.build(**kwargs)) # type: ignore[arg-type] # pylint: disable=missing-kwoa
132132
return composed_url.rstrip("/")
133133

134134
def _build_api_base_url(self, *, prefix: str) -> str:

services/payments/tests/unit/test_services_notifier_email.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def transaction(
9797
) -> PaymentsTransactionsDB:
9898
kwargs = {
9999
k: successful_transaction[k]
100-
for k in PaymentsTransactionsDB.model_fields
100+
for k in PaymentsTransactionsDB.model_fields.keys()
101101
if k in successful_transaction
102102
}
103103
return PaymentsTransactionsDB(**kwargs)

0 commit comments

Comments
 (0)