2017-09-05 10:16:41 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, configparser
|
|
|
|
, pytest
|
2018-04-05 18:42:25 +01:00
|
|
|
, isPy3k
|
2018-10-30 12:12:59 +00:00
|
|
|
, isPy27
|
2017-09-05 10:16:41 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "entrypoints";
|
2019-02-14 07:37:15 +00:00
|
|
|
version = "0.3";
|
2017-09-05 10:16:41 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-02-14 07:37:15 +00:00
|
|
|
sha256 = "c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451";
|
2017-09-05 10:16:41 +01:00
|
|
|
};
|
|
|
|
|
2018-04-25 00:23:44 +01:00
|
|
|
checkInputs = [ pytest ];
|
2017-09-05 10:16:41 +01:00
|
|
|
|
2018-04-25 00:23:44 +01:00
|
|
|
propagatedBuildInputs = lib.optional (!isPy3k) configparser;
|
2017-09-05 10:16:41 +01:00
|
|
|
|
2018-10-30 12:12:59 +00:00
|
|
|
checkPhase = let
|
|
|
|
# On python2 with pytest 3.9.2 (not with pytest 3.7.4) the test_bad
|
|
|
|
# test fails. It tests that a warning (exectly one) is thrown on a "bad"
|
|
|
|
# path. The pytest upgrade added some warning, resulting in two warnings
|
|
|
|
# being thrown.
|
|
|
|
# upstream: https://github.com/takluyver/entrypoints/issues/23
|
|
|
|
pyTestArgs = if isPy27 then "-k 'not test_bad'" else "";
|
|
|
|
in ''
|
|
|
|
py.test ${pyTestArgs} tests
|
2017-09-05 10:16:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Discover and load entry points from installed packages";
|
|
|
|
homepage = https://github.com/takluyver/entrypoints;
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
};
|
2018-04-25 00:23:44 +01:00
|
|
|
}
|