1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 cmake,
7}:
8
9buildPythonPackage rec {
10 pname = "editorconfig";
11 version = "0.12.4";
12 pyproject = true;
13
14 src = fetchFromGitHub {
15 owner = "editorconfig";
16 repo = "editorconfig-core-py";
17 rev = "v${version}";
18 hash = "sha256-+m674bLj6xs7MWU+8BMixEwy7/TjyES0lvCLLogTDHQ=";
19 fetchSubmodules = true;
20 };
21
22 nativeBuildInputs = [ setuptools ];
23
24 nativeCheckInputs = [ cmake ];
25
26 dontUseCmakeConfigure = true;
27
28 checkPhase = ''
29 runHook preCheck
30
31 cmake .
32 ctest .
33
34 runHook postCheck
35 '';
36
37 pythonImportsCheck = [ "editorconfig" ];
38
39 meta = with lib; {
40 description = "EditorConfig File Locator and Interpreter for Python";
41 mainProgram = "editorconfig";
42 homepage = "https://github.com/editorconfig/editorconfig-core-py";
43 license = licenses.psfl;
44 maintainers = with maintainers; [ nickcao ];
45 };
46}