template-python icon indicating copy to clipboard operation
template-python copied to clipboard

Editable builds possible?

Open russkel opened this issue 4 years ago • 2 comments

Hi,

Is it possible to use pip3 install -e . with these projects? When I try I get an error:

Defaulting to user installation because normal site-packages is not writeable
ERROR: File "setup.py" or "setup.cfg" not found. Directory cannot be installed in editable mode: /home/russ/repos/xxxxxx
(A "pyproject.toml" file was found, but editable mode currently requires a setuptools-based build.)

What's the best way to go about getting this to work?

Edit: should have researched a bit more: https://github.com/python-poetry/poetry/discussions/1135#discussioncomment-145763

and more importantly: https://www.python.org/dev/peps/pep-0660/

Cheers.

russkel avatar Aug 02 '21 01:08 russkel

Are you looking for one of your dependencies to be editable or for your own package to be editable when installed by other projects? Are you installing from PyPI, Git, or as a local path dependency?

When I want to work on two projects in tandem, I typically use this syntax in pyproject.toml:

[tool.poetry.dependencies]

foobar = { path = "../foobar", develop = true }

where foobar is a sibling directory to whichever project I am working on.

jacebrowning avatar Aug 02 '21 14:08 jacebrowning

That's a handy hint but not sure it works in my particular case.

This is for when my project (based off template-python) is a dependency for another project of mine, a setuptools based project. All local paths.

russkel avatar Aug 02 '21 23:08 russkel