@@ -23,9 +23,9 @@ which represents a huge increase in complexity for the extension.
23
23
24
24
### A note on rate-limiting
25
25
26
- This extension has both a client-side component (that is, Javascript that is bundled
26
+ This extension has both a client-side component (that is, JavaScript that is bundled
27
27
with JupyterLab), and a server-side component (that is, Python code that is added
28
- to the Jupyter notebook server). This extension _ will_ work with out the server extension,
28
+ to the Jupyter server). This extension _ will_ work with out the server extension,
29
29
with a major caveat: when making unauthenticated requests to GitHub
30
30
(as we must do to get repository data), GitHub imposes fairly strict rate-limits
31
31
on how many requests we can make. As such, you are likely to hit that limit
@@ -37,25 +37,31 @@ This process is described in the [installation](#Installation) section.
37
37
38
38
## Prerequisites
39
39
40
- - JupyterLab 1 .0
41
- - A GitHub account for the serverextension
40
+ - JupyterLab 3 .0
41
+ - A GitHub account for the server extension
42
42
43
43
## Installation
44
44
45
- As discussed above, this extension has both a serverextension and a labextension.
45
+ As discussed above, this extension has both a server extension and a lab extension.
46
+ Both extensions will be installed by default when installing from PyPI, but you may
47
+ have only lab extension installed if you used the Extension Manager in JupyterLab 3.x.
48
+
46
49
We recommend installing both so as to not be rate-limited.
47
- The purpose of the serverextension is to add GitHub credentials that you will need to acquire
50
+ The purpose of the server extension is to add GitHub credentials that you will need to acquire
48
51
from https://github.com/settings/developers , and then to proxy your request to GitHub.
49
52
50
- ### 1. Installing the labextension
53
+ For JupyterLab version older than 3 please see the instructions on the
54
+ [ 2.x branch] ( https://github.com/jupyterlab/jupyterlab-github/tree/2.x ) .
55
+
56
+ ### 1. Installing both server and prebuilt lab extension
51
57
52
- To install the labextension , enter the following in your terminal:
58
+ To install the both the server extension and (prebuilt) lab extension , enter the following in your terminal:
53
59
54
60
``` bash
55
- jupyter labextension install @ jupyterlab/ github
61
+ pip install jupyterlab- github
56
62
```
57
63
58
- With only this installed , the extension should work, and you can experience the joys of
64
+ After the restarting JupyterLab , the extension should work, and you can experience the joys of
59
65
being rate-limited first-hand!
60
66
61
67
### 2. Getting your credentials from GitHub
@@ -100,23 +106,42 @@ You can register an OAuth application with GitHub by following these steps:
100
106
It is important to note that the "Client Secret" string is, as the name suggests, a secret.
101
107
_ Do not_ share this value online, as people may be able to use it to impersonate you on GitHub.
102
108
103
- ### 3. Installing the serverextension
109
+ ### 3. Enabling and configuring the server extension
110
+
111
+ The server extension will be enabled by default on new JupyterLab installations
112
+ if you installed it with pip. If you used Extension Manager in JupyterLab 3.x,
113
+ please uninstall the extension and install it again with the instructions from point (1).
114
+
115
+ Confirm that the server extension is installed and enabled with:
116
+
117
+ ``` bash
118
+ jupyter server extension list
119
+ ```
120
+
121
+ you should see the following:
122
+
123
+ ```
124
+ - Validating jupyterlab_github...
125
+ jupyterlab_github 3.0.0 OK
126
+ ```
104
127
105
- Install the serverextension using pip, and then enable it:
128
+ On some older installations (e.g. old JupyterHub versions) which use jupyter
129
+ ` notebook ` server instead of the new ` jupyter-server ` , the extension needs to
130
+ show up on the legacy ` serverextensions ` list (note: no space between _ server_ and _ extension_ ):
106
131
107
132
``` bash
108
- pip install jupyterlab_github
133
+ jupyter serverextension list
109
134
```
110
135
111
- If you are running Notebook 5.2 or earlier, enable the server extension by running
136
+ If the extension is not enabled run:
112
137
113
138
``` bash
114
- jupyter serverextension enable --sys-prefix jupyterlab_github
139
+ jupyter server extension enable jupyterlab_github
115
140
```
116
141
117
142
You now need to add the credentials you got from GitHub
118
- to your notebook configuration file. Instructions for generating a configuration
119
- file can be found [ here] ( http ://jupyter-notebook .readthedocs.io/en/stable/config_overview .html#configure-nbserver ) .
143
+ to your server configuration file. Instructions for generating a configuration
144
+ file can be found [ here] ( https ://jupyter-server .readthedocs.io/en/stable/users/configuration .html#configuring-a-jupyter-server ) .
120
145
Once you have identified this file, add the following lines to it:
121
146
122
147
``` python
0 commit comments