nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 doInstallCheck = true;
50
51 __darwinAllowLocalNetworking = true;
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 git
56 mkdocs
57 shtab
58 ];
59
60 preCheck = ''
61 export PATH=$out/bin:$PATH
62 ''
63 # "stat" on darwin results in "not permitted" instead of "does not exists"
64 + lib.optionalString stdenv.hostPlatform.isDarwin ''
65 substituteInPlace test/unit/test_git_utils.py \
66 --replace-fail "/home/nonexist" "$(mktemp -d)"
67 '';
68
69 pythonImportsCheck = [ "mike" ];
70
71 meta = {
72 description = "Manage multiple versions of your MkDocs-powered documentation via Git";
73 homepage = "https://github.com/jimporter/mike";
74 changelog = "https://github.com/jimporter/mike/blob/v${version}/CHANGES.md";
75 license = lib.licenses.bsd3;
76 maintainers = with lib.maintainers; [ marcel ];
77 mainProgram = "mike";
78 };
79}