lol

vdirsyncer: Convert to a python module (#87865)

* vdirsyncer: standardize derivation

Use toPythonApplication and use callPackage from python-packages.nix.
Make vdirsyncerStable somewhat functional again, but mark it as broken
for Python 3.6 or higher.

* vdirsyncer: use buildPythonPackage as it's a package now

* vdirsyncer: move to python-modules/

* vdirsyncer: Move disabled logic into expression

authored by

Doron Behar and committed by
GitHub
b3e7e67a 6c195563

+135 -62
+88
pkgs/development/python-modules/vdirsyncer/stable.nix
··· 1 + { stdenv 2 + , pythonAtLeast 3 + , buildPythonPackage 4 + , fetchPypi 5 + , isPy27 6 + , fetchpatch 7 + , click 8 + , click-log 9 + , click-threading 10 + , requests_toolbelt 11 + , requests 12 + , requests_oauthlib # required for google oauth sync 13 + , atomicwrites 14 + , milksnake 15 + , shippai 16 + , hypothesis 17 + , pytest 18 + , pytest-localserver 19 + , pytest-subtesthack 20 + , setuptools_scm 21 + }: 22 + 23 + # Packaging documentation at: 24 + # https://github.com/pimutils/vdirsyncer/blob/0.16.7/docs/packaging.rst 25 + buildPythonPackage rec { 26 + version = "0.16.7"; 27 + pname = "vdirsyncer"; 28 + disabled = isPy27; 29 + 30 + src = fetchPypi { 31 + inherit pname version; 32 + sha256 = "6c9bcfb9bcb01246c83ba6f8551cf54c58af3323210755485fc23bb7848512ef"; 33 + }; 34 + 35 + propagatedBuildInputs = [ 36 + click click-log click-threading 37 + requests_toolbelt 38 + requests 39 + requests_oauthlib # required for google oauth sync 40 + atomicwrites 41 + ]; 42 + 43 + nativeBuildInputs = [ 44 + setuptools_scm 45 + ]; 46 + 47 + checkInputs = [ 48 + hypothesis 49 + pytest 50 + pytest-localserver 51 + pytest-subtesthack 52 + ]; 53 + 54 + patches = [ 55 + # Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779 56 + (fetchpatch { 57 + url = "https://github.com/pimutils/vdirsyncer/commit/22ad88a6b18b0979c5d1f1d610c1d2f8f87f4b89.patch"; 58 + sha256 = "0dbzj6jlxhdidnm3i21a758z83sdiwzhpd45pbkhycfhgmqmhjpl"; 59 + }) 60 + ]; 61 + 62 + postPatch = '' 63 + # Invalid argument: 'perform_health_check' is not a valid setting 64 + substituteInPlace tests/conftest.py \ 65 + --replace "perform_health_check=False" "" 66 + substituteInPlace tests/unit/test_repair.py \ 67 + --replace $'@settings(perform_health_check=False) # Using the random module for UIDs\n' "" 68 + ''; 69 + 70 + checkPhase = '' 71 + make DETERMINISTIC_TESTS=true PYTEST_ARGS="--deselect=tests/system/cli/test_sync.py::test_verbosity" test 72 + ''; 73 + # Tests started to fail lately, for any python version even as low as 3.5 but 74 + # if you enable the check, you'll see even severer errors with a higher then 75 + # 3.5 python version. Hence it's marked as broken for higher then 3.5 and the 76 + # checks are disabled unconditionally. As a general end user advice, use the 77 + # normal "unstable" `vdirsyncer` derivation, not this one. 78 + doCheck = false; 79 + 80 + meta = with stdenv.lib; { 81 + homepage = "https://github.com/pimutils/vdirsyncer"; 82 + description = "Synchronize calendars and contacts"; 83 + license = licenses.mit; 84 + # vdirsyncer (unstable) works with mainline python versions 85 + broken = (pythonAtLeast "3.6"); 86 + maintainers = with maintainers; [ loewenheim ]; 87 + }; 88 + }
+38 -6
pkgs/tools/misc/vdirsyncer/default.nix pkgs/development/python-modules/vdirsyncer/default.nix
··· 1 - { stdenv, python3Packages, fetchFromGitHub, fetchpatch, rustPlatform, pkgconfig, openssl, CoreServices, Security }: 1 + { stdenv 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , isPy27 5 + , fetchpatch 6 + , rustPlatform 7 + , pkg-config 8 + , openssl 9 + , CoreServices 10 + , Security 11 + , click 12 + , click-log 13 + , click-threading 14 + , requests_toolbelt 15 + , requests 16 + , requests_oauthlib # required for google oauth sync 17 + , atomicwrites 18 + , milksnake 19 + , shippai 20 + , hypothesis 21 + , pytest 22 + , pytest-localserver 23 + , pytest-subtesthack 24 + , setuptools_scm 25 + }: 2 26 3 27 # Packaging documentation at: 4 28 # https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst 5 - python3Packages.buildPythonApplication rec { 29 + buildPythonPackage rec { 6 30 version = "unstable-2018-08-05"; 7 31 pname = "vdirsyncer"; 8 32 name = "${pname}-${version}"; 33 + disabled = isPy27; 9 34 10 35 src = fetchFromGitHub { 11 36 owner = "spk"; ··· 20 45 inherit src; 21 46 sourceRoot = "source/rust"; 22 47 cargoSha256 = "0cqy0s55pkg6hww86h7qip4xaidh6g8lcypdj84n2x374jq38c5d"; 23 - nativeBuildInputs = [ pkgconfig ]; 48 + nativeBuildInputs = [ pkg-config ]; 24 49 buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ]; 25 50 }; 26 51 27 - propagatedBuildInputs = with python3Packages; [ 52 + propagatedBuildInputs = [ 28 53 click click-log click-threading 29 54 requests_toolbelt 30 55 requests ··· 34 59 shippai 35 60 ]; 36 61 37 - nativeBuildInputs = with python3Packages; [ setuptools_scm ]; 62 + nativeBuildInputs = [ 63 + setuptools_scm 64 + ]; 38 65 39 - checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ]; 66 + checkInputs = [ 67 + hypothesis 68 + pytest 69 + pytest-localserver 70 + pytest-subtesthack 71 + ]; 40 72 41 73 patches = [ 42 74 (fetchpatch {
-52
pkgs/tools/misc/vdirsyncer/stable.nix
··· 1 - { lib, python3Packages, fetchpatch }: 2 - 3 - # Packaging documentation at: 4 - # https://github.com/pimutils/vdirsyncer/blob/0.16.7/docs/packaging.rst 5 - python3Packages.buildPythonApplication rec { 6 - version = "0.16.7"; 7 - pname = "vdirsyncer"; 8 - 9 - src = python3Packages.fetchPypi { 10 - inherit pname version; 11 - sha256 = "6c9bcfb9bcb01246c83ba6f8551cf54c58af3323210755485fc23bb7848512ef"; 12 - }; 13 - 14 - propagatedBuildInputs = with python3Packages; [ 15 - click click-log click-threading 16 - requests_toolbelt 17 - requests 18 - requests_oauthlib # required for google oauth sync 19 - atomicwrites 20 - ]; 21 - 22 - nativeBuildInputs = with python3Packages; [ setuptools_scm ]; 23 - 24 - checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ]; 25 - 26 - patches = [ 27 - # Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779 28 - (fetchpatch { 29 - url = "https://github.com/pimutils/vdirsyncer/commit/22ad88a6b18b0979c5d1f1d610c1d2f8f87f4b89.patch"; 30 - sha256 = "0dbzj6jlxhdidnm3i21a758z83sdiwzhpd45pbkhycfhgmqmhjpl"; 31 - }) 32 - ]; 33 - 34 - postPatch = '' 35 - # Invalid argument: 'perform_health_check' is not a valid setting 36 - substituteInPlace tests/conftest.py \ 37 - --replace "perform_health_check=False" "" 38 - substituteInPlace tests/unit/test_repair.py \ 39 - --replace $'@settings(perform_health_check=False) # Using the random module for UIDs\n' "" 40 - ''; 41 - 42 - checkPhase = '' 43 - make DETERMINISTIC_TESTS=true PYTEST_ARGS="--deselect=tests/system/cli/test_sync.py::test_verbosity" test 44 - ''; 45 - 46 - meta = with lib; { 47 - homepage = "https://github.com/pimutils/vdirsyncer"; 48 - description = "Synchronize calendars and contacts"; 49 - license = licenses.mit; 50 - maintainers = with maintainers; [ loewenheim ]; 51 - }; 52 - }
+2 -4
pkgs/top-level/all-packages.nix
··· 22369 22369 22370 22370 vcv-rack = callPackage ../applications/audio/vcv-rack { }; 22371 22371 22372 - vdirsyncer = callPackage ../tools/misc/vdirsyncer { 22373 - inherit (darwin.apple_sdk.frameworks) CoreServices Security; 22374 - }; 22372 + vdirsyncer = with python3Packages; toPythonApplication vdirsyncer; 22375 22373 22376 - vdirsyncerStable = callPackage ../tools/misc/vdirsyncer/stable.nix { }; 22374 + vdirsyncerStable = with python3Packages; toPythonApplication vdirsyncerStable; 22377 22375 22378 22376 vdpauinfo = callPackage ../tools/X11/vdpauinfo { }; 22379 22377
+7
pkgs/top-level/python-packages.nix
··· 1607 1607 1608 1608 vdf = callPackage ../development/python-modules/vdf { }; 1609 1609 1610 + vdirsyncer = callPackage ../development/python-modules/vdirsyncer { 1611 + inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices Security; 1612 + inherit (pkgs) pkg-config openssl rustPlatform; 1613 + }; 1614 + 1615 + vdirsyncerStable = callPackage ../development/python-modules/vdirsyncer/stable.nix { }; 1616 + 1610 1617 vidstab = callPackage ../development/python-modules/vidstab { }; 1611 1618 1612 1619 webapp2 = callPackage ../development/python-modules/webapp2 { };