diff --git a/pkgs/development/python-modules/docstring-to-markdown/default.nix b/pkgs/development/python-modules/docstring-to-markdown/default.nix new file mode 100644 index 000000000000..f4f2a36f5394 --- /dev/null +++ b/pkgs/development/python-modules/docstring-to-markdown/default.nix @@ -0,0 +1,37 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "docstring-to-markdown"; + version = "0.9"; + + src = fetchFromGitHub { + owner = "python-lsp"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-XVTlSqqWmvnB5nvjvgGDJmg71KKTq2hHB4//QW7ugvA="; + }; + + patches = [ + # So pytest-flake8 and pytest-cov won't be needed + ./remove-coverage-tests.patch + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "docstring_to_markdown" + ]; + + meta = with lib; { + homepage = "https://github.com/python-lsp/docstring-to-markdown"; + description = "On the fly conversion of Python docstrings to markdown"; + license = licenses.lgpl2Plus; + maintainers = with maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/development/python-modules/docstring-to-markdown/remove-coverage-tests.patch b/pkgs/development/python-modules/docstring-to-markdown/remove-coverage-tests.patch new file mode 100644 index 000000000000..68bc626ced91 --- /dev/null +++ b/pkgs/development/python-modules/docstring-to-markdown/remove-coverage-tests.patch @@ -0,0 +1,16 @@ +diff --git i/setup.cfg w/setup.cfg +index e880e74..e77133e 100644 +--- i/setup.cfg ++++ w/setup.cfg +@@ -34,11 +34,7 @@ docstring-to-markdown = py.typed + [tool:pytest] + addopts = + --pyargs tests +- --cov docstring_to_markdown +- --cov-fail-under=98 +- --cov-report term-missing:skip-covered + -p no:warnings +- --flake8 + -vv + + [flake8] diff --git a/pkgs/development/python-modules/jedi-language-server/default.nix b/pkgs/development/python-modules/jedi-language-server/default.nix new file mode 100644 index 000000000000..8aead2738f40 --- /dev/null +++ b/pkgs/development/python-modules/jedi-language-server/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchPypi +, fetchFromGitHub +, poetry +, docstring-to-markdown +, jedi +, pygls +, pytestCheckHook +, pyhamcrest +, python-jsonrpc-server +}: + +buildPythonPackage rec { + pname = "jedi-language-server"; + version = "0.34.8"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "pappasam"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-mJGgDDjPZXde4M4OHwj81KYoaFXFAwOZ+v18YE+arFE="; + }; + + nativeBuildInputs = [ + poetry + ]; + + propagatedBuildInputs = [ + docstring-to-markdown + jedi + pygls + ]; + + checkInputs = [ + pytestCheckHook + pyhamcrest + python-jsonrpc-server + ]; + + preCheck = '' + HOME="$(mktemp -d)" + ''; + + pythonImportsCheck = [ + "jedi_language_server" + ]; + + meta = with lib; { + homepage = "https://github.com/pappasam/jedi-language-server"; + description = "A Language Server for the latest version(s) of Jedi"; + license = licenses.mit; + maintainers = with maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6c944f7af227..fad1f41d540a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2269,6 +2269,8 @@ in { docloud = callPackage ../development/python-modules/docloud { }; + docstring-to-markdown = callPackage ../development/python-modules/docstring-to-markdown { }; + docopt = callPackage ../development/python-modules/docopt { }; docopt-ng = callPackage ../development/python-modules/docopt-ng { }; @@ -3933,6 +3935,8 @@ in { jedi = callPackage ../development/python-modules/jedi { }; + jedi-language-server = callPackage ../development/python-modules/jedi-language-server { }; + jeepney = callPackage ../development/python-modules/jeepney { }; jellyfin-apiclient-python = callPackage ../development/python-modules/jellyfin-apiclient-python { };