1{ lib
2, buildPythonPackage
3, fetchpatch
4, fetchPypi
5, cmake
6, numpy
7, scikit-build
8, setuptools
9, setuptools-scm
10, wheel
11, pybind11
12, pydantic
13, pytestCheckHook
14, rich
15, scipy
16, zlib
17}:
18
19buildPythonPackage rec {
20 pname = "correctionlib";
21 version = "2.2.2";
22 format = "pyproject";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-h3eggtPLSF/8ShQ5xzowZW1KSlcI/YBsPu3lsSyzHkw=";
27 };
28
29 patches = [
30 (fetchpatch {
31 name = "ci-maintenance.patch";
32 url = "https://github.com/cms-nanoAOD/correctionlib/commit/924031637b040f6e8e4930c46a9f7560c59db23d.patch";
33 hash = "sha256-jq3ojMsO2Ex9om8tVpEY9uwwelXPzgQ+KCPN0bgda8w=";
34 includes = [ "pyproject.toml" ];
35 })
36 (fetchpatch {
37 name = "clean-up-build-dependencies.patch";
38 url = "https://github.com/cms-nanoAOD/correctionlib/commit/c4fd64ca0e5ce806890e8f0ae8e792dcc4537d38.patch";
39 hash = "sha256-8ID2jEnmfYmPxWMtRviBc3t1W4p3Y+lAzijFtYBEtyk=";
40 })
41 ];
42
43 nativeBuildInputs = [
44 cmake
45 numpy
46 scikit-build
47 setuptools
48 setuptools-scm
49 wheel
50 pybind11
51 ];
52
53 buildInputs = [
54 zlib
55 ];
56
57 propagatedBuildInputs = [
58 pydantic
59 rich
60 ];
61
62 dontUseCmakeConfigure = true;
63
64 env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
65
66 nativeCheckInputs = [
67 pytestCheckHook
68 scipy
69 ];
70
71 pythonImportsCheck = [
72 "correctionlib"
73 ];
74
75 meta = with lib; {
76 description = "Provides a well-structured JSON data format for a wide variety of ad-hoc correction factors encountered in a typical HEP analysis";
77 homepage = "https://cms-nanoaod.github.io/correctionlib/";
78 license = with licenses; [ bsd3 ];
79 maintainers = with maintainers; [ veprbl ];
80 };
81}