1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, nose
6, lxml
7, requests
8, six
9}:
10
11buildPythonPackage rec {
12 pname = "pyxnat";
13 version = "1.5";
14 disabled = pythonOlder "3.7";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-Y8mj6OfZXyE1q3C8HyVzGySuZB6rLSsL/CV/7axxaec=";
19 };
20
21 propagatedBuildInputs = [
22 lxml
23 requests
24 six
25 ];
26
27 # future is not used, and pathlib is installed part of python38+
28 # w/o an external package
29 prePatch = ''
30 substituteInPlace setup.py \
31 --replace "pathlib>=1.0" "" \
32 --replace "future>=0.16" ""
33 '';
34
35 nativeCheckInputs = [ nose ];
36 checkPhase = "nosetests pyxnat/tests";
37 doCheck = false; # requires a docker container running an XNAT server
38
39 pythonImportsCheck = [ "pyxnat" ];
40
41 meta = with lib; {
42 homepage = "https://pyxnat.github.io/pyxnat";
43 description = "Python API to XNAT";
44 license = licenses.bsd3;
45 maintainers = with maintainers; [ bcdarwin ];
46 };
47}