Skip to main content

Editable installations

Project description

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).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

editables-0.5.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

editables-0.5-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file editables-0.5.tar.gz.

File metadata

  • Download URL: editables-0.5.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for editables-0.5.tar.gz
Algorithm Hash digest
SHA256 309627d9b5c4adc0e668d8c6fa7bac1ba7c8c5d415c2d27f60f081f8e80d1de2
MD5 520de8c3a9dc5dfb2b365d104541c9de
BLAKE2b-256 374a986d35164e2033ddfb44515168a281a7986e260d344cf369c3f52d4c3275

See more details on using hashes here.

File details

Details for the file editables-0.5-py3-none-any.whl.

File metadata

  • Download URL: editables-0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for editables-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 61e5ffa82629e0d8bfe09bc44a07db3c1ab8ed1ce78a6980732870f19b5e7d4c
MD5 5de129d3a039b26b7f6798a4002acdf6
BLAKE2b-256 6bbe0f2f4a5e8adc114a02b63d92bf8edbfa24db6fc602fca83c885af2479e0e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page