2020-05-17 09:19:40 +01:00
|
|
|
{ stdenv
|
|
|
|
, pythonAtLeast
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPy27
|
|
|
|
, fetchpatch
|
|
|
|
, click
|
|
|
|
, click-log
|
|
|
|
, click-threading
|
|
|
|
, requests_toolbelt
|
|
|
|
, requests
|
|
|
|
, requests_oauthlib # required for google oauth sync
|
|
|
|
, atomicwrites
|
|
|
|
, milksnake
|
|
|
|
, shippai
|
|
|
|
, hypothesis
|
|
|
|
, pytest
|
|
|
|
, pytest-localserver
|
|
|
|
, pytest-subtesthack
|
|
|
|
, setuptools_scm
|
|
|
|
}:
|
2019-04-06 12:47:41 +01:00
|
|
|
|
|
|
|
# Packaging documentation at:
|
|
|
|
# https://github.com/pimutils/vdirsyncer/blob/0.16.7/docs/packaging.rst
|
2020-05-17 09:19:40 +01:00
|
|
|
buildPythonPackage rec {
|
2019-04-06 12:47:41 +01:00
|
|
|
version = "0.16.7";
|
|
|
|
pname = "vdirsyncer";
|
2020-05-17 09:19:40 +01:00
|
|
|
disabled = isPy27;
|
2019-04-06 12:47:41 +01:00
|
|
|
|
2020-05-17 09:19:40 +01:00
|
|
|
src = fetchPypi {
|
2019-04-06 12:47:41 +01:00
|
|
|
inherit pname version;
|
|
|
|
sha256 = "6c9bcfb9bcb01246c83ba6f8551cf54c58af3323210755485fc23bb7848512ef";
|
|
|
|
};
|
|
|
|
|
2020-05-17 09:19:40 +01:00
|
|
|
propagatedBuildInputs = [
|
2019-04-06 12:47:41 +01:00
|
|
|
click click-log click-threading
|
|
|
|
requests_toolbelt
|
|
|
|
requests
|
|
|
|
requests_oauthlib # required for google oauth sync
|
|
|
|
atomicwrites
|
|
|
|
];
|
|
|
|
|
2020-05-17 09:19:40 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools_scm
|
|
|
|
];
|
2019-04-06 12:47:41 +01:00
|
|
|
|
2020-05-17 09:19:40 +01:00
|
|
|
checkInputs = [
|
|
|
|
hypothesis
|
|
|
|
pytest
|
|
|
|
pytest-localserver
|
|
|
|
pytest-subtesthack
|
|
|
|
];
|
2019-04-06 12:47:41 +01:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779
|
|
|
|
(fetchpatch {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://github.com/pimutils/vdirsyncer/commit/22ad88a6b18b0979c5d1f1d610c1d2f8f87f4b89.patch";
|
2019-04-06 12:47:41 +01:00
|
|
|
sha256 = "0dbzj6jlxhdidnm3i21a758z83sdiwzhpd45pbkhycfhgmqmhjpl";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Invalid argument: 'perform_health_check' is not a valid setting
|
|
|
|
substituteInPlace tests/conftest.py \
|
|
|
|
--replace "perform_health_check=False" ""
|
|
|
|
substituteInPlace tests/unit/test_repair.py \
|
|
|
|
--replace $'@settings(perform_health_check=False) # Using the random module for UIDs\n' ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
2020-04-28 10:20:00 +01:00
|
|
|
make DETERMINISTIC_TESTS=true PYTEST_ARGS="--deselect=tests/system/cli/test_sync.py::test_verbosity" test
|
2019-04-06 12:47:41 +01:00
|
|
|
'';
|
2020-05-17 09:19:40 +01:00
|
|
|
# Tests started to fail lately, for any python version even as low as 3.5 but
|
|
|
|
# if you enable the check, you'll see even severer errors with a higher then
|
|
|
|
# 3.5 python version. Hence it's marked as broken for higher then 3.5 and the
|
|
|
|
# checks are disabled unconditionally. As a general end user advice, use the
|
|
|
|
# normal "unstable" `vdirsyncer` derivation, not this one.
|
|
|
|
doCheck = false;
|
2019-04-06 12:47:41 +01:00
|
|
|
|
2020-05-17 09:19:40 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/pimutils/vdirsyncer";
|
2019-04-06 12:47:41 +01:00
|
|
|
description = "Synchronize calendars and contacts";
|
|
|
|
license = licenses.mit;
|
2020-05-17 09:19:40 +01:00
|
|
|
# vdirsyncer (unstable) works with mainline python versions
|
|
|
|
broken = (pythonAtLeast "3.6");
|
2019-04-06 12:47:41 +01:00
|
|
|
maintainers = with maintainers; [ loewenheim ];
|
|
|
|
};
|
|
|
|
}
|