1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9 setuptools-scm,
10
11 # propagates
12 typing-extensions,
13
14 # tests
15 pytestCheckHook,
16 pytest-subtests,
17 pytest-benchmark,
18 numpy,
19 matplotlib,
20 uncertainties,
21}:
22
23buildPythonPackage rec {
24 pname = "pint";
25 version = "0.23";
26 format = "pyproject";
27
28 disabled = pythonOlder "3.6";
29
30 src = fetchPypi {
31 inherit version;
32 pname = "Pint";
33 hash = "sha256-4VCbkWBtvFJSfGAKTvdP+sEv/3Boiv8g6QckCTRuybQ=";
34 };
35
36 nativeBuildInputs = [
37 setuptools
38 setuptools-scm
39 ];
40
41 propagatedBuildInputs = [ typing-extensions ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 pytest-subtests
46 pytest-benchmark
47 numpy
48 matplotlib
49 uncertainties
50 ];
51
52 pytestFlagsArray = [ "--benchmark-disable" ];
53
54 preCheck = ''
55 export HOME=$(mktemp -d)
56 '';
57
58 disabledTests = [
59 # https://github.com/hgrecco/pint/issues/1898
60 "test_load_definitions_stage_2"
61 # pytest8 deprecation
62 "test_nonnumeric_magnitudes"
63 ];
64
65 meta = with lib; {
66 changelog = "https://github.com/hgrecco/pint/blob/${version}/CHANGES";
67 description = "Physical quantities module";
68 mainProgram = "pint-convert";
69 license = licenses.bsd3;
70 homepage = "https://github.com/hgrecco/pint/";
71 maintainers = with maintainers; [ doronbehar ];
72 };
73}