summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyxnat/default.nix
blob: 1dcacf19a13a21548ab9184c2ff5aa694dda7b22 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, nose
, lxml
, requests
, six
}:

buildPythonPackage rec {
  pname = "pyxnat";
  version = "1.5";
  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-Y8mj6OfZXyE1q3C8HyVzGySuZB6rLSsL/CV/7axxaec=";
  };

  propagatedBuildInputs = [
    lxml
    requests
    six
  ];

  # future is not used, and pathlib is installed part of python38+
  # w/o an external package
  prePatch = ''
    substituteInPlace setup.py \
      --replace "pathlib>=1.0" "" \
      --replace "future>=0.16" ""
  '';

  checkInputs = [ nose ];
  checkPhase = "nosetests pyxnat/tests";
  doCheck = false;  # requires a docker container running an XNAT server

  pythonImportsCheck = [ "pyxnat" ];

  meta = with lib; {
    homepage = "https://pyxnat.github.io/pyxnat";
    description = "Python API to XNAT";
    license = licenses.bsd3;
    maintainers = with maintainers; [ bcdarwin ];
  };
}