Skip to content

Commit 917fc52

Browse files
bump deps and deduplicate scripts (#1157)
1 parent b9e3243 commit 917fc52

File tree

12 files changed

+104
-114
lines changed

12 files changed

+104
-114
lines changed

.github/workflows/build-package.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,12 @@ jobs:
533533
534534
- name: Build Release Executables
535535
run: |
536-
scripts/build_bin_macos ${{inputs.icloudpd_version}} amd64
536+
scripts/build_bin2 icloudpd icloud && \
537+
scripts/build_bin1 icloud && \
538+
scripts/build_bin1 icloudpd_ex && \
539+
mv dist/icloud dist/icloud-${{inputs.icloudpd_version}}-macos-amd64 && \
540+
mv dist/icloudpd dist/icloudpd-${{inputs.icloudpd_version}}-macos-amd64 && \
541+
mv dist/icloudpd_ex dist/icloudpd-ex-${{inputs.icloudpd_version}}-macos-amd64
537542
538543
- name: Build Python Binary Wheel
539544
run: |
@@ -575,7 +580,12 @@ jobs:
575580
576581
- name: Build Release Executables
577582
run: |
578-
scripts/build_bin_windows ${{inputs.icloudpd_version}} amd64
583+
scripts/build_bin2 icloudpd icloud && \
584+
scripts/build_bin1 icloud && \
585+
scripts/build_bin1 icloudpd_ex && \
586+
mv dist/icloud dist/icloud-${{inputs.icloudpd_version}}-windows-amd64 && \
587+
mv dist/icloudpd dist/icloudpd-${{inputs.icloudpd_version}}-windows-amd64 && \
588+
mv dist/icloudpd_ex dist/icloudpd-ex-${{inputs.icloudpd_version}}-windows-amd64
579589
580590
- name: Build Python Binary Wheel
581591
run: |

pyproject.toml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ dependencies = [
3030
"piexif==1.1.3",
3131
"python-dateutil==2.9.0.post0",
3232
"urllib3==1.26.20",
33-
"typing_extensions==4.12.2",
34-
"Flask==3.1.0",
33+
"typing_extensions==4.14.0",
34+
"Flask==3.1.1",
3535
"waitress==3.0.2",
3636
# from pyicloud_ipd
3737
"six==1.17.0",
38-
"tzlocal==5.2",
39-
"pytz==2024.2",
40-
"certifi==2024.12.14",
38+
"tzlocal==5.3.1",
39+
"pytz==2025.2",
40+
"certifi==2025.4.26",
4141
"keyring==25.6.0",
4242
"keyrings-alt==5.0.2",
4343
"srp==1.0.22",
4444
]
4545

4646
[project.optional-dependencies]
4747
dev = [
48-
"twine==6.0.1",
48+
"twine==6.1.0",
4949
"pyinstaller==6.14.0",
5050
"wheel==0.45.1",
5151
"furo==2024.8.6",
@@ -54,29 +54,29 @@ dev = [
5454
"myst-parser==3.0.1"
5555
]
5656
devlinux = [
57-
"auditwheel==6.1.0",
57+
"auditwheel==6.4.0",
5858
#"staticx==0.14.1",
59-
"scons==4.8.1"
59+
"scons==4.9.1"
6060
]
6161
test = [
62-
"pytest==8.3.4",
63-
"mock==5.1.0",
64-
"freezegun==1.5.1",
62+
"pytest==8.4.0",
63+
"mock==5.2.0",
64+
"freezegun==1.5.2",
6565
"vcrpy==7.0.0",
6666
"pytest-cov==5.0.0",
67-
"ruff==0.8.4",
67+
"ruff==0.11.13",
6868
"coveralls==3.3.1",
69-
"pytest-timeout==2.3.1",
70-
"pytest-xdist==3.6.1",
71-
"mypy==1.14.0",
72-
"types-python-dateutil==2.9.0.20241206",
73-
"types-pytz==2024.2.0.20241221",
69+
"pytest-timeout==2.4.0",
70+
"pytest-xdist==3.7.0",
71+
"mypy==1.16.0",
72+
"types-python-dateutil==2.9.0.20250516",
73+
"types-pytz==2025.2.0.20250516",
7474
"types-tzlocal==5.1.0.1",
7575
"types-requests==2.31.0.2",
76-
"types-six==1.17.0.20241205",
76+
"types-six==1.17.0.20250515",
7777
"types-urllib3==1.26.25.14",
78-
"types-tqdm==4.67.0.20241221",
79-
"types-mock==5.1.0.20240425",
78+
"types-tqdm==4.67.0.20250516",
79+
"types-mock==5.2.0.20250516",
8080
"types-waitress==3.0.1.20241117",
8181
]
8282

scripts/build_bin_macos

Lines changed: 0 additions & 10 deletions
This file was deleted.

scripts/build_bin_windows

Lines changed: 0 additions & 10 deletions
This file was deleted.

scripts/compile_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def _stats(files):
99
total = len([f for f in files if f[4] != "na"])
1010
passed = len([f for f in files if f[4] == "pass"])
1111
print(
12-
f"Compatibility rate: {round(100*passed/total,1) if total > 0 else 0}% ({passed} passed out of {total})"
12+
f"Compatibility rate: {round(100 * passed / total, 1) if total > 0 else 0}% ({passed} passed out of {total})"
1313
)
1414
print("")
1515

src/foundation/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def version_info_formatted() -> str:
2424
ts = datetime.datetime.fromtimestamp(vi.commit_timestamp, tz=pytz.utc).astimezone(
2525
get_localzone()
2626
)
27-
return f"version:{vi.version}, commit sha:{vi.commit_sha}, commit timestamp:{ts:%c %Z}".replace(" ", " ")
27+
return f"version:{vi.version}, commit sha:{vi.commit_sha}, commit timestamp:{ts:%c %Z}".replace(
28+
" ", " "
29+
)
2830

2931

3032
def bytes_decode(encoding: str) -> Callable[[bytes], str]:

src/icloudpd/base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def report_version(ctx: click.Context, _param: click.Parameter, value: bool) ->
322322
@click.option(
323323
"-p",
324324
"--password",
325-
help="Your iCloud password " "(default: use PyiCloud keyring or prompt for password)",
325+
help="Your iCloud password (default: use PyiCloud keyring or prompt for password)",
326326
metavar="<password>",
327327
# is_eager=True,
328328
)
@@ -333,7 +333,7 @@ def report_version(ctx: click.Context, _param: click.Parameter, value: bool) ->
333333
)
334334
@click.option(
335335
"--cookie-directory",
336-
help="Directory to store cookies for authentication " "(default: ~/.pyicloud)",
336+
help="Directory to store cookies for authentication (default: ~/.pyicloud)",
337337
metavar="</cookie/directory>",
338338
default="~/.pyicloud",
339339
)
@@ -939,10 +939,9 @@ def download_photo_(counter: Counter, photo: PhotoAsset) -> bool:
939939
},
940940
outfile,
941941
)
942-
print("icloudpd has saved the photo record to: " "./icloudpd-photo-error.json")
942+
print("icloudpd has saved the photo record to: ./icloudpd-photo-error.json")
943943
print(
944-
"Please create a Gist with the contents of this file: "
945-
"https://gist.github.com"
944+
"Please create a Gist with the contents of this file: https://gist.github.com"
946945
)
947946
print(
948947
"Then create an issue on GitHub: "

src/pyicloud_ipd/session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ def __init__(self, service: Any):
4848
super().__init__()
4949

5050
@override
51-
# type: ignore
52-
def request(self, method: str, url, **kwargs):
51+
def request(self, method: str, url, **kwargs): # type: ignore
5352

5453
# Charge logging to the right service endpoint
5554
callee = inspect.stack()[2]

tests/test_autodelete_photos.py

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn:
9999

100100
# check files
101101
for file_name in files:
102-
assert os.path.exists(
103-
os.path.join(data_dir, file_name)
104-
), f"{file_name} expected, but missing"
102+
assert os.path.exists(os.path.join(data_dir, file_name)), (
103+
f"{file_name} expected, but missing"
104+
)
105105

106106
result = runner.invoke(
107107
main,
@@ -141,9 +141,9 @@ def astimezone(self, _tz: (Optional[Any]) = None) -> NoReturn:
141141
)
142142

143143
for file_name in files:
144-
assert not os.path.exists(
145-
os.path.join(data_dir, file_name)
146-
), f"{file_name} not expected, but present"
144+
assert not os.path.exists(os.path.join(data_dir, file_name)), (
145+
f"{file_name} not expected, but present"
146+
)
147147

148148
def test_download_autodelete_photos(self) -> None:
149149
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3])
@@ -202,9 +202,9 @@ def test_download_autodelete_photos(self) -> None:
202202

