question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build and install the root package as a wheel in one invocation

See original GitHub issue

@sdispater, in https://github.com/sdispater/poetry/issues/730 you said:

The install command installs the current project in editable mode by internally creating a temporary setup.py file and executing pip install -e .. It does it each time install is executed to ensure that any new elements like entrypoints are properly installed.

Could you allow non-editable installations by adding a --no-editable command-line parameter for these three commands:

  • poetry install --no-editable
  • poetry add --no-editable
  • poetry update --no-editable

The documentation states that it is already possible for local dependencies, but with a develop file parameter in the pyproject.toml file:

If you don’t want the dependency to be installed in editable mode you can specify it in the pyproject.toml file:

[tool.poetry.dependencies] my-package = {path = “…/my/path”, develop = false}

Here I think that a command-line parameter would be more appropriate than a file parameter, as it is something that you want to configure at the command-line level rather than at the project level (like with pip where sometimes you want to run pip install . and sometimes pip install -e .). So if you could also drop the develop file parameter that would be awesome.

Being able to install projects in non-editable mode is so important, especially for deployment on servers. Currently we cannot use the poetry install command exclusively for such installations, we still have to resort to the pip install command.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:103
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

29reactions
cjolowiczcommented, Dec 12, 2019

This is an important feature for multi-stage Docker builds.

Multi-stage Docker builds for Python typically install the project into a virtualenv during the build stage, and then copy the virtualenv over into a slim final image. An editable install creates a .egg-link file that links to the source code, and this link would only be valid for the duration of the build stage.

Currently my build stage installs projects by exporting from Poetry to pip:

COPY pyproject.toml poetry.lock ./
RUN /root/.poetry/bin/poetry export -f requirements.txt | /venv/bin/pip install -r /dev/stdin 
COPY . ./
RUN /root/.poetry/bin/poetry build && /venv/bin/pip install dist/*.whl

The requested feature would allow us to use Poetry directly:

COPY pyproject.toml poetry.lock ./
RUN /root/.poetry/bin/poetry install --no-root
COPY . ./
RUN /root/.poetry/bin/poetry install --no-editable
17reactions
maggyerocommented, May 11, 2021

@ShuzZzle: It is still in the To-do list: https://github.com/python-poetry/poetry/projects/3#card-31617262 @sdispater and @abn: According to the number of thumbs up, this feature request is highly anticipated, so is there any way to make it a priority? It has been two years now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

55. Package your Python code as Wheel File - YouTube
In this video, I discussed about Packaging python code as wheel file.Sample code used in setup.py file.import setuptoolssetuptools. setup ( ...
Read more >
What Are Python Wheels and Why Should You Care?
In this tutorial, you'll learn what Python wheels are and why you should care as both a developer and end user of Python...
Read more >
How to install, download and build Python wheels - ActiveState
Python Install Wheel. Open source Python packages can be installed from Source Distributions (sdist) or Wheels (whl). According to the Python ...
Read more >
Installing a .whl Python package into a specific directory other ...
When running pip install from source, it invokes a build process, which runs the setup.py script and passes to it the --install-option you...
Read more >
Options to build the same package in different ways (with ...
For some packages, we really need to have different builds (producing different wheels), with different build dependencies.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found