Skip to content

Commit 7ac4a02

Browse files
committed
Bump Python requirements files
This commit is the result of running `pip-compile --upgrade` on all the `.in` files in the repo, with one contraint: `conan==1.59.0` since we do not yet support Conan 2. The new tools demanded the following changes via the linting job: - flake8 no longer accepts inline comments in its config file. - pylint now requires calls to `requests.get` and `requests.post` to specify a timeout. - pylint no longer accepts certain unnecessary list comprehensions that could have been just a generator expression. - black requires some simple formatting changes.
1 parent e2629bc commit 7ac4a02

24 files changed

+161
-205
lines changed

.flake8

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
[flake8]
22
ignore =
33
### Covered better by pylint
4-
E501, # Line too long
4+
# Line too long
5+
E501,
56
### Covered by pylint
6-
F401, # Imported but unused
7+
# Imported but unused
8+
F401,
79
### in conflict with black
8-
W503, # line break before binary operator
9-
E302, # expected 2 blank lines, found 0
10-
D202, # No blank lines allowed after function docstring
10+
# line break before binary operator
11+
W503,
12+
# expected 2 blank lines, found 0
13+
E302,
14+
# No blank lines allowed after function docstring
15+
D202,
1116
### We do not currently require docstrings in "magic methods"
12-
D105, # missing docstring in magic method
17+
# missing docstring in magic method
18+
D105,
1319
show-source = True
1420

1521
### Ignore docstring complaints in data models

.flake8-internal

+28-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
[flake8]
22
ignore =
33
### Covered better by pylint
4-
E501, # Line too long
5-
F401, # Imported but unused
4+
# Line too long
5+
E501,
6+
# Imported but unused
7+
F401,
68
### in conflict with black
7-
W503, # line break before binary operator
8-
E302, # expected 2 blank lines, found 0
9-
D202, # No blank lines allowed after function docstring
9+
# line break before binary operator
10+
W503,
11+
# expected 2 blank lines, found 0
12+
E302,
13+
# No blank lines allowed after function docstring
14+
D202,
1015
### Permanently disabled for internal linting:
11-
D100, # Missing docstring in public module
12-
D101, # missing docstring in public class
13-
D102, # Missing docstring in public method
14-
D103, # missing docstring in public function
15-
D104, # missing docstring in public package
16-
D105, # missing docstring in magic method
17-
D106, # missing docstring in public nested class
18-
D107, # missing docstring in __init__
19-
I401, # Missing exception(s) in Raises section
16+
# Missing docstring in public module
17+
D100,
18+
# missing docstring in public class
19+
D101,
20+
# Missing docstring in public method
21+
D102,
22+
# missing docstring in public function
23+
D103,
24+
# missing docstring in public package
25+
D104,
26+
# missing docstring in magic method
27+
D105,
28+
# missing docstring in public nested class
29+
D106,
30+
# missing docstring in __init__
31+
D107,
32+
# Missing exception(s) in Raises section
33+
I401,
2034
show-source = True

.flake8-tests

+26-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
11
[flake8]
22
ignore =
33
### Covered better by pylint
4-
E501, # Line too long
5-
F401, # Imported but unused
4+
# Line too long
5+
E501,
6+
# Imported but unused
7+
F401,
68
### in conflict with black
7-
W503, # line break before binary operator
8-
E302, # expected 2 blank lines, found 0
9-
D202, # No blank lines allowed after function docstring
9+
# line break before binary operator
10+
W503,
11+
# expected 2 blank lines, found 0
12+
E302,
13+
# No blank lines allowed after function docstring
14+
D202,
1015
### Permanently disabled for internal linting:
11-
D100, # Missing docstring in public module
12-
D101, # missing docstring in public class
13-
D103, # missing docstring in public function
14-
D104, # missing docstring in public package
15-
D105, # missing docstring in magic method
16-
D106, # missing docstring in public nested class
17-
D107, # missing docstring in __init__
18-
I401, # Missing exception(s) in Raises section
16+
# Missing docstring in public module
17+
D100,
18+
# missing docstring in public class
19+
D101,
20+
# missing docstring in public function
21+
D103,
22+
# missing docstring in public package
23+
D104,
24+
# missing docstring in magic method
25+
D105,
26+
# missing docstring in public nested class
27+
D106,
28+
# missing docstring in __init__
29+
D107,
30+
# Missing exception(s) in Raises section
31+
I401,
1932
show-source = True

