depot/third_party/nixpkgs/pkgs/development/python-modules/mkdocstrings/default.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

76 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.25.1";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "mkdocstrings";
repo = "mkdocstrings";
rev = "refs/tags/${version}";
hash = "sha256-Z4mX6EXEFmNd/CNa39hN9mwJSv9OkqwEmWMzJ9r+EBM=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'dynamic = ["version"]' 'version = "${version}"'
'';
build-system = [ pdm-backend ];
dependencies =
[
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 ];
};
}