2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
alembic,
|
|
|
|
async-generator,
|
|
|
|
beautifulsoup4,
|
|
|
|
buildPythonPackage,
|
|
|
|
certipy,
|
|
|
|
configurable-http-proxy,
|
|
|
|
cryptography,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchNpmDeps,
|
|
|
|
idna,
|
|
|
|
importlib-metadata,
|
|
|
|
jinja2,
|
|
|
|
jsonschema,
|
|
|
|
jupyter-events,
|
|
|
|
jupyterlab,
|
|
|
|
mock,
|
|
|
|
nbclassic,
|
|
|
|
nodejs,
|
|
|
|
npmHooks,
|
|
|
|
oauthlib,
|
|
|
|
packaging,
|
|
|
|
pamela,
|
|
|
|
playwright,
|
|
|
|
prometheus-client,
|
|
|
|
pydantic,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
python-dateutil,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
|
|
|
requests-mock,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
sqlalchemy,
|
|
|
|
tornado,
|
|
|
|
traitlets,
|
|
|
|
virtualenv,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jupyterhub";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "5.1.0";
|
2024-06-05 15:53:02 +00:00
|
|
|
pyproject = true;
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupyterhub";
|
|
|
|
repo = "jupyterhub";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-3L83FLhLCdTgOuFRgRMbz316cYbai0Z+hJwxXUCYB2Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
npmDeps = fetchNpmDeps {
|
|
|
|
inherit src;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-b7j6iGYXrwco4YruqRPEEi4yWRF6otTUD2jKCEPcLTE=";
|
2024-06-05 15:53:02 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace jupyterhub/proxy.py --replace-fail \
|
2020-04-24 23:36:52 +00:00
|
|
|
"'configurable-http-proxy'" \
|
2023-08-22 20:05:09 +00:00
|
|
|
"'${configurable-http-proxy}/bin/configurable-http-proxy'"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
substituteInPlace jupyterhub/tests/test_proxy.py --replace-fail \
|
2020-04-24 23:36:52 +00:00
|
|
|
"'configurable-http-proxy'" \
|
2023-08-22 20:05:09 +00:00
|
|
|
"'${configurable-http-proxy}/bin/configurable-http-proxy'"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
nodejs
|
|
|
|
npmHooks.npmConfigHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
dependencies =
|
|
|
|
[
|
|
|
|
alembic
|
|
|
|
certipy
|
|
|
|
idna
|
|
|
|
jinja2
|
|
|
|
jupyter-events
|
|
|
|
oauthlib
|
|
|
|
packaging
|
|
|
|
pamela
|
|
|
|
prometheus-client
|
|
|
|
pydantic
|
|
|
|
python-dateutil
|
|
|
|
requests
|
|
|
|
sqlalchemy
|
|
|
|
tornado
|
|
|
|
traitlets
|
|
|
|
]
|
|
|
|
++ lib.optionals (pythonOlder "3.10") [
|
|
|
|
async-generator
|
|
|
|
importlib-metadata
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-02-16 17:04:54 +00:00
|
|
|
beautifulsoup4
|
|
|
|
cryptography
|
2023-08-22 20:05:09 +00:00
|
|
|
jsonschema
|
|
|
|
jupyterlab
|
2024-06-05 15:53:02 +00:00
|
|
|
mock
|
|
|
|
nbclassic
|
2023-08-22 20:05:09 +00:00
|
|
|
playwright
|
2024-06-05 15:53:02 +00:00
|
|
|
# require pytest-asyncio<0.23
|
|
|
|
# https://github.com/jupyterhub/jupyterhub/pull/4663
|
|
|
|
(pytest-asyncio.overrideAttrs (
|
|
|
|
final: prev: {
|
|
|
|
version = "0.21.2";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit (prev.src) owner repo;
|
|
|
|
rev = "refs/tags/v${final.version}";
|
|
|
|
hash = "sha256-AVVvdo/CDF9IU6l779sLc7wKz5h3kzMttdDNTPLYxtQ=";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
))
|
2021-02-16 17:04:54 +00:00
|
|
|
pytestCheckHook
|
|
|
|
requests-mock
|
|
|
|
virtualenv
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
preCheck = ''
|
2024-06-05 15:53:02 +00:00
|
|
|
export PATH=$out/bin:$PATH;
|
2023-08-22 20:05:09 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-16 17:04:54 +00:00
|
|
|
disabledTests = [
|
|
|
|
# Tries to install older versions through pip
|
|
|
|
"test_upgrade"
|
|
|
|
# Testcase fails to find requests import
|
|
|
|
"test_external_service"
|
2023-08-22 20:05:09 +00:00
|
|
|
# Attempts to do TLS connection
|
2022-02-10 20:34:41 +00:00
|
|
|
"test_connection_notebook_wrong_certs"
|
2023-08-22 20:05:09 +00:00
|
|
|
# AttributeError: 'coroutine' object...
|
|
|
|
"test_valid_events"
|
|
|
|
"test_invalid_events"
|
|
|
|
"test_user_group_roles"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# Not testing with a running instance
|
|
|
|
# AttributeError: 'coroutine' object has no attribute 'db'
|
|
|
|
"docs/test_docs.py"
|
|
|
|
"jupyterhub/tests/browser/test_browser.py"
|
|
|
|
"jupyterhub/tests/test_api.py"
|
|
|
|
"jupyterhub/tests/test_auth_expiry.py"
|
|
|
|
"jupyterhub/tests/test_auth.py"
|
|
|
|
"jupyterhub/tests/test_metrics.py"
|
|
|
|
"jupyterhub/tests/test_named_servers.py"
|
|
|
|
"jupyterhub/tests/test_orm.py"
|
|
|
|
"jupyterhub/tests/test_pages.py"
|
|
|
|
"jupyterhub/tests/test_proxy.py"
|
|
|
|
"jupyterhub/tests/test_scopes.py"
|
|
|
|
"jupyterhub/tests/test_services_auth.py"
|
|
|
|
"jupyterhub/tests/test_singleuser.py"
|
|
|
|
"jupyterhub/tests/test_spawner.py"
|
|
|
|
"jupyterhub/tests/test_user.py"
|
2021-02-16 17:04:54 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Serves multiple Jupyter notebook instances";
|
2024-06-05 15:53:02 +00:00
|
|
|
homepage = "https://github.com/jupyterhub/jupyterhub";
|
2023-08-22 20:05:09 +00:00
|
|
|
changelog = "https://github.com/jupyterhub/jupyterhub/blob/${version}/docs/source/reference/changelog.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = teams.jupyter.members;
|
2023-08-22 20:05:09 +00:00
|
|
|
# darwin: E OSError: dlopen(/nix/store/43zml0mlr17r5jsagxr00xxx91hz9lky-openpam-20170430/lib/libpam.so, 6): image not found
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|