Skip to content

Poetry wants to reinstall every system package to the venv when using virtualenvs.options.system-site-packages #6035

@awoimbee

Description

@awoimbee
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • Poetry version: 1.2.0b3

Issue

When I set virtualenvs.options.system-site-packages to true, my program running inside the poetry venv has access to the system deps (good). But when I run poetry install, poetry wants to re-download and re-install everything (bad).

Either I use virtualenvs.options.system-site-packages true and poetry should use the system deps (unless not possible, eg not if version mismatch). Or I use virtualenvs.options.system-site-packages false and system deps are never used.

Currently If I want to use a dependency from the system site-packages I have to remove it from pyproject.toml and poetry.lock before poetry install.

To reproduce

docker run -it --rm python:3.10 bash

pip install poetry==1.2.0b3
poetry config virtualenvs.options.system-site-packages true
cat <<EOT > pyproject.toml
[tool.poetry]
name = "gros-zozo"
version = "0.0.0"
description = "saussice"
authors = ["superman"]

[tool.poetry.dependencies]
python = "^3.8"
six = "*"

[build-system]
requires = ["poetry>=1.1"]
build-backend = "poetry.masonry.api"
EOT
poetry install --dry-run

output is:

Creating virtualenv gros-zozo-il7asoJj-py3.10 in /root/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies... (0.3s)

Package operations: 0 installs, 1 update, 0 removals

  • Updating six (1.16.0 /usr/local/lib/python3.10/site-packages -> 1.16.0)

Here I use --dry-run for the example, but without --dry-run poetry downloads the packages then installs then to the venv (but I already have these packages ! I don't want to re-download everything !).

see #1393 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions