2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
|
|
|
lxml,
|
|
|
|
matplotlib,
|
|
|
|
networkx,
|
|
|
|
pandas,
|
|
|
|
requests,
|
|
|
|
setuptools,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyxnat";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.6.2";
|
|
|
|
pyproject = true;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
# PyPI dist missing test configuration files:
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pyxnat";
|
|
|
|
repo = "pyxnat";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-21nTIYbIYlFWNJTxqsuijamqRunpdc7/VBawvrWadWI=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
lxml
|
|
|
|
requests
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
# pathlib is installed part of python38+ w/o an external package
|
2021-03-20 04:20:00 +00:00
|
|
|
prePatch = ''
|
2024-06-05 15:53:02 +00:00
|
|
|
substituteInPlace setup.py --replace-fail "pathlib>=1.0" ""
|
2023-08-04 22:07:22 +00:00
|
|
|
sed -i '/--cov/d' setup.cfg
|
2021-03-20 04:20:00 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
matplotlib
|
|
|
|
networkx
|
|
|
|
pandas
|
|
|
|
];
|
|
|
|
preCheck = ''
|
|
|
|
export PYXNAT_SKIP_NETWORK_TESTS=1
|
|
|
|
'';
|
|
|
|
pytestFlagsArray = [ "pyxnat" ];
|
|
|
|
disabledTestPaths = [
|
2024-06-05 15:53:02 +00:00
|
|
|
# require a running local XNAT instance e.g. in a docker container:
|
|
|
|
"pyxnat/tests/attributes_test.py"
|
|
|
|
"pyxnat/tests/custom_variables_test.py"
|
|
|
|
"pyxnat/tests/interfaces_test.py"
|
2023-08-04 22:07:22 +00:00
|
|
|
"pyxnat/tests/pipelines_test.py"
|
2024-06-05 15:53:02 +00:00
|
|
|
"pyxnat/tests/provenance_test.py"
|
|
|
|
"pyxnat/tests/prearchive_test.py"
|
|
|
|
"pyxnat/tests/repr_test.py"
|
|
|
|
"pyxnat/tests/resources_test.py"
|
2023-08-04 22:07:22 +00:00
|
|
|
"pyxnat/tests/search_test.py"
|
2024-06-05 15:53:02 +00:00
|
|
|
"pyxnat/tests/sessionmirror_test.py"
|
|
|
|
"pyxnat/tests/test_resource_functions.py"
|
2023-08-04 22:07:22 +00:00
|
|
|
"pyxnat/tests/user_and_project_management_test.py"
|
|
|
|
];
|
|
|
|
disabledTests = [
|
|
|
|
# try to access network even though PYXNAT_SKIP_NETWORK_TESTS is set:
|
|
|
|
"test_inspector_structure"
|
2024-06-05 15:53:02 +00:00
|
|
|
"test_project_manager"
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "pyxnat" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://pyxnat.github.io/pyxnat";
|
|
|
|
description = "Python API to XNAT";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "sessionmirror.py";
|
2023-08-04 22:07:22 +00:00
|
|
|
changelog = "https://github.com/pyxnat/pyxnat/releases/tag/${version}";
|
2020-09-25 04:45:31 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|