Skip to main content

Pull Requests for JupyterLab

Project description

jupyterlab-pullrequests

Build Status Version Version

A JupyterLab extension for reviewing pull requests.

For now, it supports GitHub and GitLab providers.

Prerequisites

  • JupyterLab 2.x
  • nbdime 2.x

For GitLab, you will need also diff-match-patch

Usage

  • Open the pull request extension from the tab on the left panel

Installation

1. Install the extension with the following steps

pip install --upgrade jupyterlab-pullrequests
jupyter lab build

For GitLab, in addition, you will need to

pip install diff-match-patch

2. Getting your access token

For GitHub, the documentation is there. The token scope must be repo.

For GitLab, the documentation is there. The token scope must be api.

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

3. Setting your access token in JupyterLab Pull Requests

You now need to add the credentials you got from the provider 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.PRConfig.access_token = '<YOUR_ACCESS_TOKEN>'

where "<YOUR_ACCESS_TOKEN>" is the string value you obtained above.

If you are using GitLab instead of GitHub, you also need to set the provider:

c.PRConfig.provider = 'gitlab'

Congrats, you did it! Launch JupyterLab and look for the Pull Request tab on the left! 🎉

If you are not using GitHub.com or GitLab.com, you can set the API base URL of your provider with the configurable parameter PRConfig.api_base_url.

Settings

This extension as server settings.

  • PRConfig.access_token: Access token to be authenticated by the provider
  • PRConfig.provider: github (default) or gitlab
  • PRConfig.api_base_url: Provider API base url (default to https://api.github.com except if provider is gitlab then it defaults to https://gitlab.com/api/v4/)

Development

Contributing

If you would like to contribute to the project, please read our contributor documentation.

JupyterLab follows the official Jupyter Code of Conduct.

Install

For a development install, do the following in the repository directory:

# Install dependencies
pip install -e .
# Activate the server extension
jupyter serverextension enable --sys-prefix jupyterlab_pullrequests
# Link your development version of the extension with JupyterLab
jupyter labextension install .
# Rebuild Typescript source after making changes
jlpm run build

To rebuild the package and the JupyterLab app:

jlpm run build
jupyter lab build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterlab_pullrequests-2.0.0a0.tar.gz (94.2 kB view details)

Uploaded Source

Built Distribution

jupyterlab_pullrequests-2.0.0a0-py3-none-any.whl (122.7 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlab_pullrequests-2.0.0a0.tar.gz.

File metadata

  • Download URL: jupyterlab_pullrequests-2.0.0a0.tar.gz
  • Upload date:
  • Size: 94.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for jupyterlab_pullrequests-2.0.0a0.tar.gz
Algorithm Hash digest
SHA256 417223fe08427f8f72c6b87fa47989720118b157d07847c8f53e5bdba777adf7
MD5 50e20fd1e536ff4fc3d7366075771e00
BLAKE2b-256 d90eee9f01da39acbe485633ffd612f0e3f07be970506317a7ffe60525cbdc32

See more details on using hashes here.

File details

Details for the file jupyterlab_pullrequests-2.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: jupyterlab_pullrequests-2.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 122.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for jupyterlab_pullrequests-2.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 62bf996f4f22367ad90567bbb9f9aca1150c6386b71dbfdc5fdd5ad648df0998
MD5 785457003830f19adadbee490137df05
BLAKE2b-256 ecf10d10d91664ebe137a7fdac9ee0bd9e349cb563e8170a098f07d6b72f74c0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page