No description
Find a file
Paul Moore e501700835
Merge pull request #46 from pfmoore/dependabot/github_actions/dot-github/workflows/pypa/gh-action-pypi-publish-1.14.3
Bump pypa/gh-action-pypi-publish from 1.14.1 to 1.14.3 in /.github/workflows
2026-11-05 10:28:02 +00:00
.github/workflows Bump pypa/gh-action-pypi-publish in /.github/workflows 2026-11-05 05:52:44 +00:00
docs Bump version to 0.6 2026-04-14 11:38:11 +01:00
src/editables Bump version to 0.6 2026-04-14 11:38:11 +01:00
tests Lint fixes 2026-04-14 11:18:39 +01:00
.gitignore Initial commit 2020-05-07 11:37:59 +01:00
.pre-commit-config.yaml Update pre-commit hooks 2026-04-04 14:46:07 +01:00
.readthedocs.yaml Update readthedocs configuration 2026-04-14 12:04:15 +01:00
bump_release.py Update release script for pyproject.toml 2023-06-29 16:12:43 +01:00
CHANGELOG.md Fix typo in changelog 2026-04-14 13:10:40 +01:00
LICENSE.txt Fix lint issues reported by new checks 2020-05-23 13:26:09 +01:00
noxfile.py Switch to nox 2023-06-28 13:00:00 +01:00
pyproject.toml Add support for Python 3.15 2026-07-24 00:08:23 +03:00
README.md Merge branch 'main' into docs 2022-04-09 15:58:46 +01:00

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