203203
# check files
204204
for file_name in files:
205-
assert os.path.exists(
206-
os.path.join(data_dir, file_name)
207-
), f"{file_name} expected, but missing"
205+
assert os.path.exists(os.path.join(data_dir, file_name)), (
206+
f"{file_name} expected, but missing"
207+
)
208208

209209
result = runner.invoke(
210210
main,
@@ -244,9 +244,9 @@ def test_download_autodelete_photos(self) -> None:
244244
)
245245

246246
for file_name in files:
247-
assert not os.path.exists(
248-
os.path.join(data_dir, file_name)
249-
), f"{file_name} not expected, but present"
247+
assert not os.path.exists(os.path.join(data_dir, file_name)), (
248+
f"{file_name} not expected, but present"
249+
)
250250

251251
def test_autodelete_photos(self) -> None:
252252
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3])
@@ -350,14 +350,14 @@ def test_autodelete_photos(self) -> None:
350350

351351
# check files
352352
for file_name in files_to_create:
353-
assert os.path.exists(
354-
os.path.join(data_dir, file_name)
355-
), f"{file_name} expected, but missing"
353+
assert os.path.exists(os.path.join(data_dir, file_name)), (
354+
f"{file_name} expected, but missing"
355+
)
356356

357357
for file_name in files_to_delete:
358-
assert not os.path.exists(
359-
os.path.join(data_dir, file_name)
360-
), f"{file_name} not expected, but present"
358+
assert not os.path.exists(os.path.join(data_dir, file_name)), (
359+
f"{file_name} not expected, but present"
360+
)
361361

