1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
6, lxml
7, matplotlib
8, networkx
9, pandas
10, requests
11, six
12}:
13
14buildPythonPackage rec {
15 pname = "pyxnat";
16 version = "1.6";
17 disabled = pythonOlder "3.8";
18
19 # PyPI dist missing test configuration files:
20 src = fetchFromGitHub {
21 owner = "pyxnat";
22 repo = "pyxnat";
23 rev = "refs/tags/${version}";
24 hash = "sha256-QejYisvQFN7CsDOx9wAgTHmRZcSEqgIr8twG4XucfZ4=";
25 };
26
27 propagatedBuildInputs = [
28 lxml
29 requests
30 six
31 ];
32
33 # future is not used, and pathlib is installed part of python38+
34 # w/o an external package
35 prePatch = ''
36 substituteInPlace setup.py \
37 --replace "pathlib>=1.0" "" \
38 --replace "future>=0.16" ""
39 sed -i '/--cov/d' setup.cfg
40 '';
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 matplotlib
45 networkx
46 pandas
47 ];
48 preCheck = ''
49 export PYXNAT_SKIP_NETWORK_TESTS=1
50 '';
51 pytestFlagsArray = [ "pyxnat" ];
52 disabledTestPaths = [
53 # try to access network even though PYXNAT_SKIP_NETWORK_TESTS is set:
54 "pyxnat/tests/pipelines_test.py"
55 "pyxnat/tests/search_test.py"
56 "pyxnat/tests/user_and_project_management_test.py"
57 ];
58 disabledTests = [
59 # try to access network even though PYXNAT_SKIP_NETWORK_TESTS is set:
60 "test_ashs_volumes"
61 "test_inspector_structure"
62 ];
63
64 pythonImportsCheck = [ "pyxnat" ];
65
66 meta = with lib; {
67 homepage = "https://pyxnat.github.io/pyxnat";
68 description = "Python API to XNAT";
69 changelog = "https://github.com/pyxnat/pyxnat/releases/tag/${version}";
70 license = licenses.bsd3;
71 maintainers = with maintainers; [ bcdarwin ];
72 };
73}