nixpkgs/pkgs/development/python-modules/pipdate/default.nix

53 lines
1.0 KiB
Nix
Raw Normal View History

2019-05-20 14:54:11 +00:00
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, isPy27
2019-05-20 14:54:11 +00:00
, appdirs
, importlib-metadata
2019-05-20 14:54:11 +00:00
, requests
, pytest
}:
buildPythonPackage rec {
pname = "pipdate";
2020-07-31 08:56:43 +00:00
version = "0.5.2";
disabled = isPy27; # abandoned
2019-05-20 14:54:11 +00:00
src = fetchPypi {
inherit pname version;
2020-07-31 08:56:43 +00:00
sha256 = "507065231f2d50b6319d483432cba82aadad78be21b7a2969b5881ed8dee9ab4";
2019-05-20 14:54:11 +00:00
};
propagatedBuildInputs = [
appdirs
requests
] ++ lib.optionals (pythonOlder "3.8") [
importlib-metadata
2019-05-20 14:54:11 +00:00
];
# can be removed when https://github.com/nschloe/pipdate/pull/41 gets merged
postPatch = ''
substituteInPlace setup.cfg \
--replace "importlib_metadata" "importlib_metadata; python_version < \"3.8\""
'';
2019-05-20 14:54:11 +00:00
checkInputs = [
pytest
];
checkPhase = ''
HOME=$(mktemp -d) pytest test/test_pipdate.py
'';
# tests require network access
doCheck = false;
meta = with lib; {
description = "pip update helpers";
homepage = "https://github.com/nschloe/pipdate";
2019-05-20 14:54:11 +00:00
license = licenses.mit;
maintainers = [ maintainers.costrouc ];
};
}