From 6008e57f33746a790522e0d2adfb4e88b8b74b05 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sun, 12 Nov 2023 18:25:43 +0900 Subject: [PATCH] python311Packages.jupyterlab-server: refactor --- .../jupyterlab-server/default.nix | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/pkgs/development/python-modules/jupyterlab-server/default.nix b/pkgs/development/python-modules/jupyterlab-server/default.nix index e81e67427377..a408137650ac 100644 --- a/pkgs/development/python-modules/jupyterlab-server/default.nix +++ b/pkgs/development/python-modules/jupyterlab-server/default.nix @@ -1,27 +1,28 @@ { lib , buildPythonPackage , fetchPypi -, hatchling -, jsonschema , pythonOlder -, requests -, pytestCheckHook -, json5 +, hatchling , babel +, importlib-metadata +, jinja2 +, json5 +, jsonschema , jupyter-server -, tomli +, packaging +, requests , openapi-core , pytest-jupyter +, pytestCheckHook , requests-mock , ruamel-yaml , strict-rfc3339 -, importlib-metadata }: buildPythonPackage rec { pname = "jupyterlab-server"; version = "2.25.1"; - format = "pyproject"; + pyproject = true; disabled = pythonOlder "3.8"; @@ -31,62 +32,61 @@ buildPythonPackage rec { hash = "sha256-ZJEoOwAAaY6uGjjEhQeTBWDfz3RhrqABU2hpiqs03Zw="; }; + postPatch = '' + sed -i "/timeout/d" pyproject.toml + ''; + nativeBuildInputs = [ hatchling ]; propagatedBuildInputs = [ - requests - jsonschema - json5 babel + jinja2 + json5 + jsonschema jupyter-server - tomli + packaging + requests ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ]; - nativeCheckInputs = [ - openapi-core - pytestCheckHook - pytest-jupyter - requests-mock - ruamel-yaml - strict-rfc3339 - ]; + passthru.optional-dependencies = { + openapi = [ + openapi-core + ruamel-yaml + ]; + }; - postPatch = '' - sed -i "/timeout/d" pyproject.toml - ''; + nativeCheckInputs = [ + pytest-jupyter + pytestCheckHook + requests-mock + strict-rfc3339 + ] ++ passthru.optional-dependencies.openapi; preCheck = '' export HOME=$(mktemp -d) ''; - pytestFlagsArray = [ - # DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. - # Use setuptools or check PEP 632 for potential alternatives. - "-W ignore::DeprecationWarning" - ]; - disabledTestPaths = [ - "tests/test_settings_api.py" - "tests/test_themes_api.py" + # require optional language pack packages for tests "tests/test_translation_api.py" - "tests/test_workspaces_api.py" ]; - disabledTests = [ - "test_get_listing" + pythonImportsCheck = [ + "jupyterlab_server" + "jupyterlab_server.pytest_plugin" ]; __darwinAllowLocalNetworking = true; meta = with lib; { description = "A set of server components for JupyterLab and JupyterLab like applications"; - homepage = "https://jupyterlab-server.readthedocs.io/"; + homepage = "https://github.com/jupyterlab/jupyterlab_server"; changelog = "https://github.com/jupyterlab/jupyterlab_server/blob/v${version}/CHANGELOG.md"; - license = licenses.bsdOriginal; + license = licenses.bsd3; maintainers = lib.teams.jupyter.members; }; }