Giter Club home page Giter Club logo

jupyterlab-github's Introduction

JupyterLab GitHub

Binder

A JupyterLab extension for accessing GitHub repositories.

What this extension is

When you install this extension, an additional filebrowser tab will be added to the left area of JupyterLab. This filebrowser allows you to select GitHub organizations and users, browse their repositories, and open the files in those repositories. If those files are notebooks, you can run them just as you would any other notebook. You can also attach a kernel to text files and run those. Basically, you should be able to open any file in a repository that JupyterLab can handle.

Here is a screenshot of the plugin opening this very file on GitHub: gitception

What this extension is not

This is not an extension that provides full GitHub access, such as saving files, making commits, forking repositories, etc. For it to be so, it would need to more-or-less reinvent the GitHub website, which represents a huge increase in complexity for the extension.

A note on rate-limiting

This extension has both a client-side component (that is, JavaScript that is bundled with JupyterLab), and a server-side component (that is, Python code that is added to the Jupyter server). This extension will work with out the server extension, with a major caveat: when making unauthenticated requests to GitHub (as we must do to get repository data), GitHub imposes fairly strict rate-limits on how many requests we can make. As such, you are likely to hit that limit within a few minutes of work. You will then have to wait up to an hour to regain access.

For that reason, we recommend that you take the time and effort to set up the server extension as well as the lab extension, which will allow you to access higher rate-limits. This process is described in the installation section.

Prerequisites

  • JupyterLab > 3.0
  • A GitHub account for the server extension

Installation

As discussed above, this extension has both a server extension and a lab extension. Both extensions will be installed by default when installing from PyPI, but you may have only lab extension installed if you used the Extension Manager in JupyterLab.

We recommend completing the steps described below as to not be rate-limited. The purpose of the server extension is to add GitHub credentials that you will need to acquire from https://github.com/settings/developers, and then to proxy your request to GitHub.

For JupyterLab version older than 3 please see the instructions on the 2.x branch.

1. Installing both server and prebuilt lab extension

JupyterLab 4.x

To install the both the server extension and (prebuilt) lab extension, enter the following in your terminal:

pip install jupyterlab-github

JupyterLab 3.x

We need to pin the extension version to 3.0.1 for making it work on the JupyterLab 3.x.

pip install 'jupyterlab-github==3.0.1'

After restarting JupyterLab, the extension should work, and you can experience the joys of being rate-limited first-hand!

2. Getting your credentials from GitHub

There are two approaches to getting credentials from GitHub: (1) you can get an access token, (2) you can register an OAuth app. The second approach is not recommended, and will be removed in a future release.

Getting an access token (recommended)

You can get an access token by following these steps:

  1. Verify your email address with GitHub.
  2. Go to your account settings on GitHub and select "Developer Settings" from the left panel.
  3. On the left, select "Personal access tokens"
  4. Click the "Generate new token" button, and enter your password.
  5. Give the token a description, and check the "repo" scope box.
  6. Click "Generate token"
  7. You should be given a string which will be your access token.

Remember that this token is effectively a password for your GitHub account. Do not share it online or check the token into version control, as people can use it to access all of your data on GitHub.

Setting up an OAuth application (deprecated)

This approach to authenticating with GitHub is deprecated, and will be removed in a future release. New users should use the access token approach. You can register an OAuth application with GitHub by following these steps:

  1. Log into your GitHub account.
  2. Go to https://github.com/settings/developers and select the "OAuth Apps" tab on the left.
  3. Click the "New OAuth App" button.
  4. Fill out a name, homepage URL, description, and callback URL in the form. This extension does not actually use OAuth, so these values actually do not matter much, you just need to enter them to register the application.
  5. Click the "Register application" button.
  6. You should be taken to a new page with the new application information. If you see fields showing "Client ID" and "Client Secret", congratulations! These are the strings we need, and you have successfuly set up the application.

It is important to note that the "Client Secret" string is, as the name suggests, a secret. Do not share this value online, as people may be able to use it to impersonate you on GitHub.

3. Enabling and configuring the server extension

The server extension will be enabled by default on new JupyterLab installations if you installed it with pip. If you used Extension Manager in JupyterLab, please uninstall the extension and install it again with the instructions from point (1).

