git.iko.soy/typeable/nixpkgs
on master help sign in
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

commitb3e7e67a5e7fe812fed3fe3b83d22fa853eda2a4 authorDoron Behar <doron.behar@gmail.com> dateSun 17 May 2020, 11:19 (7 years ago) parent6c19556
4 files changed+90−17
pkgs/tools/misc/vdirsyncer/default.nix → pkgs/development/python-modules/vdirsyncer/default.nix+38−6 pkgs/tools/misc/vdirsyncer/stable.nix → pkgs/development/python-modules/vdirsyncer/stable.nix+43−7 pkgs/top-level/all-packages.nix+2−4 pkgs/top-level/python-packages.nix+7
pkgs/tools/misc/vdirsyncer/default.nix → pkgs/development/python-modules/vdirsyncer/default.nixrenamed+38−6
@@ -1,11 +1,36 @@
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+}:
226
327# Packaging documentation at:
428# https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
5−python3Packages.buildPythonApplication rec {
29+buildPythonPackage rec {
630 version = "unstable-2018-08-05";
731 pname = "vdirsyncer";
832 name = "${pname}-${version}";
33+ disabled = isPy27;
934
1035 src = fetchFromGitHub {
1136 owner = "spk";
@@ -20,11 +45,11 @@ python3Packages.buildPythonApplication rec {
2045 inherit src;
2146 sourceRoot = "source/rust";
2247 cargoSha256 = "0cqy0s55pkg6hww86h7qip4xaidh6g8lcypdj84n2x374jq38c5d";
23− nativeBuildInputs = [ pkgconfig ];
48+ nativeBuildInputs = [ pkg-config ];
2449 buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
2550 };
2651
27− propagatedBuildInputs = with python3Packages; [
52+ propagatedBuildInputs = [
2853 click click-log click-threading
2954 requests_toolbelt
3055 requests
@@ -34,9 +59,16 @@ python3Packages.buildPythonApplication rec {
3459 shippai
3560 ];
3661
37− nativeBuildInputs = with python3Packages; [ setuptools_scm ];
62+ nativeBuildInputs = [
63+ setuptools_scm
64+ ];
3865
39− checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ];
66+ checkInputs = [
67+ hypothesis
68+ pytest
69+ pytest-localserver
70+ pytest-subtesthack
71+ ];
4072
4173 patches = [
4274 (fetchpatch {
pkgs/tools/misc/vdirsyncer/stable.nix → pkgs/development/python-modules/vdirsyncer/stable.nixrenamed+43−7
@@ -1,17 +1,38 @@
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+}:
222
323# Packaging documentation at:
424# https://github.com/pimutils/vdirsyncer/blob/0.16.7/docs/packaging.rst
5−python3Packages.buildPythonApplication rec {
25+buildPythonPackage rec {
626 version = "0.16.7";
727 pname = "vdirsyncer";
28+ disabled = isPy27;
829
9− src = python3Packages.fetchPypi {
30+ src = fetchPypi {
1031 inherit pname version;
1132 sha256 = "6c9bcfb9bcb01246c83ba6f8551cf54c58af3323210755485fc23bb7848512ef";
1233 };
1334
14− propagatedBuildInputs = with python3Packages; [
35+ propagatedBuildInputs = [
1536 click click-log click-threading
1637 requests_toolbelt
1738 requests
@@ -19,9 +40,16 @@ python3Packages.buildPythonApplication rec {
1940 atomicwrites
2041 ];
2142
22− nativeBuildInputs = with python3Packages; [ setuptools_scm ];
43+ nativeBuildInputs = [
44+ setuptools_scm
45+ ];
2346
24− checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ];
47+ checkInputs = [
48+ hypothesis
49+ pytest
50+ pytest-localserver
51+ pytest-subtesthack
52+ ];
2553
2654 patches = [
2755 # Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779
@@ -42,11 +70,19 @@ python3Packages.buildPythonApplication rec {
4270 checkPhase = ''
4371 make DETERMINISTIC_TESTS=true PYTEST_ARGS="--deselect=tests/system/cli/test_sync.py::test_verbosity" test
4472 '';
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;
4579
46− meta = with lib; {
80+ meta = with stdenv.lib; {
4781 homepage = "https://github.com/pimutils/vdirsyncer";
4882 description = "Synchronize calendars and contacts";
4983 license = licenses.mit;
84+ # vdirsyncer (unstable) works with mainline python versions
85+ broken = (pythonAtLeast "3.6");
5086 maintainers = with maintainers; [ loewenheim ];
5187 };
5288}
pkgs/top-level/all-packages.nix+2−4
@@ -22369,11 +22369,9 @@ in
2236922369
2237022370 vcv-rack = callPackage ../applications/audio/vcv-rack { };
2237122371
22372− vdirsyncer = callPackage ../tools/misc/vdirsyncer {
22373− inherit (darwin.apple_sdk.frameworks) CoreServices Security;
22374− };
22372+ vdirsyncer = with python3Packages; toPythonApplication vdirsyncer;
2237522373
22376− vdirsyncerStable = callPackage ../tools/misc/vdirsyncer/stable.nix { };
22374+ vdirsyncerStable = with python3Packages; toPythonApplication vdirsyncerStable;
2237722375
2237822376 vdpauinfo = callPackage ../tools/X11/vdpauinfo { };
2237922377
pkgs/top-level/python-packages.nix+7
@@ -1607,6 +1607,13 @@ in {
16071607
16081608 vdf = callPackage ../development/python-modules/vdf { };
16091609
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+
16101617 vidstab = callPackage ../development/python-modules/vidstab { };
16111618
16121619 webapp2 = callPackage ../development/python-modules/webapp2 { };