summary refs log tree commit diff
path: root/pkgs/development/python-modules/importlib-resources/default.nix
blob: 6fba0a703e1661c2324974c61db133fed64a8018 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib
, buildPythonPackage
, fetchPypi
, pathlib2
, typing
, isPy3k
, pythonOlder
, python
}:

buildPythonPackage rec {
  pname = "importlib_resources";
  version = "1.0.2";

  src = fetchPypi {
    inherit pname version;
    sha256 = "d3279fd0f6f847cced9f7acc19bd3e5df54d34f93a2e7bb5f238f81545787078";
  };

  propagatedBuildInputs = [
  ] ++ lib.optional (!isPy3k) pathlib2
    ++ lib.optional (pythonOlder "3.5") typing
  ;

  checkPhase = ''
    ${python.interpreter} -m unittest discover
  '';

  meta = with lib; {
    description = "Read resources from Python packages";
    homepage = "https://importlib-resources.readthedocs.io/";
    license = licenses.asl20;
  };
}