Confirm that the server extension is installed and enabled with:

jupyter server extension list

you should see the following:

- Validating jupyterlab_github...
     jupyterlab_github 4.0.0 OK

On some older installations (e.g. old JupyterHub versions) which use jupyter notebook server instead of the new jupyter-server, the extension needs to show up on the legacy serverextensions list (note: no space between server and extension):

jupyter serverextension list

If the extension is not enabled run:

jupyter server extension enable jupyterlab_github

or if using the legacy notebook server:

jupyter serverextension enable jupyterlab_github

You now need to add the credentials you got from GitHub to your server configuration file. Instructions for generating a configuration file can be found here. Once you have identified this file, add the following lines to it:

c.GitHubConfig.access_token = '< YOUR_ACCESS_TOKEN >'

where "< YOUR_ACCESS_TOKEN >" is the string value you obtained above. If you generated an OAuth app, instead enter the following:

c.GitHubConfig.client_id = '< YOUR_CLIENT_ID >'
c.GitHubConfig.client_secret = '< YOUR_CLIENT_SECRET >'

where "< YOUR_CLIENT_ID >" and "< YOUR_CLIENT_SECRET >" are the app values you obtained above.

With this, you should be done! Launch JupyterLab and look for the GitHub tab on the left!

Customization

You can set the plugin to start showing a particular repository at launch time. Open the "Advanced Settings" editor in the Settings menu, and under the GitHub settings add

{
  "defaultRepo": "owner/repository"
}

where owner is the GitHub user/org, and repository is the name of the repository you want to open.

jupyterlab-github's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyterlab-github's Issues

Private Repository Access?

Hi All,

I have installed the jupyterlab-github client and serverside extension as per the instructions in the ReadMe. The application is working great, but I am not able to access (or even view) my private repositories. Is private repository access currently supported, or in the works (hopefully)?

Thanks!
-Rick

GitLab support?

Hi,
great plugin - thanks!

We would like to have a tab in our jupyterhub/jupyterlab setup, which directs users to example notebooks prepared especially for our clusters.

Therefore I would like to use your plugin with our own gitlab server.
How difficult do you think would it be to make this possible?

Best,
Jens

ValueError: The extension does not support current version od JupyterLab

jupyter labextension install @jupyterlab/git brings me:
An error occured.
ValueError: The extension "@jupyterlab/git" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab --- Extension --- Package

=2.1.0 <2.2.0 --- >=1.1.0 <2.0.0 --- @jupyterlab/application
=2.1.0 <2.2.0 --- >=1.1.0 <2.0.0 --- @jupyterlab/apputils
=2.1.0 <2.2.0 --- >=1.1.0 <2.0.0 ---@jupyterlab/console
=4.1.0 <4.2.0 --- >=3.1.0 <4.0.0 ---@jupyterlab/coreutils
=2.1.0 <2.2.0 --- >=1.1.0 <2.0.0 --- @jupyterlab/filebrowser
=5.1.0 <5.2.0 --- >=4.1.0 <5.0.0 --- @jupyterlab/services
=2.1.0 <2.2.0 --- >=1.1.0 <2.0.0 --- @jupyterlab/terminal
=16.9.0 <16.10.0 --- >=16.8.4 <16.9.0 --- react
=16.9.0 <16.10.0 --- >=16.8.4 <16.9.0 --- react-dom

is this extension working??

Working directory - Deviating behavior from the Files tab

Expected behaviour

If I open some-notebook.ipynb in /home/jovyan/some-folder from the Files tab, the working directory for the kernel will be /home/jovyan/some-folder.

Unexpected behaviour

If I open some-notebook.ipynb while browsing using the GitHub tab, it seems like the working directory for the kernel will always be /home/jovyan.
jupyterlab-github-cwd

[Question] Anyway to change refresh duration in file browser

For content from github, it really does not need refresh every 10 seconds.

As we have more than 1000 repos in an org, the list always changed back to repos of org even user enter a repo because the request of repos in org is longer than 10 sec.

Lab extension compatibility glitch

Hi @ian-r-rose,

What an amazing work ❤️

Would you consider updating the version in package.json for this extension to work with the current Jupyter labextension 0.12.0+ version? I currently have this error (JPLab 0.29.1) when trying to install the labextension:

