From 78cbee5d8d5119a2f9da63df50e75cc86a441a4c Mon Sep 17 00:00:00 2001 From: Giles Knap Date: Sat, 30 Dec 2023 20:33:30 +0000 Subject: [PATCH] fix python 3.12 issues --- .vscode/settings.json | 4 ++-- pyproject.toml | 14 +++++++++----- tests/test_credentials/.gphotos.token | 2 +- tests/test_system/test_system.py | 1 - tests/test_units/test_local_scan.py | 1 - 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 97522486..68d07bf0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,8 +9,8 @@ "editor.formatOnSave": true, "[python]": { "editor.codeActionsOnSave": { - "source.fixAll.ruff": false, - "source.organizeImports.ruff": true + "source.fixAll.ruff": "never", + "source.organizeImports.ruff": "explicit" } } } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7beb4e5f..978c71a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,6 +40,7 @@ dev = [ "sphinx-autobuild", "sphinx-copybutton", "sphinx-design", + "sphinx_rtd_theme_github_versions", "tox-direct", "types-mock", "mock", @@ -72,11 +73,14 @@ addopts = """ """ # https://iscinumpy.gitlab.io/post/bound-version-constraints/#watch-for-warnings filterwarnings = [ - "error", - "ignore:.*socket.*:ResourceWarning", - # this deprecation is rather serious for gphotos-sync as it relies on sqlite - # doing date conversion quite heavily - will ignore the deprection for now - "ignore:sqlite3:DeprecationWarning: The default datetime adapter.*" + "error", + "ignore:.*socket.*:ResourceWarning", + # this deprecation is rather serious for gphotos-sync as it relies on sqlite + # doing date conversion quite heavily - will ignore the deprection for now + # DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; + "ignore:.*sqlite3.*:DeprecationWarning:", + # like the above + "ignore:.*datetime.utcfromtimestamp:DeprecationWarning:" ] # Doctest python code in docs, python code in src docstrings, test functions in tests testpaths = "docs src tests" diff --git a/tests/test_credentials/.gphotos.token b/tests/test_credentials/.gphotos.token index b7be94ba..7cf84e76 100644 --- a/tests/test_credentials/.gphotos.token +++ b/tests/test_credentials/.gphotos.token @@ -1 +1 @@ -{"access_token": "ya29.a0AfB_byD9Qzo5Ah_YIJRQnbotK4OLKXCgQTIcolrABnIG3I9MEPB9FHGjLSpGUmenochN7WVHHafKwv0gFNNCgDp05Icth4mC3uCOnP5gs1rTNbZB6dYLoBENsjKjnoylT4_iwaLgbl6rwcij5xVmWg0NUlfcVhE1CRdkmXUaCgYKAZ8SARMSFQHGX2MiuUH3W4-Y-jyn-N9e1y6u4Q0174", "expires_in": 3599, "scope": ["https://www.googleapis.com/auth/photoslibrary.sharing", "https://www.googleapis.com/auth/photoslibrary.readonly"], "token_type": "Bearer", "expires_at": 1702828943.8575091, "refresh_token": "1//03CEqAzsnP-8PCgYIARAAGAMSNwF-L9Irz4_ilhRw0HIwVImT4gTCUPlV8YaCTYQiIjD4juWOI5eQh_-Rzh9nTmBND0jliOnabq4"} \ No newline at end of file +{"access_token": "ya29.a0AfB_byAAnSEyVYmlxFIXG7A7lH8jkrSrd4RSnunI4rYyHfzdG-ZjSQiFxo5-OHV5rBgEnHoFMKK1Rj5PKxLCXVCEr-0yMiJs61wCCfzg36-UWQegZTV3kBotQH_Qk7HTkZcphp11fW5lbc3POClog-aOCfJLIbOe2UfA63MaCgYKAZsSARMSFQHGX2Mi3joogOa2oHnOerg_ojwUQg0174", "expires_in": 3599, "scope": ["https://www.googleapis.com/auth/photoslibrary.sharing", "https://www.googleapis.com/auth/photoslibrary.readonly"], "token_type": "Bearer", "expires_at": 1703971275.0828457, "refresh_token": "1//03CEqAzsnP-8PCgYIARAAGAMSNwF-L9Irz4_ilhRw0HIwVImT4gTCUPlV8YaCTYQiIjD4juWOI5eQh_-Rzh9nTmBND0jliOnabq4"} \ No newline at end of file diff --git a/tests/test_system/test_system.py b/tests/test_system/test_system.py index 0f69d041..69ee1eb4 100644 --- a/tests/test_system/test_system.py +++ b/tests/test_system/test_system.py @@ -464,7 +464,6 @@ def test_skip_video_on_album(self): @patch.object(GooglePhotosDownload, "do_download_file") def test_bad_ids(self, do_download_file): - do_download_file.side_effect = HTTPError(Mock(status=500), "ouch!") with ts.SetupDbAndCredentials() as s: args = [ diff --git a/tests/test_units/test_local_scan.py b/tests/test_units/test_local_scan.py index accbc798..23fb4932 100644 --- a/tests/test_units/test_local_scan.py +++ b/tests/test_units/test_local_scan.py @@ -9,7 +9,6 @@ class TestLocalScan(TestCase): def test_local_duplicate_names(self): - ps = "PIC00002 (2).jpg" p = Path(test_data) / Path(ps)