anchor.diff:      shippai
     ];
   
  -  buildInputs = with pythonPackages; [ setuptools_scm ];
  +  buildInputs = with python3Packages; [ setuptools_scm ];
   
  -  checkInputs = with pythonPackages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ];
  +  checkInputs = with python3Packages; [ hypothesis pytest pytest-localserver pytest-subtesthack ] ++ [ glibcLocales ];
   
     patches = [
  -    (fetchpatch {
  -      url = https://github.com/pimutils/vdirsyncer/commit/80a42e4c6c18ca4db737bc6700c50a3866832bbb.patch;
  -      sha256 = "1vrhn0ma3y08w6f5abhl3r5rq30g60h1bp3wmyszw909hyvyzp5l";
  -    })
  +    # Fixes for hypothesis: https://github.com/pimutils/vdirsyncer/pull/779
       (fetchpatch {
         url = https://github.com/pimutils/vdirsyncer/commit/22ad88a6b18b0979c5d1f1d610c1d2f8f87f4b89.patch;
         sha256 = "0dbzj6jlxhdidnm3i21a758z83sdiwzhpd45pbkhycfhgmqmhjpl";
  
positive.code: { stdenv, python3Packages, fetchpatch, glibcLocales, rustPlatform, pkgconfig, openssl, Security }:
  
  # Packaging documentation at:
  # https://github.com/untitaker/vdirsyncer/blob/master/docs/packaging.rst
  let
    pythonPackages = python3Packages;
    version = "0.17.0a3";
    pname = "vdirsyncer";
    name = pname + "-" + version;
    src = pythonPackages.fetchPypi {
      inherit pname version;
      sha256 = "1n7izfa5x9mh0b4zp20gd8qxfcca5wpjh834bsbi5pk6zam5pfdy";
    };
    native = rustPlatform.buildRustPackage {
      name = name + "-native";
      inherit src;
      sourceRoot = name + "/rust";
      cargoSha256 = "08xq9q5fx37azzkqqgwcnds1yd8687gh26dsl3ivql5h13fa2w3q";
      buildInputs = [ pkgconfig openssl ] ++ stdenv.lib.optional stdenv.isDarwin Security;
    };
  in pythonPackages.buildPythonApplication rec {
    inherit version pname src native;
  
    propagatedBuildInputs = with pythonPackages; [
      click click-log click-threading
      requests_toolbelt
      requests
  
negative.code: 
    checkPhase = ''
      rm -rf vdirsyncer
      export PYTHONPATH=$out/${python3Packages.python.sitePackages}:$PYTHONPATH
      make DETERMINISTIC_TESTS=true test
    '';
  
  