ValueError:
"@jupyterlab/[email protected]" is not compatible with the current JupyterLab
Conflicting Dependencies:
JupyterLab              Extension            Package
>=0.12.0-0 <0.13.0-0    >=0.11.0-0 <0.12.0-0 @jupyterlab/application
>=0.12.4-0 <0.13.0-0    >=0.11.0-0 <0.12.0-0 @jupyterlab/apputils
>=0.12.0-0 <0.13.0-0    >=0.11.0-0 <0.12.0-0 @jupyterlab/coreutils
>=0.12.0-0 <0.13.0-0    >=0.11.0-0 <0.12.0-0 @jupyterlab/docmanager
>=0.12.0-0 <0.13.0-0    >=0.11.0-0 <0.12.0-0 @jupyterlab/filebrowser
>=0.51.0-0 <0.52.0-0    >=0.50.0-0 <0.51.0-0 @jupyterlab/services

Cheers

Safari: User name input does not lead to listing of repos

Using J-Lab in Safari with this plugin, i put a username and it does not show the available repos.
I verified via Chrome, that the plugin was installed successfully, as things work there.

Here's what the javascript console says:

screenshot 2018-04-26 11 27 11

Here's my jupyters:

(stable) └─❱❱❱ conda list jupyter                                       +7857 11:46 ❰─┘
# packages in environment at /Users/klay6683/miniconda3/envs/stable:
#
# Name                    Version                   Build  Channel
jupyter                   1.0.0                      py_1    conda-forge
jupyter_client            5.2.3                    py36_0    conda-forge
jupyter_console           5.2.0                    py36_0    conda-forge
jupyter_contrib_core      0.3.3                    py36_1    conda-forge
jupyter_contrib_nbextensions 0.5.0                    py36_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
jupyter_highlight_selected_word 0.2.0                    py36_0    conda-forge
jupyter_latex_envs        1.4.4                    py36_0    conda-forge
jupyter_nbextensions_configurator 0.4.0                    py36_0    conda-forge
jupyterlab                0.32.0                   py36_1    conda-forge
jupyterlab_launcher       0.10.5                   py36_0    conda-forge

and my conda info:

(stable) └─❱❱❱ conda info                                               +7858 11:47 ❰─┘

     active environment : stable
    active env location : /Users/klay6683/miniconda3/envs/stable
            shell level : 1
       user config file : /Users/klay6683/.condarc
 populated config files : /Users/klay6683/.condarc
          conda version : 4.5.1
    conda-build version : not installed
         python version : 3.6.5.final.0
       base environment : /Users/klay6683/miniconda3  (writable)
           channel URLs : https://conda.anaconda.org/menpo/osx-64
                          https://conda.anaconda.org/menpo/noarch
                          https://conda.anaconda.org/jlaura/osx-64
                          https://conda.anaconda.org/jlaura/noarch
                          https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/conda-canary/osx-64
                          https://conda.anaconda.org/conda-canary/noarch
                          https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/osx-64
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/pro/osx-64
                          https://repo.anaconda.com/pkgs/pro/noarch
                          https://conda.anaconda.org/NSIDC/osx-64
                          https://conda.anaconda.org/NSIDC/noarch
          package cache : /Users/klay6683/miniconda3/pkgs
                          /Users/klay6683/.conda/pkgs
       envs directories : /Users/klay6683/miniconda3/envs
                          /Users/klay6683/.conda/envs
               platform : osx-64
             user-agent : conda/4.5.1 requests/2.18.4 CPython/3.6.5 Darwin/16.7.0 OSX/10.12.6
                UID:GID : 273771:2260
             netrc file : None
           offline mode : False

Distinguish 403 errors

One can get 403 errors from being rate-limited and from trying to open files larger than 1Mb. We need to properly distinguish those cases.

File Load Error when trying to open a notebook

When I try to open a notebook using the extension, I always get the error:

File Load Error for ....
undefined is not an object (evaluating 'value.cells')

If I download the file locally, I have no issue opening it.
I'm using (installed from conda-forge):

  - jupyter_client=5.2.3=py_1
  - jupyter_core=4.4.0=py_0
  - jupyterlab=0.35.4=py36_0
  - jupyterlab_server=0.2.0=py_0
  - notebook=5.7.2=py36_1000
  - pip:
    - jupyterlab-github==0.7.0

