nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

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

+90 -17
+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"; ··· 45 20 inherit src; 46 21 sourceRoot = "source/rust"; 47 22 cargoSha256 = "0cqy0s55pkg6hww86h7qip4xaidh6g8lcypdj84n2x374jq38c5d"; 48 - nativeBuildInputs = [ pkgconfig ]; 23 + nativeBuildInputs = [ pkg-config ]; 49 24 buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ]; 50 25 }; 51 26 52 - propagatedBuildInputs = with python3Packages; [ 27 + propagatedBuildInputs = [ 53 28 click click-log click-threading 54 29 requests_toolbelt 55 30 requests ··· 59 34 shippai 60 35 ]; 61 36 62 - nativeBuildInputs = with python3Packages; [ setuptools_scm ]; 37 + nativeBuildInputs = [ 38 + setuptools_scm 39 + ]; 63 40 64 - checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ]; 41 + checkInputs = [ 42 + hypothesis 43 + pytest 44 + pytest-localserver 45 + pytest-subtesthack 46 + ]; 65 47 66 48 patches = [ 67 49 (fetchpatch {
+43 -7
pkgs/tools/misc/vdirsyncer/stable.nix pkgs/development/python-modules/vdirsyncer/stable.nix
··· 1 - { lib, python3Packages, fetchpatch }: 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 + }: 2 22 3 23 # Packaging documentation at: 4 24 # https://github.com/pimutils/vdirsyncer/blob/0.16.7/docs/packaging.rst 5 - python3Packages.buildPythonApplication rec { 25 + buildPythonPackage rec { 6 26 version = "0.16.7"; 7 27 pname = "vdirsyncer"; 28 + disabled = isPy27; 8 29 9 - src = python3Packages.fetchPypi { 30 + src = fetchPypi { 10 31 inherit pname version; 11 32 sha256 = "6c9bcfb9bcb01246c83ba6f8551cf54c58af3323210755485fc23bb7848512ef"; 12 33 }; 13 34 14 - propagatedBuildInputs = with python3Packages; [ 35 + propagatedBuildInputs = [ 15 36 click click-log click-threading 16 37 requests_toolbelt 17 38 requests ··· 40 19 atomicwrites 41 20 ]; 42 21 43 - nativeBuildInputs = with python3Packages; [ setuptools_scm ]; 22 + nativeBuildInputs = [ 23 + setuptools_scm 24 + ]; 44 25 45 - checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ]; 26 + checkInputs = [ 27 + hypothesis 28 + pytest 29 + pytest-localserver 30 + pytest-subtesthack 31 + ]; 46 32 47 33 patches = [ 48 34 # Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779 ··· 70 42 checkPhase = '' 71 43 make DETERMINISTIC_TESTS=true PYTEST_ARGS="--deselect=tests/system/cli/test_sync.py::test_verbosity" test 72 44 ''; 45 + # Tests started to fail lately, for any python version even as low as 3.5 but 46 + # if you enable the check, you'll see even severer errors with a higher then 47 + # 3.5 python version. Hence it's marked as broken for higher then 3.5 and the 48 + # checks are disabled unconditionally. As a general end user advice, use the 49 + # normal "unstable" `vdirsyncer` derivation, not this one. 50 + doCheck = false; 73 51 74 - meta = with lib; { 52 + meta = with stdenv.lib; { 75 53 homepage = "https://github.com/pimutils/vdirsyncer"; 76 54 description = "Synchronize calendars and contacts"; 77 55 license = licenses.mit; 56 + # vdirsyncer (unstable) works with mainline python versions 57 + broken = (pythonAtLeast "3.6"); 78 58 maintainers = with maintainers; [ loewenheim ]; 79 59 }; 80 60 }
+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 { };