continuous-integration/code-generation/check_datamodels_up_to_date.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
def _check_datamodels_up_to_date(repo_root: Path):
9-
109
regeneration_script = Path(
1110
"continuous-integration/code-generation/docker_generate_datamodels.sh"
1211
)

continuous-integration/code-generation/datamodel_frontend_generator.py

-16
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def _inner_classes_list(cls: Any) -> List:
7474

7575

7676
def _imports(extra_imports: Sequence[str]) -> str:
77-
7877
linter_exceptions = [
7978
"too-many-lines",
8079
"protected-access",
@@ -98,13 +97,11 @@ def _imports(extra_imports: Sequence[str]) -> str:
9897

9998

10099
def _create_init_special_member_function(node_data: NodeData, base_type: str) -> str:
101-
102100
full_dot_path = _get_dot_path(base_type, node_data.path)
103101
signature_vars = ""
104102
member_variable_set = ""
105103

106104
for container in node_data.member_containers:
107-
108105
if container.container_info is None:
109106
raise RuntimeError(f"Unexpected lack of container info: {container}")
110107

@@ -129,7 +126,6 @@ def _create_init_special_member_function(node_data: NodeData, base_type: str) ->
129126
)
130127

131128
for member in node_data.member_variables:
132-
133129
if member.member_info is None:
134130
raise RuntimeError(f"Unexpected lack of member info: {member}")
135131

@@ -142,7 +138,6 @@ def _create_init_special_member_function(node_data: NodeData, base_type: str) ->
142138
signature_vars += f"{member.snake_case}={full_dot_path}.{member.name}().value,"
143139