lab extension:
@jupyterlab/github v0.10.0  enabled  OK

file_load_error

make filebrowser filelist disappear

after i installed this github extension,filelists in the filebrowser disappeared。i've googled and tried a lot,but can't fix it ,finally had to reinstall jupyterlab and delete all the node_modules@jupyterlab . it returned to normal, i guess sth is not compatible with filebrowser.
image

environment: windows 10 python 3.6.8
jupyter core : 4.5.0
jupyter-notebook : 6.0.1
qtconsole : not installed
ipython : 7.8.0
ipykernel : 5.1.2
jupyter client : 5.3.1
jupyter lab : 1.0.2
nbconvert : 5.5.0
ipywidgets : not installed
nbformat : 4.4.0
traitlets : 4.3.2

Include org/user in the path

This will give resources on GitHub a unique path from JupyterLab's perspective, and will allow, among other things, page refresh to work correctly.

JupyterLab failed to build Error: Cannot find module './_baseValues'

Description

Hello, I am new to Python and I decided to use your environment.
An error appear when I try to install extensions.

"jupyter labextension install @jupyterlab/github"
"jupyter lab build"

I get the error :
jupyterLab failed to build

The log file shows an issue finding the module './_baseValues'
Error: Cannot find module './_baseValues'

I have not been able to find a solution.

I tried using
npm install ../_baseValues

Add Copy & Paste for files and directories

In version 2.1.2 I can't find "Copy" item in the context menu of the Files Browser as it is shown in the documentation on the picture. "Cut" item is available though.

Is it possible that my installation is somehow misconfigured or it is a bug?

My config:

c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.port = 8888
c.NotebookApp.notebook_dir = '/app/home'
c.NotebookApp.password = 'sha1:salt:hash'
c.NotebookApp.open_browser = False
c.NotebookApp.allow_password_change = False
c.NotebookApp.allow_root = True

The app is launched as jupyter lab.

c.GitHubConfig.access_token is not recognized as the name of a cmdlet, function, script file, or operable program.

I have done step by step according to this code file, installed labextension and got my personal access token from Github.
While in the step 3. after installing jupyter_github, generating a configuration file named jupyter_notebook_config.py in my directory and run this file, when I type in c.GitHubConfig.access_token = '< ACCESS_TOKEN >', it returned an error message.

Code:
PS C:\Users\Username.jupyter> jupyter labextension install @jupyterlab/github

PS C:\Users\Username.jupyter> pip install jupyterlab_github
PS C:\Users\Username.jupyter> jupyter serverextension enable --sys-prefix jupyterlab_github

Then generated jupyter_notebook_config.py in the directory of PS C:\Users\Username.jupyter

PS C:\Users\Username.jupyter> c.GitHubConfig.access_token = '< YOUR_ACCESS_TOKEN >'

Error Return:
c.GithubConfig.access_token : The term 'c.GitHubConfig.access_token' is not recognised as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name. or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • c.GitHubConfig.access_token = '< dsfsddsgxxxxxxxx >'
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : ObjectNotFound: (c.GitHubConfig.access_token:String) [], CommandNotFoundException
    • FullyQualifiedErrorId: CommanNotFoundException

Thank you!!!

Github deprecation notice

Hi!
First, thanks for your software!
I used it today to browse the public repos of a github user and subsequently received this deprecation notice in my email:

On February 5th, 2020 at 23:32 (UTC) your personal access token using JupyterLab GitHub was used as part of a query parameter to access an endpoint through the GitHub API:
https://api.github.com/
Please use the Authorization HTTP header instead, as using the access_token query parameter is deprecated.
Depending on your API usage, we'll be sending you this email reminder once every 3 days for each token and User-Agent used in API calls made on your behalf.
Just one URL that was accessed with a token and User-Agent combination will be listed in the email reminder, not all.
Visit https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api/#authenticating-using-query-parameters for more information.
Thanks,
The GitHub Team

I'm using jupyterlab-github 1.0.0 and jupyterlab 1.2.6.

Escape spaces

Files with spaces in their names need to be escaped, otherwise they fail to load.

Support more than 30 repos per user/org