362362
def test_retry_delete_after_download_session_error(self) -> None:
363363
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3])
@@ -448,9 +448,9 @@ def mocked_authenticate(self: PyiCloudService) -> None:
448448

449449
# check files
450450
for file_name in files:
451-
assert os.path.exists(
452-
os.path.join(data_dir, file_name)
453-
), f"{file_name} expected, but missing"
451+
assert os.path.exists(os.path.join(data_dir, file_name)), (
452+
f"{file_name} expected, but missing"
453+
)
454454

455455
files_in_result = glob.glob(os.path.join(data_dir, "**/*.*"), recursive=True)
456456

@@ -547,9 +547,9 @@ def mocked_authenticate(self: PyiCloudService) -> None:
547547

548548
# check files
549549
for file_name in files:
550-
assert os.path.exists(
551-
os.path.join(data_dir, file_name)
552-
), f"{file_name} expected, but missing"
550+
assert os.path.exists(os.path.join(data_dir, file_name)), (
551+
f"{file_name} expected, but missing"
552+
)
553553

554554
files_in_result = glob.glob(os.path.join(data_dir, "**/*.*"), recursive=True)
555555

@@ -630,9 +630,9 @@ def mock_raise_response_error(
630630

631631
# check files
632632
for file_name in files:
633-
assert os.path.exists(
634-
os.path.join(data_dir, file_name)
635-
), f"{file_name} expected, but missing"
633+
assert os.path.exists(os.path.join(data_dir, file_name)), (
634+
f"{file_name} expected, but missing"
635+
)
636636

637637
files_in_result = glob.glob(os.path.join(data_dir, "**/*.*"), recursive=True)
638638

@@ -715,9 +715,9 @@ def mock_raise_response_error(
715715

716716
# check files
717717
for file_name in files:
718-
assert os.path.exists(
719-
os.path.join(data_dir, file_name)
720-
), f"{file_name} expected, but missing"
718+
assert os.path.exists(os.path.join(data_dir, file_name)), (
719+
f"{file_name} expected, but missing"
720+
)
721721

722722
files_in_result = glob.glob(os.path.join(data_dir, "**/*.*"), recursive=True)
723723

@@ -832,14 +832,14 @@ def test_autodelete_photos_dry_run(self) -> None:
832832

833833
# check files
834834
for file_name in files_to_create:
835-
assert os.path.exists(
836-
os.path.join(data_dir, file_name)
837-
), f"{file_name} expected, but missing"
835+
assert os.path.exists(os.path.join(data_dir, file_name)), (
836+
f"{file_name} expected, but missing"
837+
)
838838

839839
for file_name in files_to_delete:
840-
assert os.path.exists(
841-
os.path.join(data_dir, file_name)
842-
), f"{file_name} expected to stay, but missing"
840+
assert os.path.exists(os.path.join(data_dir, file_name)), (
841+
f"{file_name} expected to stay, but missing"
842+
)
843843

844844
def test_autodelete_photos_folder_none(self) -> None:
845845
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3])
@@ -926,14 +926,14 @@ def test_autodelete_photos_folder_none(self) -> None:
926926

