Skip to main content

Overview

PyPI Version License Supported Pythons CI

This repo contains a set of Jupyter Notebook plugins that enable interop with pex and pants.

Installation

To install this plugin, simply invoke pip install like so:

pip install pants-jupyter-plugin

Plugin Loading

To load the plugin in your Jupyter Notebook environment, use the %load_ext command in a Notebook cell like so:

%load_ext pants_jupyter_plugin

Magics

This package provides 3 primary magics for python environment loading from pex and/or pants targets. All of these will scrub and replace the existing sys.path/environment so it's best to do this before you import any modules to avoid cached imports.

%pex_load

This magic allows you to load an existing pex file that exists on disk into the python environment.

Usage:

%pex_load <path to pex file>

%requirements_load

This magic allows you to load a transitive closure of arbitrary requirements into the environment using pex(1).

Usage:

%requirements_load <requirements>

%pants_load

This magic allows you to build and load a pants python_binary target into the environment. It works in conjunction with the %pants_repo magic, which is how you point the plugin to a given pants-compatible repo.

%pants_repo <path to pants repo>
...
%pants_load <pants target>

Development

This repo uses tox for testing and project automation. To test your changes before sending them off for review just invoke tox:

$ tox

This will auto-format code and run tests. Tests accept passthough args and pytest-xdist is installed, so you could run the full test suite with maximum parallelism via:

$ tox -p -epy3{6,7,8,9} -- -n auto

Here you run tests against all interpreters the project supports (assuming you have these all installed on your machine and on the $PATH) in parallel (the tox -p flag) and for each parallel run of tox you run the individual test methods in parallel (via passthrough args to pytest-xdist: -- -n auto).

To find out all available tox environments use tox -a or inspect tox.ini.

Release files for pants-jupyter-plugin 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pants-jupyter-plugin 0.0.6
File Size Uploaded
pants-jupyter-plugin-0.0.6.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pants-jupyter-plugin 0.0.6
File Interpreter ABI Platform
pants_jupyter_plugin-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 39.1 kB

Release files / pants-jupyter-plugin-0.0.6.tar.gz

Download URL pants-jupyter-plugin-0.0.6.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
69434cbc96f5f04409640fec3d7021e45e62b3746cfb5c77b625b551e5914550
BLAKE2b-256 checksum
How to use checksums
66124763943e1a2b0f8b1693835ad6a32b8b7d22b57bbb285014a26c064e3b93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / pants_jupyter_plugin-0.0.6-py3-none-any.whl

Download URL pants_jupyter_plugin-0.0.6-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ada912b8b5c6bb854c14d471a010dc38d76672fd093025d791a93adad4ab8144
BLAKE2b-256 checksum
How to use checksums
463ccecad096b6ccbf54f5fe29b27e92e721dcc630d6cf980ba5f94183b4307a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page