lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

gphotos-sync: 2.14.2 -> 3.04

authored by

David Reiss and committed by
Robert Schütz
c9ba04ce 39dff39c

+65 -18
+44 -18
pkgs/tools/backup/gphotos-sync/default.nix
··· 1 1 { lib 2 2 , fetchFromGitHub 3 - , python3Packages 3 + , fetchpatch 4 + , python3 4 5 , ffmpeg 5 6 }: 7 + let 8 + py = python3.override { 9 + packageOverrides = self: super: { 10 + google-auth-oauthlib = super.google-auth-oauthlib.overridePythonAttrs (oldAttrs: rec { 11 + version = "0.5.2b1"; 12 + src = fetchFromGitHub { 13 + owner = "gilesknap"; 14 + repo = "google-auth-library-python-oauthlib"; 15 + rev = "v${version}"; 16 + hash = "sha256-o4Jakm/JgLszumrSoTTnU+nc79Ei70abjpmn614qGyc="; 17 + }; 18 + }); 19 + }; 20 + }; 21 + in 22 + py.pkgs.buildPythonApplication rec { 23 + pname = "gphotos-sync"; 24 + version = "3.04"; 25 + format = "pyproject"; 6 26 7 - python3Packages.buildPythonApplication rec { 8 - pname = "gphotos-sync"; 9 - version = "2.14.2"; 27 + SETUPTOOLS_SCM_PRETEND_VERSION = version; 10 28 11 29 src = fetchFromGitHub { 12 30 owner = "gilesknap"; 13 31 repo = "gphotos-sync"; 14 32 rev = version; 15 - sha256 = "0cfmbrdy6w18hb623rjn0a4hnn3n63jw2jlmgn4a2k1sjqhpx3bf"; 33 + sha256 = "0mnlnqmlh3n1b6fjwpx2byl1z41vgghjb95598kz5gvdi95iirrs"; 16 34 }; 17 35 18 - propagatedBuildInputs = with python3Packages; [ 36 + patches = [ 37 + ./skip-network-tests.patch 38 + ]; 39 + 40 + propagatedBuildInputs = with py.pkgs; [ 19 41 appdirs 20 42 attrs 21 43 exif 44 + google-auth-oauthlib 22 45 psutil 23 46 pyyaml 24 47 requests-oauthlib 48 + types-pyyaml 49 + types-requests 25 50 ]; 26 51 52 + postPatch = '' 53 + # this is a patched release that we include via packageOverrides above 54 + substituteInPlace setup.cfg \ 55 + --replace " @ https://github.com/gilesknap/google-auth-library-python-oauthlib/archive/refs/tags/v0.5.2b1.zip" "" 56 + ''; 57 + 27 58 buildInputs = [ 28 59 ffmpeg 29 60 ]; 30 61 31 - checkInputs = with python3Packages; [ 62 + checkInputs = with py.pkgs; [ 63 + mock 32 64 pytestCheckHook 33 - mock 65 + setuptools-scm 34 66 ]; 35 67 36 - checkPhase = '' 68 + preCheck = '' 37 69 export HOME=$(mktemp -d) 38 - 39 - # patch to skip all tests that do network access 40 - cat >>test/test_setup.py <<EOF 41 - import pytest, requests 42 - requests.Session.__init__ = lambda *args, **kwargs: pytest.skip("no network access") 43 - EOF 44 - 45 - pytestCheckPhase 70 + substituteInPlace setup.cfg \ 71 + --replace "--cov=gphotos_sync --cov-report term --cov-report xml:cov.xml" "" 46 72 ''; 47 73 48 74 meta = with lib; { 49 75 description = "Google Photos and Albums backup with Google Photos Library API"; 50 76 homepage = "https://github.com/gilesknap/gphotos-sync"; 51 - license = licenses.mit; 77 + license = licenses.asl20; 52 78 maintainers = with maintainers; [ dnr ]; 53 79 }; 54 80 }
+21
pkgs/tools/backup/gphotos-sync/skip-network-tests.patch
··· 1 + diff --git a/tests/test_setup.py b/tests/test_setup.py 2 + index 085b110..ea4a7d2 100644 3 + --- a/tests/test_setup.py 4 + +++ b/tests/test_setup.py 5 + @@ -45,7 +45,8 @@ class SetupDbAndCredentials: 6 + return self 7 + 8 + def __exit__(self, exc_type=None, exc_value=None, traceback=None): 9 + - self.gp.google_photos_down.close() 10 + + if hasattr(self.gp, 'google_photos_down'): 11 + + self.gp.google_photos_down.close() 12 + 13 + def test_setup(self, test_name, args=None, trash_db=False, trash_files=False): 14 + self.root = Path("/tmp/gpTests/{}".format(test_name)) 15 + @@ -76,3 +77,6 @@ class SetupDbAndCredentials: 16 + 17 + def test_done(self): 18 + self.gp.data_store.store() 19 + + 20 + +import pytest, requests 21 + +requests.Session.__init__ = lambda *args, **kwargs: pytest.skip("no network access")