1{
2 lib,
3 attrs,
4 buildPythonPackage,
5 deprecated,
6 fetchPypi,
7 hatch-vcs,
8 hatchling,
9 hepunits,
10 pandas,
11 pytestCheckHook,
12 pythonOlder,
13 tabulate,
14}:
15
16buildPythonPackage rec {
17 pname = "particle";
18 version = "0.25.4";
19 pyproject = true;
20
21 disabled = pythonOlder "3.9";
22
23 src = fetchPypi {
24 inherit pname version;
25 hash = "sha256-v6d9iqBz5rSY8a4tTUkmtwdmKwYPsj65hqfNtJMfWK8=";
26 };
27
28 postPatch = ''
29 # Disable benchmark tests, so we won't need pytest-benchmark and pytest-cov
30 # as dependencies
31 substituteInPlace pyproject.toml \
32 --replace '"--benchmark-disable",' ""
33 '';
34
35 build-system = [
36 hatch-vcs
37 hatchling
38 ];
39
40 dependencies = [
41 attrs
42 deprecated
43 hepunits
44 ];
45
46 nativeCheckInputs = [
47 pytestCheckHook
48 tabulate
49 pandas
50 ];
51
52 pythonImportsCheck = [ "particle" ];
53
54 disabledTestPaths = [
55 # Requires pytest-benchmark and pytest-cov which we want to avoid using, as
56 # it doesn't really test functionality.
57 "tests/particle/test_performance.py"
58 ];
59
60 meta = {
61 description = "Package to deal with particles, the PDG particle data table and others";
62 homepage = "https://github.com/scikit-hep/particle";
63 changelog = "https://github.com/scikit-hep/particle/releases/tag/v${version}";
64 license = lib.licenses.bsd3;
65 maintainers = with lib.maintainers; [ doronbehar ];
66 };
67}