anchor.diff:  , pythonOlder
   , attrs
   , bitstruct
  +, click
   , future
   , pathlib2
   , typing
  
positive.code: 
  buildPythonPackage rec {
    pname = "canmatrix";
    version = "0.8";
  
    # uses fetchFromGitHub as PyPi release misses test/ dir
    src = fetchFromGitHub {
      owner = "ebroecker";
      repo = pname;
      rev = version;
      sha256 = "1wzflapyj2j4xsi7d7gfmznmxbgr658n092xyq9nac46rbhpcphg";
    };
  
    propagatedBuildInputs = [
      # required
      attrs
      bitstruct
      future
      pathlib2
      # optional
  
negative.code:     pyyaml
    ] ++ lib.optional (pythonOlder "3.5") typing;
  
    postPatch = ''
      substituteInPlace setup.py \
        --replace "version = versioneer.get_version()" "version = \"${version}\""
    '';
  
    checkInputs = [
      pytest
    ];
  
    # long_envvar_name_imports requires stable key value pair ordering
    checkPhase = ''
      pytest -s src/canmatrix -k 'not long_envvar_name_imports'
    '';
  
    meta = with lib; {
  