Skip to main content

A Python library for creating "editable wheels"

This library supports the building of wheels which, when installed, will expose packages in a local directory on sys.path in "editable mode". In other words, changes to the package source will be reflected in the package visible to Python, without needing a reinstall.

Usage

Suppose you want to build a wheel for your project foo. Your project is located in the directory /path/to/foo. Under that directory, you have a src directory containing your project, which is a package called foo and a Python module called bar.py. So your directory structure looks like this:

/path/to/foo
|
+-- src
|   +-- foo
|   |   +-- __init__.py
|   +-- bar.py
|
+-- setup.py
+-- other files

Build your wheel as follows:

from editables import EditableProject

my_project = EditableProject("foo", "/path/to/foo")
my_project.add_to_path("src")

# Build a wheel however you prefer...
wheel = BuildAWheel()

# Add files to the wheel
for name, content in my_project.files():
    wheel.add_file(name, content)

# Record any runtime dependencies
for dep in my_project.dependencies():
    wheel.metadata.dependencies.add(dep)

The resulting wheel will, when installed, put the project src directory on sys.path so that editing the original source will take effect without needing a reinstall (i.e., as "editable" packages). The project is exposed on sys.path by adding a single .pth file, named after the project, into the wheel.

For more details, including how to control what gets exposed more precisely, see the documentation.

Note that this project doesn't build wheels directly. That's the responsibility of the calling code.

Python Compatibility

This project supports the same versions of Python as pip does. Currently that is Python 3.7 and later, and PyPy3 (although we don't test against PyPy).

Metadata

Release files for editables 0.4

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

Source distribution (sdist)

Source distribution for editables 0.4
File Size Uploaded
editables-0.4.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for editables 0.4
File Interpreter ABI Platform
editables-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / editables-0.4.tar.gz

Download URL editables-0.4.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
dc322c42e7ccaf19600874035a4573898d88aadd07e177c239298135b75da772
BLAKE2b-256 checksum
How to use checksums
438aa060ff3e75328015150f680b4b4bc4617644aaef199ece380342a334d78f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / editables-0.4-py3-none-any.whl

Download URL editables-0.4-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dd430dcf41c78d1d68ebbb893e498b0a306b554be9e7cede73b1c876c6ddbc8d
BLAKE2b-256 checksum
How to use checksums
c27079facbb595905df30e48f658182636edee901ebd8a324378700daf84c622
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

0.6

2 release files

0.5

2 release files

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

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