about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyjet/default.nix
blob: ed0a5281e0fa408bc6cdcbf05e1bd60c22497dd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lib, buildPythonPackage, pythonOlder, fetchFromGitHub, cython, pytest, importlib-resources, numpy }:

buildPythonPackage rec {
  pname = "pyjet";
  version = "1.9.0";
  format = "setuptools";

  # tests not included in pypi tarball
  src = fetchFromGitHub {
    owner = "scikit-hep";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-0g0fCf0FIwde5Vsc/BJxjgMcs5llpD8JqOgFbMjOooc=";
  };

  nativeBuildInputs = [ cython ];
  propagatedBuildInputs = [
    numpy
  ] ++ lib.optionals (pythonOlder "3.9") [
    importlib-resources
  ];

  nativeCheckInputs = [ pytest ];
  checkPhase = ''
    mv pyjet _pyjet
    pytest tests/
  '';

  meta = with lib; {
    homepage = "https://github.com/scikit-hep/pyjet";
    description = "The interface between FastJet and NumPy";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ veprbl ];
  };
}