# Next steps for editable / develop proof of concept

**URL:** <https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118>\
**Category:** Packaging\
**Created:** [May 6, 2020, 9:38pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118 "2020-05-06T21:38:24Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![dholth](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dholth/32/952_2.png) [@dholth](https://discuss.python.org/u/dholth)\
**Post date:** [May 7, 2020, 12:21pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/21 "2020-05-07T12:21:47Z")

</div>

Yes of course. The backend will want to use a library.  
Say build(… a few facts about the package) and be ready to go.

I’ve updated the hook in pip and setuptools. It makes pip simpler which I think is great. Don’t worry about the `.pth` file, now moved into setuptools’ part of the hook.

The naming of the parameters is a little awkward. I have passed the same `metadata_directory` from `prepare_metadata_for_build_wheel`. It is like the root of a wheel. It contains the `*.dist-info` directory.

It is easier for setuptools to let the other hook take care of `*.dist-info` which is always accomplished by bdist\_wheel converting an `.egg-info` directory. (Any number of setuptools metadata plugins write to egg-info during its build). We already caled the metadata hook to find dependencies before installing our editable distribution.

I tested this against pip’s test project `python -m pip install -e tests/data/packages/pep517_setup_and_pyproject/`

> <https://github.com/pypa/pip/pull/8154/files>

> **[pypa/setuptools](https://github.com/pypa/setuptools/compare/master...dholth:redevelop?expand=1)**
>
> Official project repository for the Setuptools build system - pypa/setuptools

---

<div class="post-metadata">

**Author:** ![dholth](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dholth/32/952_2.png) [@dholth](https://discuss.python.org/u/dholth)\
**Post date:** [May 12, 2020, 5:48pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/22 "2020-05-12T17:48:47Z")

</div>

Thanks to @sbidoul we have an additional POC that requires a `.whl` instead of my directory-copied-into-$PLATLIB. It even says it’s “somewhat useable” 🤠

I’d like to have the option to do relative paths, which is as simple as passing a target directory or an install scheme into the hook.

I’m wary of including all wheel features. Does this need to support installing into all the `*.data/` categories, choose purelib vs. platlib, include platform tags, be able to be cached or sent over a network. But I could live with it.

It’s easy enough to throw in `RECORD` and zip up the directory if that’s the hook we land on. I think I’d wind up using a dedicated “zip up a wheel” implementation just for editable wheels in `enscons`. In `setuptools` there would be a chance that we’d re-use wheel’s `WheelFile` but no chance we’d re-use `bdist_wheel` to create the special wheel \*

\* except that `bdist_wheel` was involved in creating the `.dist-info` directory made available to the editable hook

Thanks @sbidoul!

> <https://github.com/pypa/pip/pull/8212>

---

<div class="post-metadata">

**Author:** ![RonnyPfannschmidt](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/ronnypfannschmidt/32/1714_2.png) [@RonnyPfannschmidt](https://discuss.python.org/u/RonnyPfannschmidt)\
**Post date:** [May 14, 2020, 9:46am UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/23 "2020-05-14T09:46:32Z")

</div>

i hope i find some time to try this with gumby elf (it does generate wheels that match exactly whats needed (all data is left in the checkout, only shim files are in record)

thanks @sbidoul

---

<div class="post-metadata">

**Author:** ![sbidoul](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sbidoul/32/244_2.png) [@sbidoul](https://discuss.python.org/u/sbidoul)\
**Post date:** [May 21, 2020, 3:14pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/24 "2020-05-21T15:14:55Z")

</div>

> [@dholth](#):
>
> I’d like to have the option to do relative paths, which is as simple as passing a target directory or an install scheme into the hook.

I updated my frontend (pip) POC with a `scheme` argument to [build\_wheel\_for\_editable](https://github.com/pypa/pip/pull/8212/files#diff-79740535a778ffbad546462e00215520), so interested people can experiment with that too.

---

<div class="post-metadata">

**Author:** ![sbidoul](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/sbidoul/32/244_2.png) [@sbidoul](https://discuss.python.org/u/sbidoul)\
**Post date:** [May 21, 2020, 3:23pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/25 "2020-05-21T15:23:34Z")

</div>

> [@Third try on editable installs](https://discuss.python.org/t/third-try-on-editable-installs/3986/29):
>
> I’m happy to try to make a PoC in flit - this would be about the simplest case, so it’s a good starting point to look at the question. But I’m still a bit hazy as to what exactly I should start implementing.

@takluyver you may want to try my `build_wheel_for_editable` POC with [this pip branch](https://github.com/pypa/pip/pull/8212).

---

<div class="post-metadata">

**Author:** ![dholth](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dholth/32/952_2.png) [@dholth](https://discuss.python.org/u/dholth)\
**Post date:** [May 21, 2020, 3:44pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/26 "2020-05-21T15:44:04Z")

</div>

The idea is that the build\_wheel\_for\_editable wheel should contain the regular metadata and proxy modules for each top-level name. When the proxies are imported they replace themselves with the actual module and _something_ that allows the rest of the module to be imported. [`https://github.com/pfmoore/editables/blob/master/src/editables/ __init__.py`](https://github.com/pfmoore/editables/blob/master/src/editables/ __init__.py) is Paul’s submission for building those proxies.

---

<div class="post-metadata">

**Author:** ![pf\_moore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pf_moore/32/35_2.png) [@pf\_moore](https://discuss.python.org/u/pf_moore)\
**Post date:** [May 21, 2020, 7:39pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/27 "2020-05-21T19:39:37Z")

</div>

> [@dholth](#):
>
> Paul’s submission for building those proxies

…which I fully intend to expand into a properly reusable library. But I’m super snowed under right now, so I haven’t had time.

---

<div class="post-metadata">

**Author:** ![bernatgabor](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bernatgabor/32/3003_2.png) [@bernatgabor](https://discuss.python.org/u/bernatgabor)\
**Post date:** [May 21, 2020, 8:06pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/28 "2020-05-21T20:06:47Z")

</div>

My offer to help with moving this still stands if we can agree on those best practices 😅

---

<div class="post-metadata">

**Author:** ![dholth](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dholth/32/952_2.png) [@dholth](https://discuss.python.org/u/dholth)\
**Post date:** [May 21, 2020, 8:18pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/29 "2020-05-21T20:18:08Z")

</div>

IMO we still need prototypes. Then we can choose the best one.

---

<div class="post-metadata">

**Author:** ![pf\_moore](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pf_moore/32/35_2.png) [@pf\_moore](https://discuss.python.org/u/pf_moore)\
**Post date:** [June 15, 2020, 2:00pm UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/30 "2020-06-15T14:00:14Z")

</div>

I’ve just published my editables library. [PyPI page](https://pypi.org/project/editables/) and [github](https://github.com/pfmoore/editables). It’s published under my own name for now. If it ends up being accepted as the reference implementation, we can move it under the PyPA banner.

I’d love to see this gets some proper field testing (and of course, contributions welcome if people find limitations or can think of improvements 🙂

---

<div class="post-metadata">

**Author:** ![pradyunsg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/pradyunsg/32/206_2.png) [@pradyunsg](https://discuss.python.org/u/pradyunsg)\
**Post date:** [June 18, 2020, 12:28am UTC](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118/31 "2020-06-18T00:28:04Z")

</div>

Thanks everyone who’s been working on this. ^\>^

[Previous page](https://discuss.python.org/t/next-steps-for-editable-develop-proof-of-concept/4118.md?page=1)
