diff --git a/pkgs/development/python-modules/griffe/default.nix b/pkgs/development/python-modules/griffe/default.nix new file mode 100644 index 000000000000..e13143f88e61 --- /dev/null +++ b/pkgs/development/python-modules/griffe/default.nix @@ -0,0 +1,60 @@ +{ lib +, aiofiles +, buildPythonApplication +, cached-property +, fetchFromGitHub +, git +, pdm-pep517 +, pytestCheckHook +, pythonOlder +}: + +buildPythonApplication rec { + pname = "griffe"; + version = "0.21.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "mkdocstrings"; + repo = pname; + rev = version; + hash = "sha256-yhhEcPwh1AjMtDlPZVDR69WX/728wuKqdJdc+yv/o4c="; + }; + + nativeBuildInputs = [ + pdm-pep517 + ]; + + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ + cached-property + ]; + + checkInputs = [ + git + pytestCheckHook + ]; + + passthru.optional-dependencies = { + async = [ + aiofiles + ]; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'dynamic = ["version"]' 'version = "${version}"' + ''; + + pythonImportsCheck = [ + "griffe" + ]; + + meta = with lib; { + description = "Signatures for entire Python programs"; + homepage = "https://github.com/mkdocstrings/griffe"; + license = licenses.isc; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/mkdocs-autorefs/default.nix b/pkgs/development/python-modules/mkdocs-autorefs/default.nix new file mode 100644 index 000000000000..ea1dffdf0db0 --- /dev/null +++ b/pkgs/development/python-modules/mkdocs-autorefs/default.nix @@ -0,0 +1,53 @@ +{ lib +, buildPythonApplication +, fetchFromGitHub +, markdown +, mkdocs +, pytestCheckHook +, pdm-pep517 +, pythonOlder +}: + +buildPythonApplication rec { + pname = "mkdocs-autorefs"; + version = "0.4.1"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "mkdocstrings"; + repo = "autorefs"; + rev = version; + sha256 = "sha256-kiHb/XSFw6yaUbLJHBvHaQAOVUM6UfyFeomgniDZqgU="; + }; + + nativeBuildInputs = [ + pdm-pep517 + ]; + + propagatedBuildInputs = [ + markdown + mkdocs + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'dynamic = ["version"]' 'version = "${version}"' + ''; + + pythonImportsCheck = [ + "mkdocs_autorefs" + ]; + + meta = with lib; { + description = "Automatically link across pages in MkDocs"; + homepage = "https://github.com/mkdocstrings/autorefs/"; + license = licenses.isc; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/mkdocstrings-python/default.nix b/pkgs/development/python-modules/mkdocstrings-python/default.nix new file mode 100644 index 000000000000..4e10c4287d8c --- /dev/null +++ b/pkgs/development/python-modules/mkdocstrings-python/default.nix @@ -0,0 +1,55 @@ +{ lib +, buildPythonApplication +, fetchFromGitHub +, griffe +, mkdocs-material +, mkdocstrings +, pdm-pep517 +, pytestCheckHook +, pythonOlder +}: + +buildPythonApplication rec { + pname = "mkdocstrings-python"; + version = "0.7.1"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "mkdocstrings"; + repo = "python"; + rev = version; + hash = "sha256-cZk6Eu6Jp3tSPAb0HplR/I0pX2YIFhOaAsI3YRS0LVw="; + }; + + nativeBuildInputs = [ + pdm-pep517 + ]; + + propagatedBuildInputs = [ + griffe + mkdocstrings + ]; + + checkInputs = [ + mkdocs-material + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'dynamic = ["version"]' 'version = "${version}"' + ''; + + pythonImportsCheck = [ + "mkdocstrings_handlers" + ]; + + meta = with lib; { + description = "Python handler for mkdocstrings"; + homepage = "https://github.com/mkdocstrings/python"; + license = licenses.isc; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/mkdocstrings/default.nix b/pkgs/development/python-modules/mkdocstrings/default.nix new file mode 100644 index 000000000000..b151727a8fbd --- /dev/null +++ b/pkgs/development/python-modules/mkdocstrings/default.nix @@ -0,0 +1,66 @@ +{ lib +, buildPythonApplication +, fetchFromGitHub +, jinja2 +, markdown +, markupsafe +, mkdocs +, mkdocs-autorefs +, pymdown-extensions +, pytestCheckHook +, pdm-pep517 +, pythonOlder +}: + +buildPythonApplication rec { + pname = "mkdocstrings"; + version = "0.19.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "mkdocstrings"; + repo = pname; + rev = version; + sha256 = "sha256-7OF1CrRnE4MYHuYD/pasnZpLe9lrbieGp4agnWAaKVo="; + }; + + nativeBuildInputs = [ + pdm-pep517 + ]; + + propagatedBuildInputs = [ + jinja2 + markdown + markupsafe + mkdocs + mkdocs-autorefs + pymdown-extensions + ]; + + checkInputs = [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace 'dynamic = ["version"]' 'version = "${version}"' + ''; + + pythonImportsCheck = [ + "mkdocstrings" + ]; + + disabledTestPaths = [ + # Circular dependencies + "tests/test_extension.py" + ]; + + meta = with lib; { + description = "Automatic documentation from sources for MkDocs"; + homepage = "https://github.com/mkdocstrings/mkdocstrings"; + license = licenses.isc; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 98f0ee237d65..bbffc10a2ded 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3789,6 +3789,8 @@ in { gridnet = callPackage ../development/python-modules/gridnet { }; + griffe = callPackage ../development/python-modules/griffe { }; + grip = callPackage ../development/python-modules/grip { }; groestlcoin_hash = callPackage ../development/python-modules/groestlcoin_hash { }; @@ -5440,6 +5442,7 @@ in { mizani = callPackage ../development/python-modules/mizani { }; mkdocs = callPackage ../development/python-modules/mkdocs { }; + mkdocs-autorefs = callPackage ../development/python-modules/mkdocs-autorefs { }; mkdocs-drawio-exporter = callPackage ../development/python-modules/mkdocs-drawio-exporter { }; mkdocs-exclude = callPackage ../development/python-modules/mkdocs-exclude { }; mkdocs-gitlab = callPackage ../development/python-modules/mkdocs-gitlab-plugin { }; @@ -5449,6 +5452,10 @@ in { mkdocs-minify = callPackage ../development/python-modules/mkdocs-minify { }; mkdocs-redirects = callPackage ../development/python-modules/mkdocs-redirects { }; + mkdocstrings = callPackage ../development/python-modules/mkdocstrings { }; + + mkdocstrings-python = callPackage ../development/python-modules/mkdocstrings-python { }; + mkl-service = callPackage ../development/python-modules/mkl-service { }; ml-collections = callPackage ../development/python-modules/ml-collections { };