@@ -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}