Typing in my username in the username field, I only gets the first 30 repositories. This is irrespective of sorting order.

Edit: If I type in minrk, I only get to repo names starting with 'b' before being cut off ;)

Changeable github URL?

Can this integration be used with a private github URL instead of the actual github.com? In other words, can the URL be configurable (leaving the default to github.com)?

Cannot open `directory` because it is a submodule'

Hi,

I'm having an issue with Git submodules as described below:

Description

When a directory is a GIT submodule, an attempt to open it with the @jupyterlab/github extension
displays an error:

Annotation 2019-09-30 232058

Reproduce

  1. Create a GIT submodule on the file system typing something like this on the
    command line
# To add and clone a new submodule
$ git submodule add https://github.com/chaconinc/DbConnector
$ git clone https://github.com/chaconinc/MainProject
$ git submodule init
$ git submodule update
  1. Open Jupyter Lab with the @jupyterlab/github extension installed.
  2. Open the GIT panels and browse to the submodule
  3. See error 'Cannot open <directory> because it is a submodule'

Expected behavior

Git submodules should be supported like regular Git modules. That would be extremely helpful!

Context

  • Python package version:

    # packages in environment at c:\Miniconda:
    #
    # Name                Version               Build  Channel
    jupyterlab-github    1.0.0                 pypi_0    pypi
    

Thanks,

WetHat

How to copy a file locally?

The extension is really nice to run a notebook directly from a GitHub repository.

I think a common use case is to create a local copy of a notebook so that it can be modified and saved locally. I can't find an easy way to copy a file from the GitHub drive to the local filesystem.

I tried to use "Copy" from the contextual menu (when right clicking on a file) and then "Paste" but nothing happens.

The only way I found so far is to open the notebook in a text editor, copy the content, create a text file, paste, and rename the file. Not super user friendly. Is there a better way to do that?

Config option `client_id` not recognized by `GitHubConfig`

I had this running fine for a while, but since a few weeks ago, I'm getting this error in my server log, despite the fact that browsing user's GitHub repos actually works?

/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/traitlets/config/configurable.py:84: UserWarning: Config option `client_id` not recognized by `GitHubConfig`.
  self.config = config
/Users/klay6683/miniconda3/envs/py37/lib/python3.7/site-packages/traitlets/config/configurable.py:84: UserWarning: Config option `client_secret` not recognized by `GitHubConfig`.
  self.config = config

I have an OAuth configured and have c.GitHubConfig.client_id and c.GitHubConfig.client_secret defined in jupyter_notebook_config.py.

My Jlab version is 1.1.4 and I have updated to the latest jupyterlab-github via the Jlab extension manager plugin.

Set default github repository on start

Hello,