144140
if member.is_enum:
145-
146141
member_variable_set += dedent(
147142
f"""
148143
if isinstance({member.snake_case},{full_dot_path}.{member.name}.enum) {is_none_check}:
@@ -168,7 +163,6 @@ def _create_init_special_member_function(node_data: NodeData, base_type: str) ->
168163
)
169164

170165
for child_class in node_data.children:
171-
172166
if child_class.is_uninstantiated_node:
173167
continue
174168
signature_vars += f"{child_class.snake_case}=None,"
@@ -224,7 +218,6 @@ def __eq__(self, other):
224218

225219

226220
def _create_str_special_member_function(node_data: NodeData, base_type: str) -> str:
227-
228221
full_underscore_path = _get_underscore_name(base_type, node_data.path)
229222
str_content = f"str(_to_internal_{full_underscore_path}(self))"
230223

@@ -237,12 +230,10 @@ def __str__(self):
237230

238231

239232
def _create_properties(node_data: NodeData, base_type: str) -> str:
240-
241233
get_properties = "\n"
242234
set_properties = "\n"
243235

244236
for node in node_data.member_containers:
245-
246237
if node.container_info is None:
247238
raise RuntimeError(f"Unexpected lack of container info: {node}")
248239

@@ -270,7 +261,6 @@ def {node.snake_case}(self,value):
270261
)
271262

272263
for member in node_data.member_variables:
273-
274264
if member.member_info is None:
275265
raise RuntimeError(f"Unexpected lack of member info: {member}")
276266

@@ -400,7 +390,6 @@ def save(self, file_name):
400390

401391

402392
def _create_enum_class(member: NodeData, base_type: str) -> str:
403-
404393
full_dot_path = _get_dot_path(base_type, member.path)
405394

406395
static_members = ["\n"]
@@ -493,7 +482,6 @@ def _parse_internal_datamodel(current_class: Any) -> NodeData:
493482
member_containers = []
494483
to_be_removed = []
495484
for child in child_classes:
496-
497485
if child.underlying_zivid_class.node_type.name == "leaf_data_model_list":
498486
child.container_info = ContainerInfo(
499487
contained_type=child.underlying_zivid_class.contained_type,
@@ -546,7 +534,6 @@ def _parse_internal_datamodel(current_class: Any) -> NodeData:
546534

547535

548536
def _create_to_frontend_converter(node_data: NodeData, base_type: str) -> str:
549-
550537
base_typename = base_type.split(".")[-1]
551538
temp_internal_name = f"internal_{node_data.snake_case}"
552539
nested_converters = [
@@ -599,7 +586,6 @@ def _to_{underscored_path}(internal_{node_data.snake_case}):
599586

600587

601588
def _create_to_internal_converter(node_data: NodeData, base_type: str) -> str:
602-
603589
temp_internal_name = f"internal_{node_data.snake_case}"
604590
nested_converters = [
605591
_create_to_internal_converter(element, base_type=base_type)
@@ -702,7 +688,6 @@ def _generate_datamodel_frontend(
702688

703689
# Format source code and save to destination path
704690
with tempfile.NamedTemporaryFile(suffix=".py") as temp_file:
705-
706691
temp_file_path = Path(temp_file.name)
707692
temp_file_path.write_text(raw_text, encoding="utf-8")
708693
if verbose:
@@ -717,7 +702,6 @@ def _generate_datamodel_frontend(
717702

718703

719704
def generate_all_datamodels(dest_dir: Path) -> None:
720-
721705
for internal_class, filename, extra_imports in [
722706
(_zivid.Settings, "settings.py", ["datetime", "collections.abc"]),
723707
(_zivid.Settings2D, "settings_2d.py", ["datetime", "collections.abc"]),

continuous-integration/notification/notify_teams.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _main() -> None:
5353
}
5454
],
5555
}
56-
request = requests.post(webhook_url, json=payload)
56+
request = requests.post(webhook_url, json=payload, timeout=25)
5757
try:
5858
request.raise_for_status()
5959
except requests.HTTPError as ex:
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
scikit-build
22
cmake
33
ninja
4-
conan
4+
conan==1.59.0

continuous-integration/python-requirements/build.txt

+30-30
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,68 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.9
2+
# This file is autogenerated by pip-compile with python 3.10
33
# To update, run:
44
#
55
# pip-compile continuous-integration/python-requirements/build.in
66
#
7-
bottle==0.12.20
7+
bottle==0.12.25
88
# via conan
9-
certifi==2021.10.8
9+
certifi==2023.5.7
1010
# via requests
11-
charset-normalizer==2.0.10
11+
charset-normalizer==3.1.0
1212
# via requests
13-
cmake==3.22.1
14-
# via -r .\continuous-integration\python-requirements\build.in
15-
colorama==0.4.4
13+
cmake==3.26.3
14+
# via -r continuous-integration/python-requirements/build.in
15+
colorama==0.4.6
16+
# via conan
17+
conan==1.59.0
18+
# via -r continuous-integration/python-requirements/build.in
19+
distro==1.8.0
1620
# via
1721
# conan
18-
# tqdm
19-
conan==1.52.0
20-
# via -r .\continuous-integration\python-requirements\build.in
21-
distro==1.6.0
22-
# via scikit-build
23-
fasteners==0.17.2
22+
# scikit-build
23+
fasteners==0.18
2424
# via conan
25-
idna==3.3
25+
idna==3.4
2626
# via requests
27-
jinja2==3.0.3
27+
jinja2==3.1.2
2828
# via conan
29-
markupsafe==2.0.1
29+
markupsafe==2.1.2
3030
# via jinja2
31-
ninja==1.10.2.3
32-
# via -r .\continuous-integration\python-requirements\build.in
31+
ninja==1.11.1
32+
# via -r continuous-integration/python-requirements/build.in
3333
node-semver==0.6.1
3434
# via conan
35-
packaging==21.3
35+
packaging==23.1
3636
# via scikit-build
3737
patch-ng==1.17.4
3838
# via conan
3939
pluginbase==1.0.1
4040
# via conan
41-
pygments==2.11.2
41+
pygments==2.15.1
4242
# via conan
43-
pyjwt==2.4.0
43+
pyjwt==2.6.0
4444
# via conan
45-
pyparsing==3.0.6
46-
# via packaging
4745
python-dateutil==2.8.2
4846
# via conan
49-
pyyaml==5.4.1
47+
pyyaml==6.0
5048
# via conan
51-
requests==2.27.1
49+
requests==2.30.0
5250
# via conan
53-
scikit-build==0.12.0
54-
# via -r .\continuous-integration\python-requirements\build.in
51+
scikit-build==0.17.3
52+
# via -r continuous-integration/python-requirements/build.in
5553
six==1.16.0
5654
# via
5755
# conan
5856
# python-dateutil
59-
tqdm==4.62.3
57+
tomli==2.0.1
58+
# via scikit-build
59+
tqdm==4.65.0
6060
# via conan
61-
urllib3==1.26.8
61+
urllib3==1.26.15
6262
# via
6363
# conan
6464
# requests
65-
wheel==0.37.1
65+
wheel==0.40.0
6666
# via scikit-build
6767

6868
# The following packages are considered to be unsafe in a requirements file:

0 commit comments

Comments
 (0)