From c9ba04ce8c6d57c9f6d47a462e9d64d0a589f51c Mon Sep 17 00:00:00 2001 From: David Reiss Date: Sun, 5 Jun 2022 16:21:01 -0700 Subject: gphotos-sync: 2.14.2 -> 3.04 --- pkgs/tools/backup/gphotos-sync/default.nix | 62 +++++++++++++++------- .../backup/gphotos-sync/skip-network-tests.patch | 21 ++++++++ 2 files changed, 65 insertions(+), 18 deletions(-) create mode 100644 pkgs/tools/backup/gphotos-sync/skip-network-tests.patch diff --git a/pkgs/tools/backup/gphotos-sync/default.nix b/pkgs/tools/backup/gphotos-sync/default.nix index 515bfc31cf29..cdcc824c535d 100644 --- a/pkgs/tools/backup/gphotos-sync/default.nix +++ b/pkgs/tools/backup/gphotos-sync/default.nix @@ -1,54 +1,80 @@ { lib , fetchFromGitHub -, python3Packages +, fetchpatch +, python3 , ffmpeg }: - -python3Packages.buildPythonApplication rec { +let + py = python3.override { + packageOverrides = self: super: { + google-auth-oauthlib = super.google-auth-oauthlib.overridePythonAttrs (oldAttrs: rec { + version = "0.5.2b1"; + src = fetchFromGitHub { + owner = "gilesknap"; + repo = "google-auth-library-python-oauthlib"; + rev = "v${version}"; + hash = "sha256-o4Jakm/JgLszumrSoTTnU+nc79Ei70abjpmn614qGyc="; + }; + }); + }; + }; +in +py.pkgs.buildPythonApplication rec { pname = "gphotos-sync"; - version = "2.14.2"; + version = "3.04"; + format = "pyproject"; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; src = fetchFromGitHub { owner = "gilesknap"; repo = "gphotos-sync"; rev = version; - sha256 = "0cfmbrdy6w18hb623rjn0a4hnn3n63jw2jlmgn4a2k1sjqhpx3bf"; + sha256 = "0mnlnqmlh3n1b6fjwpx2byl1z41vgghjb95598kz5gvdi95iirrs"; }; - propagatedBuildInputs = with python3Packages; [ + patches = [ + ./skip-network-tests.patch + ]; + + propagatedBuildInputs = with py.pkgs; [ appdirs attrs exif + google-auth-oauthlib psutil pyyaml requests-oauthlib + types-pyyaml + types-requests ]; + postPatch = '' + # this is a patched release that we include via packageOverrides above + substituteInPlace setup.cfg \ + --replace " @ https://github.com/gilesknap/google-auth-library-python-oauthlib/archive/refs/tags/v0.5.2b1.zip" "" + ''; + buildInputs = [ ffmpeg ]; - checkInputs = with python3Packages; [ - pytestCheckHook + checkInputs = with py.pkgs; [ mock + pytestCheckHook + setuptools-scm ]; - checkPhase = '' + preCheck = '' export HOME=$(mktemp -d) - - # patch to skip all tests that do network access - cat >>test/test_setup.py <