1{ lib
2, fetchFromGitHub
3, pythonAtLeast
4, buildPythonPackage
5, importlib-resources
6, pyyaml
7, requests
8, setuptools-scm
9}:
10
11buildPythonPackage rec {
12 pname = "scikit-hep-testdata";
13 version = "0.4.21";
14 format = "pyproject";
15
16 # fetch from github as we want the data files
17 # https://github.com/scikit-hep/scikit-hep-testdata/issues/60
18 src = fetchFromGitHub {
19 owner = "scikit-hep";
20 repo = pname;
21 rev = "refs/tags/v${version}";
22 sha256 = "sha256-DhOtoxjhczsYqOn+CwLGlRIPa2hh7mH6EfwcLLPMQcw=";
23 };
24
25 nativeBuildInputs = [
26 setuptools-scm
27 ];
28 propagatedBuildInputs = [
29 pyyaml
30 requests
31 ] ++ lib.optional (!pythonAtLeast "3.9") importlib-resources;
32
33 SETUPTOOLS_SCM_PRETEND_VERSION = version;
34
35 SKHEP_DATA = 1; # install the actual root files
36
37 doCheck = false; # tests require networking
38 pythonImportsCheck = [ "skhep_testdata" ];
39
40 meta = with lib; {
41 homepage = "https://github.com/scikit-hep/scikit-hep-testdata";
42 description = "A common package to provide example files (e.g., ROOT) for testing and developing packages against";
43 license = licenses.bsd3;
44 maintainers = with maintainers; [ veprbl ];
45 };
46}