1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch2,
6 numpy,
7 pytestCheckHook,
8 pythonOlder,
9 setuptools,
10 setuptools-scm,
11}:
12
13buildPythonPackage rec {
14 pname = "quantities";
15 version = "0.15.0";
16 pyproject = true;
17
18 disabled = pythonOlder "3.8";
19
20 src = fetchFromGitHub {
21 owner = "python-quantities";
22 repo = "python-quantities";
23 rev = "refs/tags/v${version}";
24 hash = "sha256-N20xfzGtM0VnfkJtzMytNLySTkgVz2xf1nEJxlwBSCI=";
25 };
26
27 patches = [
28 (fetchpatch2 {
29 name = "prevent-arbitrary-code-eval.patch";
30 url = "https://github.com/python-quantities/python-quantities/pull/236.patch";
31 hash = "sha256-H1tOfXqNMIKY01m6o2PsfZG0CvnWNxW2qIWA5ce1lRk=";
32 })
33 ];
34
35 build-system = [
36 setuptools
37 setuptools-scm
38 ];
39
40 dependencies = [ numpy ];
41
42 nativeCheckInputs = [ pytestCheckHook ];
43
44 disabledTests = [
45 # test fails with numpy 1.24
46 "test_mul"
47 ];
48
49 pythonImportsCheck = [ "quantities" ];
50
51 meta = with lib; {
52 description = "Quantities is designed to handle arithmetic and conversions of physical quantities";
53 homepage = "https://python-quantities.readthedocs.io/";
54 changelog = "https://github.com/python-quantities/python-quantities/blob/v${version}/CHANGES.txt";
55 license = licenses.bsd2;
56 maintainers = [ ];
57 };
58}