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