1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 importlib-metadata,
7 importlib-resources,
8 jinja2,
9 mkdocs,
10 pyparsing,
11 pyyaml,
12 pyyaml-env-tag,
13 verspec,
14 versionCheckHook,
15 pytestCheckHook,
16 git,
17 shtab,
18 stdenv,
19}:
20
21buildPythonPackage rec {
22 pname = "mike";
23 version = "2.1.3";
24 pyproject = true;
25
26 src = fetchFromGitHub {
27 owner = "jimporter";
28 repo = "mike";
29 tag = "v${version}";
30 hash = "sha256-eGUkYcPTrXwsZPqyDgHJlEFXzhMnenoZsjeHVGO/9WU=";
31 };
32
33 build-system = [
34 setuptools
35 ];
36
37 dependencies = [
38 importlib-metadata
39 importlib-resources
40 jinja2
41 mkdocs
42 pyparsing
43 pyyaml
44 pyyaml-env-tag
45 verspec
46 ];
47
48 nativeInstallCheckInputs = [ versionCheckHook ];
49 versionCheckProgramArg = "--version";
50 doInstallCheck = true;
51
52 __darwinAllowLocalNetworking = true;
53
54 nativeCheckInputs = [
55 pytestCheckHook
56 git
57 mkdocs
58 shtab
59 ];
60
61 preCheck = ''
62 export PATH=$out/bin:$PATH
63 ''
64 # "stat" on darwin results in "not permitted" instead of "does not exists"
65 + lib.optionalString stdenv.hostPlatform.isDarwin ''
66 substituteInPlace test/unit/test_git_utils.py \
67 --replace-fail "/home/nonexist" "$(mktemp -d)"
68 '';
69
70 pythonImportsCheck = [ "mike" ];
71
72 meta = {
73 description = "Manage multiple versions of your MkDocs-powered documentation via Git";
74 homepage = "https://github.com/jimporter/mike";
75 changelog = "https://github.com/jimporter/mike/blob/v${version}/CHANGES.md";
76 license = lib.licenses.bsd3;
77 maintainers = with lib.maintainers; [ marcel ];
78 mainProgram = "mike";
79 };
80}