927927
# check files
928928
for file_name in files_to_create:
929-
assert os.path.exists(
930-
os.path.join(data_dir, file_name)
931-
), f"{file_name} expected, but missing"
929+
assert os.path.exists(os.path.join(data_dir, file_name)), (
930+
f"{file_name} expected, but missing"
931+
)
932932

933933
for file_name in files_to_delete:
934-
assert not os.path.exists(
935-
os.path.join(data_dir, file_name)
936-
), f"{file_name} not expected, but present"
934+
assert not os.path.exists(os.path.join(data_dir, file_name)), (
935+
f"{file_name} not expected, but present"
936+
)
937937

938938
def test_autodelete_photos_lp(self) -> None:
939939
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3])
@@ -1021,14 +1021,14 @@ def test_autodelete_photos_lp(self) -> None:
10211021

10221022
# check files
10231023
for file_name in files_to_create:
1024-
assert os.path.exists(
1025-
os.path.join(data_dir, file_name)
1026-
), f"{file_name} expected, but missing"
1024+
assert os.path.exists(os.path.join(data_dir, file_name)), (
1025+
f"{file_name} expected, but missing"
1026+
)
10271027

10281028
for file_name in files_to_delete:
1029-
assert not os.path.exists(
1030-
os.path.join(data_dir, file_name)
1031-
), f"{file_name} not expected, but present"
1029+
assert not os.path.exists(os.path.join(data_dir, file_name)), (
1030+
f"{file_name} not expected, but present"
1031+
)
10321032

10331033
def test_autodelete_photos_lp_heic(self) -> None:
10341034
base_dir = os.path.join(self.fixtures_path, inspect.stack()[0][3])
@@ -1116,11 +1116,11 @@ def test_autodelete_photos_lp_heic(self) -> None:
11161116

11171117
# check files
11181118
for file_name in files_to_create:
1119-
assert os.path.exists(
1120-
os.path.join(data_dir, file_name)
1121-
), f"{file_name} expected, but missing"
1119+
assert os.path.exists(os.path.join(data_dir, file_name)), (
1120+
f"{file_name} expected, but missing"
1121+
)
11221122

11231123
for file_name in files_to_delete:
1124-
assert not os.path.exists(
1125-
os.path.join(data_dir, file_name)
1126-
), f"{file_name} not expected, but present"
1124+
assert not os.path.exists(os.path.join(data_dir, file_name)), (
1125+
f"{file_name} not expected, but present"
1126+
)

0 commit comments

Comments
 (0)