Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install multiple versions of same extension #6857

Merged
merged 14 commits into from Aug 15, 2019
Merged

Install multiple versions of same extension #6857

merged 14 commits into from Aug 15, 2019

Commits on Jul 19, 2019

  1. Install multiple versions of same extension

    This adds support for installing multiple versions of the same
    JupyterLab extension, fixing #6491.
    
    It reuses the syntax for
    [yarn add's alias command](https://yarnpkg.com/lang/en/docs/cli/add/#toc-yarn-add-alias)
    so that you can do:
    
    ```bash
    jupyter labextension install test-1@npm:jupyterlab-test-extension@1.0
    jupyter labextension install test-2@npm:jupyterlab-test-extension@2.0
    ```
    
    This is a real extension I published two versions of, with different
    extension ID's in each, to test with
    https://github.com/saulshanabrook/jupyterlab-test-extension.
    Once you install both of them, you should get two different console
    logs on startup.
    
    If we run `jupyter labextension list` after installing these, we see
    both versions:
    
    ```bash
    JupyterLab v1.0.2
    Known labextensions:
       app dir: /usr/local/miniconda3/envs/jupyterlab/share/jupyter/lab
            test-1 jupyterlab-test-extension v1.0.0  enabled  OK
            test-2 jupyterlab-test-extension v2.0.0  enabled  OK
    ```
    
    And we can uninstall each separately:
    
    ```bash
    jupyter labextension uninstall test-1
    ```
    
    As well as update each of them:
    
    ```bash
    jupyter labextension update test-1
    ```
    
    ## How?
    
    Normally, zipped extensions are stored with the name like
    `jupyterlab-test-extension-1.0.0.tgz`. However, we need to differentiate
    extensions installed as aliases, without mucking with their actual
    contents.So we save them instead like
    `test-1@npm:jupyterlab-test-extension-1.0.0.tgz`.
    
    Then, we we go to read our packages, we know they have an alias.
    saulshanabrook committed Jul 19, 2019
    Copy the full SHA
    6ef0ec2 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2019

  1. Copy the full SHA
    b43e758 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    cb57a44 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2019

  1. Copy the full SHA
    dc6716c View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2019

  1. Copy the full SHA
    48fa17f View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2019

  1. Copy the full SHA
    79d5b8f View commit details
    Browse the repository at this point in the history
  2. Test pinning

    saulshanabrook committed Aug 2, 2019
    Copy the full SHA
    38993a3 View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2019

  1. Fix python test execution on mac

    Otherwise I get:
    
    ```
    E       AssertionError: '/var/folders/m7/t8dvwtnn32z84333p845tly40000gn/T/tmpfn25l4mq/data/lab' != '/private/var/folders/m7/t8dvwtnn32z84333p845tly40000gn/T/tmpfn25l4mq/data/lab'
    E       - /var/folders/m7/t8dvwtnn32z84333p845tly40000gn/T/tmpfn25l4mq/data/lab
    E       + /private/var/folders/m7/t8dvwtnn32z84333p845tly40000gn/T/tmpfn25l4mq/data/lab
    E       ? ++++++++
    ```
    saulshanabrook committed Aug 7, 2019
    Copy the full SHA
    87d6822 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    b823d2a View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    1ef8937 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    f269cc0 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2019

  1. Copy the full SHA
    93b08ca View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    6af8bbe View commit details
    Browse the repository at this point in the history
  3. Fix merge

    saulshanabrook committed Aug 15, 2019
    Copy the full SHA
    5edaa3f View commit details
    Browse the repository at this point in the history