1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 setuptools,
8
9 # dependencies
10 jinja2,
11 jupyterhub,
12
13 # tests
14 pytest-asyncio_0,
15 pytest-cov-stub,
16 pytestCheckHook,
17}:
18
19buildPythonPackage rec {
20 pname = "batchspawner";
21 version = "1.3.0";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "jupyterhub";
26 repo = "batchspawner";
27 tag = "v${version}";
28 hash = "sha256-Z7kB8b7s11wokTachLI/N+bdUV+FfCRTemL1KYQpzio=";
29 };
30
31 # When using pytest-asyncio>=0.24, jupyterhub no longer re-defines the event_loop function in its
32 # conftest.py, so it cannot be imported from there.
33 postPatch = ''
34 substituteInPlace batchspawner/tests/conftest.py \
35 --replace-fail \
36 "from jupyterhub.tests.conftest import db, event_loop # noqa" \
37 "from jupyterhub.tests.conftest import db"
38 '';
39
40 build-system = [
41 setuptools
42 ];
43
44 dependencies = [
45 jinja2
46 jupyterhub
47 ];
48
49 nativeCheckInputs = [
50 pytest-asyncio_0
51 pytest-cov-stub
52 pytestCheckHook
53 ];
54
55 pythonImportsCheck = [ "batchspawner" ];
56
57 meta = {
58 description = "Spawner for Jupyterhub to spawn notebooks using batch resource managers";
59 mainProgram = "batchspawner-singleuser";
60 homepage = "https://github.com/jupyterhub/batchspawner";
61 changelog = "https://github.com/jupyterhub/batchspawner/blob/v${version}/CHANGELOG.md";
62 license = lib.licenses.bsd3;
63 maintainers = [ ];
64 };
65}