1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 formulaic,
7 frozendict,
8 click,
9 num2words,
10 numpy,
11 scipy,
12 pandas,
13 nibabel,
14 bids-validator,
15 sqlalchemy,
16 universal-pathlib,
17 pytestCheckHook,
18 versioneer,
19}:
20
21buildPythonPackage rec {
22 pname = "pybids";
23 version = "0.19.0";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "bids-standard";
28 repo = "pybids";
29 tag = version;
30 hash = "sha256-x1OlqfuRZvfWwOt+WTR8lAtOPWcrsymQyXPfiEj4lk4=";
31 };
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
36 '';
37
38 pythonRelaxDeps = [
39 "formulaic"
40 "sqlalchemy"
41 ];
42
43 build-system = [
44 setuptools
45 versioneer
46 ] ++ versioneer.optional-dependencies.toml;
47
48 dependencies = [
49 bids-validator
50 click
51 formulaic
52 frozendict
53 nibabel
54 num2words
55 numpy
56 pandas
57 scipy
58 sqlalchemy
59 universal-pathlib
60 ];
61
62 pythonImportsCheck = [ "bids" ];
63
64 nativeCheckInputs = [ pytestCheckHook ];
65
66 disabledTestPaths = [
67 # Could not connect to the endpoint URL
68 "src/bids/layout/tests/test_remote_bids.py"
69 ];
70
71 disabledTests = [
72 # Regression associated with formulaic >= 0.6.0
73 # (see https://github.com/bids-standard/pybids/issues/1000)
74 "test_split"
75 ];
76
77 meta = {
78 description = "Python tools for querying and manipulating BIDS datasets";
79 homepage = "https://github.com/bids-standard/pybids";
80 changelog = "https://github.com/bids-standard/pybids/blob/${version}/CHANGELOG.rst";
81 license = lib.licenses.mit;
82 maintainers = with lib.maintainers; [ wegank ];
83 mainProgram = "pybids";
84 };
85}