we would like to use your jupyterlab-github extension in a multiuser jupyterhub installation on our cluster, which shows users example notebooks (same purpose as explained in #43).

Is it possible to set a default github repository at installation time for all users
which is linked to the Home-button instead of an ?

Best,
Jens Henrik

Cannot set default github repo during docker build

Hi all,
I'm trying to pre-load the default github repo that is shown when a docker is loaded up using the something like the following in my dockerfile (and needless to say, not working):

#Set up github access (this is temporary; real version will request key at container runtime)
RUN echo "c.GitHubConfig.access_token = 'ToBeReplacedWithLineInRunTimeShellScript'" >> ~/.jupyter/jupyter_notebook_config.py

RUN mkdir -p ~/.jupyter/lab/user-settings/@jupyterlab/github && \
    echo "{\n  "defaultRepo": "alexlicohen/script-toolbox"\n}" >> ~/.jupyter/lab/user-settings/@jupyterlab/github/drive.jupyterlab-settings

add a button to clone the repo

Currently extension supports browsing the repo and opening the current repo either in binder or github itself. It would be useful to be able to clone the repo in current working directory or user defined directory.

Cannot import .py file on github repo

Some people have their config py files on their repo and use such files in their notebook, but this extension cannot import such py files. It will throw a ModuleNotFoundError.

jupyter labextension list showing github extension as "disabled"

Followed the instructions in the README. "jupyter labextension list" command shows github is disabled. Tried enabling with "jupyter serverextension enable --py jupyterlab_github". No luck. Any help would be appreciated.

screen shot 2019-01-16 at 10 03 59 pm

Version details : -

OS - MacOS Mojave
Jupyter Notebook version - 5.6.0
Jupyter Lab version - 0.35.4
Jupyter Hub version - 0.9.4

Jupyterhub Integration

This is really a great addition to Jupyterlab. I'm wondering if anyone has devised a way of setting the token in Jupyterhub (and specificity using the Zero to Jupyterhub helm chart)? Thanks in advance.

[GitHub] Deprecation Notice

On April 7th, 2020 at 19:31 (UTC) you used a password to access an endpoint through the GitHub API using python-requests/2.18.4:

I did not access my account on that specific hour . I even forgot about this website. How come i get such notice if I don’t use the account???

Private repos in organization I have access to are not listed (only public ones)

This seems to be fixed in #48 but not for me...

I have access to all private repositories in an organization. I have created an access token (for my user, not for the organization) with full repo permissions and added it to jupyter as described in your README:

~:: cat ~/.jupyter/jupyter_notebook_config.py 
c.GitHubConfig.access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Still only public repos are listed for the organization in jupyterlab.

@jupyterlab/github doesn't appear to be on npm registry

@ian-r-rose ... was trying to install this via a Dockerfile, but hitting this error. Is the plan to post this as a package to npmjs.org? Thanks.

Step 33/52 : RUN jupyter labextension install @jupyterlab/github
 ---> Running in 53c901e7972e
> npm pack @jupyterlab/github
npm ERR! Linux 4.4.0-1020-aws
npm ERR! argv "/opt/conda/bin/node" "/opt/conda/bin/npm" "pack" "@jupyterlab/github"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code E404

npm ERR! 404 Not found : @jupyterlab/github
npm ERR! 404 
npm ERR! 404  '@jupyterlab/github' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Client-side fallback

We should detect if the server proxy is not installed and use the extension purely client-side (with a warning). Then the user could get a few minutes of use before being rate limited.

Viewing private repos

I'm trying to view private repos for my org. I'm running JupyterHub in minikube with JupyterLab configured. I've also installed both the lab as well as server extensions by adding the following to my userimage dockerfile

RUN jupyter labextension install @jupyterlab/github

RUN pip install jupyterlab_github
RUN jupyter serverextension enable --sys-prefix jupyterlab_github

I've confirmed that the python package version is 0.6 and I am running jupyterlab version 0.32.0.

I've added my access token to helm values file as:

hub:
  extraEnv:
    JUPYTER_ENABLE_LAB: 1
  extraConfig: |
    c.KubeSpawner.cmd = ['jupyter-labhub']
    c.GitHubConfig.access_token = 'XXXXXXXXXXXXXXXXXXXXXXXX'

I cannot see any of the private repos.

I'm also seeing sporadic rate-limiting which makes me believe that possibly the server extension is not properly installed?

Any guidance would be appreciated.

Non-English characters. Problem with Encoding.

There is a wrong text encoding if you try to open any file with non-english characters like russian or japanese. You can see that in README.md for github-repository on russian here: Skaarj7/netology or on japanese: gogotanaka/Primes. Just trash instead of cyrillic symbols or hieroglyphs.
screen

RuntimeError: JupyterLab failed to build

It works on Windows 10/Anaconda(version=2019.10).

I've tried on AWS/Linux EC2, there was an issue.
Tested in two cases: on JupyterHub and on Jupyter notebok - the same result!
One point, I did it when JupyterHub and Jupyter was runnning, after failed I stooped and tried again - the same result!

Run command:
(base) []$ jupyter labextension install @jupyterlab/github
Building jupyterlab assets (build:prod:minimize)
An error occured.
RuntimeError: JupyterLab failed to build
See the log file for details: /tmp/jupyterlab-debug-te2pdi6d.log

From log file

node /home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js yarn-deduplicate -s fewer
yarn run v1.15.2
$ /home/ec2-user/anaconda3/share/jupyter/lab/staging/node_modules/.bin/yarn-deduplicate -s fewer
Done in 1.02s.

node /home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyterlab/staging/yarn.js run build:prod:minimize
yarn run v1.15.2
$ cross-env NODE_OPTIONS=--max_old_space_size=4096 webpack --config webpack.prod.minimize.config.js
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

JupyterLab failed to build
Traceback (most recent call last):

File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
yield

File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 105, in start
core_config=self.core_config)

