about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/jproperties/default.nix
blob: b01f39d0432a9e8db7b539aa4ee0715b18c7f1b1 (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
55
56
57
58
{ lib
, buildPythonPackage
, fetchFromGitHub
, pytestCheckHook
, six
, pytest-datadir
, setuptools-scm
}:

buildPythonPackage rec {
  pname = "jproperties";
  version = "2.1.1";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "Tblue";
    repo = "python-jproperties";
    rev = "v${version}";
    hash = "sha256-O+ALeGHMNjW1dc9IRyLzO81k8DW2vbGjuZqXxgrhYjo=";
  };

  nativeBuildInputs = [
    setuptools-scm
  ];

  propagatedBuildInputs = [
    six
  ];

  nativeCheckInputs = [
    pytest-datadir
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace setup.py \
      --replace "setuptools_scm ~= 3.3" "setuptools_scm"
    substituteInPlace pytest.ini \
      --replace "--cov=jproperties --cov-report=term --cov-report=html --cov-branch" ""
  '';

  disabledTestPaths = [
    # TypeError: 'PosixPath' object...
    "tests/test_simple_utf8.py"
  ];

  pythonImportsCheck = [
    "jproperties"
  ];

  meta = with lib; {
    description = "Java Property file parser and writer for Python";
    mainProgram = "propconv";
    homepage = "https://github.com/Tblue/python-jproperties";
    license = with licenses; [ bsd3 ];
    maintainers = with maintainers; [ fab ];
  };
}