depot/third_party/nixpkgs/pkgs/development/python-modules/mkdocstrings/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

79 lines
1.6 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, importlib-metadata
, jinja2
, markdown
, markupsafe
, mkdocs
, mkdocs-autorefs
, pdm-backend
, pymdown-extensions
, pytestCheckHook
, pythonOlder
, typing-extensions
}:
buildPythonPackage rec {
pname = "mkdocstrings";
version = "0.24.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "mkdocstrings";
repo = "mkdocstrings";
rev = "refs/tags/${version}";
hash = "sha256-UqX2jNNYwDNhb71qGdjHNoo2MmSxjf/bZiUoSxlE2XQ=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'dynamic = ["version"]' 'version = "${version}"'
'';
nativeBuildInputs = [
pdm-backend
];
propagatedBuildInputs = [
jinja2
markdown
markupsafe
mkdocs
mkdocs-autorefs
pymdown-extensions
] ++ lib.optionals (pythonOlder "3.10") [
importlib-metadata
typing-extensions
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"mkdocstrings"
];
disabledTestPaths = [
# Circular dependencies
"tests/test_extension.py"
];
disabledTests = [
# Not all requirements are available
"test_disabling_plugin"
# Circular dependency on mkdocstrings-python
"test_extended_templates"
];
meta = with lib; {
description = "Automatic documentation from sources for MkDocs";
homepage = "https://github.com/mkdocstrings/mkdocstrings";
changelog = "https://github.com/mkdocstrings/mkdocstrings/blob/${version}/CHANGELOG.md";
license = licenses.isc;
maintainers = with maintainers; [ fab ];
};
}