Skip to content

JupyterLab 3 update #402

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ coverage/
_*.d.ts
_build
.virtual_documents/

# labextensions
packages/completion-theme/krassowski_completion_theme/labextension/*
28 changes: 28 additions & 0 deletions packages/completion-theme/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2020, JupyterLab-LSP Developement Team All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 changes: 23 additions & 0 deletions packages/completion-theme/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
include LICENSE
include README.md
include pyproject.toml
include jupyter-config/krassowski_completion_theme.json

include package.json
include install.json
include ts*.json

graft krassowski_completion_theme/labextension

# Javascript files
graft src
graft style
prune **/node_modules
prune lib

# Patterns to exclude from any directory
global-exclude *~
global-exclude *.pyc
global-exclude *.pyo
global-exclude .git
global-exclude .ipynb_checkpoints
63 changes: 63 additions & 0 deletions packages/completion-theme/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# krassowski_completion_theme

![Github Actions Status](https://github.com/krassowski/jupyterlab-lsp.git/workflows/Build/badge.svg)

Completion theme manager for JupyterLab-LSP



## Requirements

* JupyterLab >= 3.0

## Install

```bash
pip install krassowski_completion_theme
```


## Contributing

### Development install

Note: You will need NodeJS to build the extension package.

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# Clone the repo to your local environment
# Change directory to the krassowski_completion_theme directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
```

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

```bash
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
```

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

```bash
jupyter lab build --minimize=False
```

### Uninstall

```bash
pip uninstall krassowski_completion_theme
jupyter labextension uninstall @krassowski/completion-theme
```
5 changes: 5 additions & 0 deletions packages/completion-theme/install.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packageManager": "python",
"packageName": "krassowski_completion_theme",
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package krassowski_completion_theme"
}
19 changes: 19 additions & 0 deletions packages/completion-theme/krassowski_completion_theme/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

import json
import os.path as osp

from ._version import __version__

HERE = osp.abspath(osp.dirname(__file__))

with open(osp.join(HERE, 'labextension', 'package.json')) as fid:
data = json.load(fid)

def _jupyter_labextension_paths():
return [{
'src': 'labextension',
'dest': data['name']
}]



19 changes: 19 additions & 0 deletions packages/completion-theme/krassowski_completion_theme/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
__all__ = ['__version__']

def _fetchVersion():
import json
import os

HERE = os.path.abspath(os.path.dirname(__file__))

for d, _, _ in os.walk(HERE):
try:
with open(os.path.join(d, 'package.json')) as f:
return json.load(f)['version']
except FileNotFoundError:
pass

raise FileNotFoundError('Could not find package.json under dir {}'.format(HERE))

__version__ = _fetchVersion()

Loading