summary refs log tree commit diff
path: root/pkgs/development/python-modules/editorconfig/default.nix
blob: 2918733e96b3c62d169098317e784c30c91d8407 (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, cmake
}:

let
  tests = fetchFromGitHub {
    owner = "editorconfig";
    repo = "editorconfig-core-test";
    rev = "e407c1592df0f8e91664835324dea85146f20189";
    sha256 = "sha256-9WSEkMJOewPqJjB6f7J6Ir0L+U712hkaN+GszjnGw7c=";
  };
in
buildPythonPackage rec {
  pname = "editorconfig";
  version = "0.12.3";

  src = fetchFromGitHub {
    owner = "editorconfig";
    repo = "editorconfig-core-py";
    rev = "v${version}";
    sha256 = "sha256-ZwoTMgk18+BpPNtXKQUMXGcl2Lp+1RQVyPHgk6gHWh8=";
    # workaround until https://github.com/editorconfig/editorconfig-core-py/pull/40 is merged
    # fetchSubmodules = true;
  };

  postUnpack = ''
    cp -r ${tests}/* source/tests
    chmod +w -R source/tests
  '';

  nativeCheckInputs = [
    cmake
  ];

  dontUseCmakeConfigure = true;

  checkPhase = ''
    cmake .
    # utf_8_char fails with Python 3
    ctest -E "utf_8_char" .
  '';

  pythonImportsCheck = [ "editorconfig" ];

  meta = with lib; {
    description = "EditorConfig File Locator and Interpreter for Python";
    homepage = "https://github.com/editorconfig/editorconfig-core-py";
    license = licenses.psfl;
    maintainers = with maintainers; [ SuperSandro2000 ];
  };
}