File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 378, in build
command=command, clean_staging=clean_staging)

File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/jupyterlab/commands.py", line 583, in build
raise RuntimeError(msg)

RuntimeError: JupyterLab failed to build

Exiting application: jupyter

[Design question] Why not simply git clone the repositories?

@ian-r-rose @dhirschfeld
We're building a similar plugin for GitLab and had a couple of questions about design choices you made in this repo. We would be grateful if you could answer some of these as it'll set us on the right path.

  • I see that you are fetching repository contents via GitHub API and converting them into Jupyter models (Contents.IModel etc.). Why not simply run a git clone from the server extension? That way the contents would be available under the regular file browser of Jupyter

  • Are the repository contents backed on disk somewhere? Does the refresh from repo overwrite the local edits?

  • I'm wondering if we were to go git clone way, how hard/easy would it be to later support 2-way synch (commit/push to repo etc.). Maybe we could read the repository state on disk and allow users to do git add/commit/push etc. Maybe use the git extension on the top.

Feel free to mention anything else I should be aware of. Thanks for your time!

Error Loading Theme

Error Loading Theme
Stylesheet failed to load: /lab/api/themes/@jupyterlab/theme-light-extension/index.css

Tab is missing name

I'm running this extension successfully in a py36 conda env, with this minor hiccup that the tab name is blank:

screenshot 2017-11-12 22 07 30

My installed jupyter related versions are:

(stable) └─❱❱❱ conda list jupyter                                         +7004 22:06 ❰─┘
# packages in environment at /Users/klay6683/miniconda3/envs/stable:
#
jupyter                   1.0.0                    py36_0    conda-forge
jupyter_client            5.1.0                    py36_0    conda-forge
jupyter_console           5.2.0                    py36_0    conda-forge
jupyter_contrib_core      0.3.3                    py36_0    conda-forge
jupyter_contrib_nbextensions 0.3.3                    py36_0    conda-forge
jupyter_core              4.4.0                      py_0    conda-forge
jupyter_highlight_selected_word 0.1.0                    py36_0    conda-forge
jupyter_latex_envs        1.3.8.2                  py36_1    conda-forge
jupyter_nbextensions_configurator 0.2.8                    py36_0    conda-forge
jupyterlab                0.29.1                   py36_0    conda-forge
jupyterlab-github         0.2.0                     <pip>
jupyterlab_launcher       0.5.5                    py36_0    conda-forge

compatibility issue with jupyter lab version 1.0.0a1

I installed Jupyter lab in developer mode(version=1.0.0a1). and tried to install jupyterlab-github from extensions manager in jupyter lab. It is causing the following compatibility errors.:
**An error occurred installing @jupyterlab/github.

Error message:

No version of @jupyterlab/github could be found that is compatible with the current version of JupyterLab.

Conflicting Dependencies:
JupyterLab Extension Package

=1.0.0-alpha.3 <2.0.0 >=0.19.1 <0.20.0 @jupyterlab/filebrowser
=1.0.0-alpha.3 <2.0.0 >=0.19.1 <0.20.0 @jupyterlab/docmanager
=1.0.0-alpha.3 <2.0.0 >=0.19.1 <0.20.0 @jupyterlab/apputils
=1.0.0-alpha.3 <2.0.0 >=0.19.1 <0.20.0 @jupyterlab/application**

screen shot 2019-02-20 at 1 27 22 pm

unusable link generated from relative paths inside notebooks

Hello,

thanks for the great extension. It plays an important role for our cluster-wide installation of JupyterHub/JupyterLab and allows users to browse example notebooks easily.

These example notebooks often include links to other notebooks in the same github repository in Markdown cells like this:

* [Notebook Basics](examples/Notebook/Notebook Basics.ipynb)
* [IPython - beyond plain python](examples/IPython Kernel/Beyond Plain Python.ipynb)
* [Markdown Cells](examples/Notebook/Working With Markdown Cells.ipynb)

This will lead to a generated but wrong/damaged link like this:
github:<notebook-path-on-github>/<relative-path-to-file>

This is also relevant, if notebooks refer to images, which are part of the repository.

Best,
Jens Henrik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.