about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/measurement/default.nix
blob: 3323e8c198ff2fab1dd193f46bb0f62430b741de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib
, fetchFromGitHub
, buildPythonPackage
, isPy3k
, flit-core
, flit-scm
, sympy
, pytestCheckHook
, sphinx
}:

buildPythonPackage rec {
  pname = "measurement";
  version = "3.2.2";
  format = "pyproject";

  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "coddingtonbear";
    repo = "python-measurement";
    rev = "refs/tags/${version}";
    hash = "sha256-ULId0W10FaAtSgVY5ctQL3FPETVr+oq6TKWd/W53viM=";
  };

  nativeBuildInputs = [
    flit-core
    flit-scm
    sphinx
  ];

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace "--cov=measurement" ""
  '';

  propagatedBuildInputs = [
    sympy
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Use and manipulate unit-aware measurement objects in Python";
    homepage = "https://github.com/coddingtonbear/python-measurement";
    changelog = "https://github.com/coddingtonbear/python-measurement/releases/tag/${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ bhipple ];
  };
}