Skip to content

Commit

Permalink
Merge pull request #170 from ian-r-rose/restore-versioneer
Browse files Browse the repository at this point in the history
Restore versioneer
  • Loading branch information
ian-r-rose authored Jan 13, 2021
2 parents bcd54f7 + a2dddb5 commit 21ce71e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 21 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ distributed >= 1.24.1

## Installation

To install the Dask JupyterLab extension you will need both JupyterLab,
and [Node.js](https://nodejs.org/), with at least version 12.
To install the Dask JupyterLab extension you will need to have JupyterLab installed.
For JupyterLab < 3.0, you will also need [Node.js](https://nodejs.org/) version >= 12.
These are available through a variety of sources.
One source common to Python users is the conda package manager.

Expand All @@ -32,8 +32,22 @@ conda install jupyterlab
conda install -c conda-forge nodejs
```

This extension includes both a client-side JupyterLab extension and a server-side
Jupyter notebook extension. Install via pip or conda-forge:
### JupyterLab 3.0 or greater

You should be able to install this extension with pip or conda,
and start using it immediately, e.g.

```bash
pip install dask-labextension
```

### JupyterLab 2.x

This extension includes both client-side and server-side components.
Prior to JupyterLab 3.0 these needed to be installed separately,
with node available on the machine.

The server-side component can be installed via pip or conda-forge:

```bash
pip install dask_labextension
Expand All @@ -43,11 +57,10 @@ pip install dask_labextension
conda install -c conda-forge dask-labextension
```

and build the extension as follows:
You then build the client-side extension into JupyterLab with:

```bash
jupyter labextension install dask-labextension
jupyter serverextension enable dask_labextension
```

If you are running Notebook 5.2 or earlier, enable the server extension by running
Expand Down Expand Up @@ -131,22 +144,23 @@ labextension:
## Development install
As described in the [JupyterLab documentation](https://jupyterlab.readthedocs.io/en/stable/developer/extension_dev.html#extension-authoring) for a development install of the labextension you can run the following in this directory:
As described in the [JupyterLab documentation](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#developing-a-prebuilt-extension)
for a development install of the labextension you can run the following in this directory:
```bash
jlpm install # Install npm package dependencies
jlpm run build # Compile the TypeScript sources to Javascript
jupyter labextension install # Install the current directory as an extension
jlpm # Install npm package dependencies
jlpm build # Compile the TypeScript sources to Javascript
jupyter labextension develop . --overwrite # Install the current directory as an extension
```

To rebuild the extension:

```bash
jlpm run build
jlpm build
```

If you run JupyterLab in watch mode (`jupyter lab --watch`) it will automatically pick
up changes to the built extension and rebundle itself.
You should then be able to refresh the JupyterLab page
and it will pick up the changes to the extension.

To run an editable install of the server extension, run

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dask-labextension",
"version": "4.0.1",
"version": "5.0.0rc1",
"private": false,
"description": "A JupyterLab extension for Dask.",
"keywords": [
Expand Down
24 changes: 17 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@
"""
import json
import os
import setuptools
import sys

from jupyter_packaging import (
create_cmdclass, install_npm, ensure_targets,
combine_commands,
)
import setuptools

# ensure the current directory is on sys.path
# so versioneer can be imported when pip uses
# PEP 517/518 build rules.
# https://github.com/python-versioneer/python-versioneer/issues/193
sys.path.append(os.path.dirname(__file__))

import versioneer

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

# The name of the project
name="dask_labextension"

# Get our version
with open(os.path.join(HERE, 'package.json')) as f:
version = json.load(f)['version']
version = versioneer.get_version()

lab_path = os.path.join(HERE, name, "labextension")

Expand Down Expand Up @@ -50,9 +58,11 @@
),
]

cmdclass = create_cmdclass("jsdeps",
package_data_spec=package_data_spec,
data_files_spec=data_files_spec
cmdclass = versioneer.get_cmdclass(
create_cmdclass("jsdeps",
package_data_spec=package_data_spec,
data_files_spec=data_files_spec
)
)

cmdclass["jsdeps"] = combine_commands(
Expand All @@ -66,7 +76,7 @@
setup_args = dict(
name=name,
version=version,
url="y",
url="https://github.com/dask/dask-labextension",
author="Ian Rose, Matt Rocklin, Jacob Tomlinson",
description="A JupyterLab extension for Dask.",
long_description= long_description,
Expand Down

0 comments on commit 21ce71e

Please sign in to comment.