summary refs log tree commit diff
path: root/pkgs/development/python-modules/scikit-hep-testdata/default.nix
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2021-05-26 19:58:23 -0400
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2021-05-30 14:11:19 -0400
commit9d84a846395315d276eb73109e0d7d0767ddf0ef (patch)
treee58085e7135bbe7c106b22ae7369c58d0f1e2f15 /pkgs/development/python-modules/scikit-hep-testdata/default.nix
parent2a6db4c056b66006804ec39d4185363d1d5f9658 (diff)
downloadnixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.tar
nixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.tar.gz
nixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.tar.bz2
nixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.tar.lz
nixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.tar.xz
nixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.tar.zst
nixpkgs-9d84a846395315d276eb73109e0d7d0767ddf0ef.zip
pythonPackages.scikit-hep-testdata: init at 0.4.3
Diffstat (limited to 'pkgs/development/python-modules/scikit-hep-testdata/default.nix')
-rw-r--r--pkgs/development/python-modules/scikit-hep-testdata/default.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/scikit-hep-testdata/default.nix b/pkgs/development/python-modules/scikit-hep-testdata/default.nix
new file mode 100644
index 00000000000..28156460110
--- /dev/null
+++ b/pkgs/development/python-modules/scikit-hep-testdata/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, fetchFromGitHub
+, pythonAtLeast
+, buildPythonPackage
+, importlib-resources
+, pyyaml
+, requests
+, pytestCheckHook
+, setuptools-scm
+}:
+
+buildPythonPackage rec {
+  pname = "scikit-hep-testdata";
+  version = "0.4.3";
+  format = "pyproject";
+
+  # fetch from github as we want the data files
+  # https://github.com/scikit-hep/scikit-hep-testdata/issues/60
+  src = fetchFromGitHub {
+    owner = "scikit-hep";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-3uy2uZb0Y9nOHlXtsDd9LGALvTXl1ZQ6P3m2dQ2ceHo=";
+  };
+
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+  propagatedBuildInputs = [
+    pyyaml
+    requests
+  ] ++ lib.optional (!pythonAtLeast "3.9") importlib-resources;
+
+  SETUPTOOLS_SCM_PRETEND_VERSION = version;
+
+  SKHEP_DATA = 1; # install the actual root files
+
+  doCheck = false; # tests require networking
+  pythonImportsCheck = [ "skhep_testdata" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/scikit-hep/scikit-hep-testdata";
+    description = "A common package to provide example files (e.g., ROOT) for testing and developing packages against";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}