tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
pythonPackages.jupyterhub: init at 0.8.1
Matan Shenhav
8 years ago
e8ff1e07
400e9d04
+124
2 changed files
expand all
collapse all
unified
split
pkgs
development
python-modules
jupyterhub
default.nix
top-level
python-packages.nix
+122
pkgs/development/python-modules/jupyterhub/default.nix
···
1
1
+
{ lib
2
2
+
, python
3
3
+
, buildPythonPackage
4
4
+
, fetchPypi
5
5
+
, fetchzip
6
6
+
, alembic
7
7
+
, ipython
8
8
+
, jinja2
9
9
+
, python-oauth2
10
10
+
, pamela
11
11
+
, sqlalchemy
12
12
+
, tornado
13
13
+
, traitlets
14
14
+
, requests
15
15
+
, pythonOlder
16
16
+
, nodejs-8_x
17
17
+
, nodePackages
18
18
+
}:
19
19
+
20
20
+
let
21
21
+
# js/css assets that setup.py tries to fetch via `npm install` when building
22
22
+
# from source.
23
23
+
bootstrap =
24
24
+
fetchzip {
25
25
+
url = "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz";
26
26
+
sha256 = "0r7s54bbf68ri1na9bbabyf12mcpb6zk5ja2q6z82aw1fa4xi3yd";
27
27
+
};
28
28
+
font-awesome =
29
29
+
fetchzip {
30
30
+
url = "https://registry.npmjs.org/font-awesome/-/font-awesome-4.7.0.tgz";
31
31
+
sha256 = "1xnxbdlfdd60z5ix152m8r2kk9dkwlqwpypky1mm3dv64ajnzdbk";
32
32
+
};
33
33
+
jquery =
34
34
+
fetchzip {
35
35
+
url = "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz";
36
36
+
sha256 = "1j6y18miwzafdj8kfpwbmbn9qvgnbnpc7l4arqrhqj33m04xrlgi";
37
37
+
};
38
38
+
moment =
39
39
+
fetchzip {
40
40
+
url = "https://registry.npmjs.org/moment/-/moment-2.18.1.tgz";
41
41
+
sha256 = "1b4vyvs24v6y92pf2iqjm5aa7jg7khcpspn00girc7lpi917f9vw";
42
42
+
};
43
43
+
requirejs =
44
44
+
fetchzip {
45
45
+
url = "https://registry.npmjs.org/requirejs/-/requirejs-2.3.4.tgz";
46
46
+
sha256 = "0q6mkj0iv341kks06dya6lfs2kdw0n6vc7n4a7aa3ia530fk9vja";
47
47
+
};
48
48
+
49
49
+
in
50
50
+
51
51
+
buildPythonPackage rec {
52
52
+
pname = "jupyterhub";
53
53
+
version = "0.8.1";
54
54
+
55
55
+
src = fetchPypi {
56
56
+
inherit pname version;
57
57
+
sha256 = "100cf18d539802807a45450d38fefbb376cf1c810f3b1b31be31638829a5c69c";
58
58
+
};
59
59
+
60
60
+
# Most of this only applies when building from source (e.g. js/css assets are
61
61
+
# pre-built and bundled in the official release tarball on pypi).
62
62
+
#
63
63
+
# Stuff that's always needed:
64
64
+
# * At runtime, we need configurable-http-proxy, so we substitute the store
65
65
+
# path.
66
66
+
#
67
67
+
# Other stuff that's only needed when building from source:
68
68
+
# * js/css assets are fetched from npm.
69
69
+
# * substitute store path for `lessc` commmand.
70
70
+
# * set up NODE_PATH so `lessc` can find `less-plugin-clean-css`.
71
71
+
# * don't run `npm install`.
72
72
+
preBuild = ''
73
73
+
export NODE_PATH=${nodePackages.less-plugin-clean-css}/lib/node_modules
74
74
+
75
75
+
substituteInPlace jupyterhub/proxy.py --replace \
76
76
+
"'configurable-http-proxy'" \
77
77
+
"'${nodePackages.configurable-http-proxy}/bin/configurable-http-proxy'"
78
78
+
79
79
+
substituteInPlace jupyterhub/tests/test_proxy.py --replace \
80
80
+
"'configurable-http-proxy'" \
81
81
+
"'${nodePackages.configurable-http-proxy}/bin/configurable-http-proxy'"
82
82
+
83
83
+
substituteInPlace setup.py --replace \
84
84
+
"'npm', 'run', 'lessc', '--'" \
85
85
+
"'${nodePackages.less}/bin/lessc'"
86
86
+
87
87
+
substituteInPlace setup.py --replace \
88
88
+
"'npm', 'install', '--progress=false'" \
89
89
+
"'true'"
90
90
+
91
91
+
declare -A deps
92
92
+
deps[bootstrap]=${bootstrap}
93
93
+
deps[font-awesome]=${font-awesome}
94
94
+
deps[jquery]=${jquery}
95
95
+
deps[moment]=${moment}
96
96
+
deps[requirejs]=${requirejs}
97
97
+
98
98
+
mkdir -p share/jupyter/hub/static/components
99
99
+
for dep in "''${!deps[@]}"; do
100
100
+
if [ ! -e share/jupyter/hub/static/components/$dep ]; then
101
101
+
cp -r ''${deps[$dep]} share/jupyter/hub/static/components/$dep
102
102
+
fi
103
103
+
done
104
104
+
'';
105
105
+
106
106
+
propagatedBuildInputs = [
107
107
+
alembic ipython jinja2 pamela python-oauth2 requests sqlalchemy tornado
108
108
+
traitlets
109
109
+
];
110
110
+
111
111
+
# Disable tests because they take an excessive amount of time to complete.
112
112
+
doCheck = false;
113
113
+
114
114
+
disabled = pythonOlder "3.4";
115
115
+
116
116
+
meta = with lib; {
117
117
+
description = "Serves multiple Jupyter notebook instances";
118
118
+
homepage = http://jupyter.org/;
119
119
+
license = licenses.bsd3;
120
120
+
maintainers = with maintainers; [ ixxie cstrahan ];
121
121
+
};
122
122
+
}
+2
pkgs/top-level/python-packages.nix
···
9511
9511
9512
9512
jupyter_core = callPackage ../development/python-modules/jupyter_core { };
9513
9513
9514
9514
+
jupyterhub = callPackage ../development/python-modules/jupyterhub { };
9515
9515
+
9514
9516
jsonpath_rw = buildPythonPackage rec {
9515
9517
name = "jsonpath-rw-${version}";
9516
9518
version = "1.4.0";