All Projects → jupyter → jupyter-packaging

jupyter / jupyter-packaging

Licence: BSD-3-Clause License
Tools to help build and install Jupyter Python packages

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to jupyter-packaging

Setup.py
📦 A Human's Ultimate Guide to setup.py.
Stars: ✭ 4,963 (+10928.89%)
Mutual labels:  packaging, setuptools, distutils
Pip Tools
A set of tools to keep your pinned Python dependencies fresh.
Stars: ✭ 5,387 (+11871.11%)
Mutual labels:  packaging, setuptools
poetry-setup
Generate setup.py (setuptools) from pyproject.toml (poetry)
Stars: ✭ 44 (-2.22%)
Mutual labels:  packaging, setuptools
integration-test
ensure core packaging tools work well with each other
Stars: ✭ 15 (-66.67%)
Mutual labels:  packaging, setuptools
jupyter-remote-desktop-proxy
Run a Linux Desktop on a JupyterHub
Stars: ✭ 46 (+2.22%)
Mutual labels:  jupyter
pyempaq
A simple but powerful Python packer to run any project with any virtualenv dependencies anywhwere.
Stars: ✭ 21 (-53.33%)
Mutual labels:  packaging
build
A GitHub Action to deploy Notebooks, Markdowns, ... to GitHub Pages
Stars: ✭ 31 (-31.11%)
Mutual labels:  jupyter
jupyter-bbox-widget
A Jupyter widget for annotating images with bounding boxes
Stars: ✭ 19 (-57.78%)
Mutual labels:  jupyter
nbtop
IPython Notebook server monitor inspired by htop
Stars: ✭ 50 (+11.11%)
Mutual labels:  jupyter
zaoqi-book
pandas.liuzaoqi.com/intro.html
Stars: ✭ 21 (-53.33%)
Mutual labels:  jupyter
lxd-pkg-ubuntu
LXD Ubuntu packaging
Stars: ✭ 27 (-40%)
Mutual labels:  packaging
deber
📦🐋 Debian packaging with Docker
Stars: ✭ 20 (-55.56%)
Mutual labels:  packaging
epic-kitchens-55-starter-kit-action-recognition
🌱 Starter kit for working with the EPIC-KITCHENS-55 dataset for action recognition or anticipation
Stars: ✭ 40 (-11.11%)
Mutual labels:  jupyter
theme-darcula
A handsome Darcula theme for Jupyterlab. The first jlab theme to include dark scrollbars
Stars: ✭ 136 (+202.22%)
Mutual labels:  jupyter
uber data
Uber web interface crawler / scraper - Convert the trips table into a CSV file
Stars: ✭ 40 (-11.11%)
Mutual labels:  jupyter
capsulecd
Continuous Delivery for automating package releases (npm, cookbooks, gems, pip, jars, etc)
Stars: ✭ 96 (+113.33%)
Mutual labels:  packaging
mmtf-workshop-2018
Structural Bioinformatics Training Workshop & Hackathon 2018
Stars: ✭ 50 (+11.11%)
Mutual labels:  jupyter
pyconau2017-messy-sensor-data
[pyconau 2017 talk] Messy Sensor Data: A Programmer's Cleaning Guide
Stars: ✭ 16 (-64.44%)
Mutual labels:  jupyter
resonance
Learning Mechanical Vibration Engineering Through Computation
Stars: ✭ 28 (-37.78%)
Mutual labels:  jupyter
elementary-nightly-rpms
nightly Pantheon DE + elementary applications packages for fedora (unofficial)
Stars: ✭ 34 (-24.44%)
Mutual labels:  packaging

Jupyter Packaging

Tools to help build and install Jupyter Python packages that require a pre-build step that may include JavaScript build steps.

Install

pip install jupyter-packaging

Usage

There are three ways to use jupyter-packaging in another package. In general, you should not depend on jupyter_packaging as a runtime dependency, only as a build dependency.

As a Build Requirement

Use a pyproject.toml file as outlined in pep-518. An example:

[build-system]
requires = ["jupyter_packaging>=0.10,<2"]
build-backend = "setuptools.build_meta"

Below is an example setup.py using the above config. It assumes the rest of your metadata is in setup.cfg. We wrap the import in a try/catch to allow the file to be run without jupyter_packaging so that python setup.py can be run directly when not building.

from setuptools import setup

try:
    from jupyter_packaging import wrap_installers, npm_builder
    builder = npm_builder()
    cmdclass = wrap_installers(pre_develop=builder, pre_dist=builder)
except ImportError:
    cmdclass = {}

setup(cmdclass=cmdclass))

As a Build Backend

Use the jupyter_packaging build backend. The pre-build command is specified as metadata in pyproject.toml:

[build-system]
requires = ["jupyter_packaging>=0.10,<2"]
build-backend = "jupyter_packaging.build_api"

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

[tool.jupyter-packaging.build-args]
build_cmd = "build:src"

The corresponding setup.py would be greatly simplified:

from setuptools import setup
setup()

The tool.jupyter-packaging.builder section expects a func value that points to an importable module and a function with dot separators. If not given, no pre-build function will run.

The optional tool.jupyter-packaging.build-args sections accepts a dict of keyword arguments to give to the pre-build command.

The build backend does not handle the develop command (pip install -e .). If desired, you can wrap just that command:

import setuptools

try:
    from jupyter_packaging import wrap_installers, npm_builder
    builder = npm_builder(build_cmd="build:dev")
    cmdclass = wrap_installers(pre_develop=builder)
except ImportError:
    cmdclass = {}

setup(cmdclass=cmdclass))

The optional tool.jupyter-packaging.options section accepts the following options:

  • skip-if-exists: A list of local files whose presence causes the prebuild to skip
  • ensured-targets: A list of local file paths that should exist when the dist commands are run

As a Vendored File

Vendor setupbase.py locally alongside setup.py and import the module directly.

import setuptools
from setupbase import wrap_installers, npm_builder
func = npm_builder()
cmdclass = wrap_installers(post_develop=func, pre_dist=func)
setup(cmdclass=cmdclass)

Usage Notes

  • This package does not work with the deprecated python setup.py bdist_wheel or python setup.py sdist commands, PyPA recommends using the build package (pip install build && python -m build .).
  • We recommend using include_package_data=True and MANIFEST.in to control the assets included in the package.
  • Tools like check-manifest or manifix can be used to ensure the desired assets are included.
  • Simple uses of data_files can be handled in setup.cfg or in setup.py. If recursive directories are needed use get_data_files() from this package.
  • Unfortunately data_files are not supported in develop mode (a limitation of setuptools). You can work around it by doing a full install (pip install .) before the develop install (pip install -e .), or by adding a script to push the data files to sys.base_prefix.

Development Install

git clone https://github.com/jupyter/jupyter-packaging.git
cd jupyter-packaging
pip install -e .

You can test changes locally by creating a pyproject.toml with the following, replacing the local path to the git checkout:

[build-system]
requires = ["jupyter_packaging@file://<path-to-git-checkout>"]
build-backend = "setuptools.build_meta"

Note: you need to run pip cache remove jupyter_packaging any time changes are made to prevent pip from using a cached version of the source.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].