1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 isPy3k,
6 flit-core,
7 flit-scm,
8 sympy,
9 pytestCheckHook,
10 sphinx,
11}:
12
13buildPythonPackage rec {
14 pname = "measurement";
15 version = "3.2.2";
16 format = "pyproject";
17
18 disabled = !isPy3k;
19
20 src = fetchFromGitHub {
21 owner = "coddingtonbear";
22 repo = "python-measurement";
23 rev = "refs/tags/${version}";
24 hash = "sha256-ULId0W10FaAtSgVY5ctQL3FPETVr+oq6TKWd/W53viM=";
25 };
26
27 nativeBuildInputs = [
28 flit-core
29 flit-scm
30 sphinx
31 ];
32
33 postPatch = ''
34 substituteInPlace pyproject.toml \
35 --replace "--cov=measurement" ""
36 '';
37
38 propagatedBuildInputs = [ sympy ];
39
40 nativeCheckInputs = [ pytestCheckHook ];
41
42 meta = with lib; {
43 description = "Use and manipulate unit-aware measurement objects in Python";
44 homepage = "https://github.com/coddingtonbear/python-measurement";
45 changelog = "https://github.com/coddingtonbear/python-measurement/releases/tag/${version}";
46 license = licenses.mit;
47 maintainers = with maintainers; [ bhipple ];
48 };
49}