1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, setuptools
6, wheel
7, pytestCheckHook
8}:
9
10buildPythonPackage rec {
11 pname = "xdoctest";
12 version = "1.1.2";
13 pyproject = true;
14
15 disabled = pythonOlder "3.6";
16
17 src = fetchFromGitHub {
18 owner = "Erotemic";
19 repo = "xdoctest";
20 rev = "refs/tags/v${version}";
21 hash = "sha256-yTu5ldr9TkpYRP8hjgUPpexBVLjaK2gfPvISjMJLY74=";
22 };
23
24 nativeBuildInputs = [
25 setuptools
26 wheel
27 ];
28
29 nativeCheckInputs = [
30 pytestCheckHook
31 ];
32
33 preCheck = ''
34 export HOME=$TMPDIR
35 export PATH=$out/bin:$PATH
36 '';
37
38 pythonImportsCheck = [ "xdoctest" ];
39
40 meta = with lib; {
41 description = "A rewrite of Python's builtin doctest module (with pytest plugin integration) with AST instead of REGEX";
42 homepage = "https://github.com/Erotemic/xdoctest";
43 changelog = "https://github.com/Erotemic/xdoctest/blob/${src.rev}/CHANGELOG.md";
44 license = licenses.asl20;
45 maintainers = with maintainers; [ natsukium ];
46 mainProgram = "xdoctest";
47 };
48}