Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- name: Install Dependencies
run: |
python -m pip install -U pip jupyterlab~=3.0 jupyter_packaging~=0.7.9
python -m pip install -U pip jupyterlab~=3.0 jupyter_packaging~=0.10

- name: Install the Voilà Preview JupyterLab extension
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
python -m pip install setuptools jupyter_packaging~=0.10 "jupyterlab>=3,<4" build
- name: Build pypi distributions
run: |
python setup.py sdist bdist_wheel
python -m build
- name: Build npm distributions
run: |
pushd packages/jupyterlab-preview
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE
include README.md
include *.md
include pyproject.toml

include package.json
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Creating a new environment can help avoid pushing local changes and any extra tag.

```bash
mamba create -q -y -n voila-release -c conda-forge twine nodejs keyring pip matplotlib tornado jupyter-packaging jupyterlab
mamba create -q -y -n voila-release -c conda-forge twine nodejs keyring pip matplotlib tornado jupyter-packaging jupyterlab build
conda activate voila-release
```

Expand All @@ -22,7 +22,7 @@ Make sure the `dist/` folder is empty.
1. If the JupyterLab extension has changed, make sure to bump the version number in `./packages/jupyterlab-preview/package.json`
2. If the Voilà front-end JavaScript has changed, make sure to bump the version number in `./packages/voila/package.json`
3. Update [voila/\_version.py](./voila/_version.py) and [environment.yml](./environment.yml) with the new version number (see and [example diff](https://github.com/voila-dashboards/voila/commit/5c6fd8dd3ea71412ae9c20c25248453d22a3b60a))
4. `python setup.py sdist bdist_wheel`
4. `python -m build`
5. Double check the size of the bundles in the `dist/` folder
6. Make sure the JupyterLab extension is correctly bundled in source distribution
7. Run the tests
Expand Down
18 changes: 16 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
[build-system]
requires = ["jupyter_packaging~=0.7.9", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel", "jupyter_core"]
build-backend = "setuptools.build_meta"
requires = ["jupyter_packaging~=0.10", "jupyterlab~=3.0", "jupyter_core"]
build-backend = "jupyter_packaging.build_api"

[license]
file="LICENSE"

[tool.jupyter-packaging.options]
skip-if-exists = ["voila/labextension/static/style.js"]
ensured-targets = ["voila/labextension/static/style.js"]

[tool.jupyter-packaging.builder]
factory = "jupyter_packaging.npm_builder"

[tool.jupyter-packaging.build-args]
build_cmd = "build:prod"
npm = ["jlpm"]
51 changes: 47 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,51 @@
[options]
python_requires = >=3.5
[flake8]
max-line-length=200

[metadata]
name = voila
version = attr: voila._version.__version__
description = Voilà turns Jupyter notebooks into standalone web applications
long_description = file: README.md
long_description_content_type = text/markdown
license_file = LICENSE
author = Voila Development Team
url = https://github.com/voila-dashboards/voila
platforms = Linux, Mac OS X, Windows
keywords = Jupyter, JupyterLab, Voila
classifiers =
License :: OSI Approved :: BSD License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Framework :: Jupyter
Framework :: Jupyter :: JupyterLab
Framework :: Jupyter :: JupyterLab :: 3
Framework :: Jupyter :: JupyterLab :: Extensions
Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt

[flake8]
max-line-length=200
[options]
zip_safe = False
include_package_data = True
packages = find:
python_requires = >=3.6
install_requires =
jupyter_server>=0.3.0,<2.0.0
jupyter_client>=6.1.3,<7
nbclient>=0.4.0,<0.6
nbconvert>=6.0.0,<7

[options.extras_require]
test =
ipywidgets
mock
matplotlib
pandas
pytest
pytest-tornasync

[options.entry_points]
console_scripts =
voila = voila.app:main
116 changes: 25 additions & 91 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
import os
#############################################################################
# Copyright (c) 2018, Voilà Contributors #
# Copyright (c) 2018, QuantStack #
# #
# Distributed under the terms of the BSD 3-Clause License. #
# #
# The full license is in the file LICENSE, distributed with this software. #
#############################################################################
from pathlib import Path

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

HERE = os.path.abspath(os.path.dirname(__file__))
HERE = Path(__file__).parent.resolve()

# The name of the project
name = "voila"

# Get our version
version = get_version(os.path.join(name, "_version.py"))
NAME = "voila"

labext_name = "@voila-dashboards/jupyterlab-preview"
lab_extension_dest = os.path.join(HERE, name, "labextension")
lab_extension_dest = HERE / NAME / "labextension"

# Representative files that should exist after a successful build
jstargets = [
os.path.join(
HERE, "share", "jupyter", "voila", "templates", "base", "static", "voila.js"
),
os.path.join(lab_extension_dest, "package.json"),
ensured_targets = [
str(HERE / "share/jupyter/voila/templates/base/static/voila.js"),
str(lab_extension_dest / "package.json"),
]

package_data_spec = {name: ["*"]}


data_files_spec = [
(
Expand All @@ -49,80 +42,21 @@
"voila.json",
),
("share/jupyter/nbextensions/voila", "voila/static", "extension.js"),
("share/jupyter/labextensions/%s" % labext_name, lab_extension_dest, "**"),
("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),
("share/jupyter/labextensions/%s" % labext_name, str(lab_extension_dest), "**"),
("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
("share/jupyter/voila/templates", "share/jupyter/voila/templates", "**/*[!.map]"),
]

try:
from jupyter_packaging import wrap_installers, npm_builder, get_data_files

cmdclass = create_cmdclass(
"jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec
)

js_command = combine_commands(
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
ensure_targets(jstargets),
)

is_repo = os.path.exists(os.path.join(HERE, ".git"))
if is_repo:
cmdclass["jsdeps"] = js_command
else:
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)


with open("README.md", "r") as fh:
long_description = fh.read()
# In develop mode, just run yarn
builder = npm_builder(build_cmd="build", npm="jlpm", force=True)
cmdclass = wrap_installers(post_develop=builder, ensured_targets=ensured_targets)

setup_args = dict(
name=name,
version=version,
url="https://github.com/voila-dashboards/voila",
author="Voila Development Team",
author_email="[email protected]",
description="Voilà turns Jupyter notebooks into standalone web applications",
long_description=long_description,
long_description_content_type="text/markdown",
cmdclass=cmdclass,
packages=setuptools.find_packages(),
entry_points={"console_scripts": ["voila = voila.app:main"]},
install_requires=[
"jupyter_server>=0.3.0,<2.0.0",
"jupyter_client>=6.1.3,<7",
"nbclient>=0.4.0,<0.6",
"nbconvert>=6.0.0,<7",
],
extras_require={
"test": [
"ipywidgets",
"mock",
"matplotlib",
"pandas",
"pytest",
"pytest-tornasync",
]
},
zip_safe=False,
include_package_data=True,
python_requires=">=3.6",
license="BSD-3-Clause",
platforms="Linux, Mac OS X, Windows",
keywords=["Jupyter", "JupyterLab", "Voila"],
classifiers=[
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 3",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
],
)
setup_args = dict(cmdclass=cmdclass, data_files=get_data_files(data_files_spec))
except ImportError:
setup_args = dict()


if __name__ == "__main__":
Expand Down