Poetry: support for venv --system-site-packages

Created on 19 Sep 2019  路  4Comments  路  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Feature Request

Adding support for --system-site-packages, as described in venv documentation, makes possible to have a set of base common packages available for a number of virtual environments, thus saving disk space and reducing environment creation time. I believe that this option gives some useful extra flexibility on package and environment management.

Feature

Most helpful comment

I agree this functionality would be useful in Poetry, but for the meantime here are some workarounds (cross-posting across related issues):

Use case 1) I just want to save space use by my virtualenvs:

  1. Install https://rdfind.pauldreik.se/
  2. cd ~/.cache/pypoetry/virtualenvs/ && rdfind -makehardlinks true .

Use case 2) I need to use a globally installed package from my poetry venv.

  1. Open ~/.cache/pypoetry/virtualenvs/myvenv/pyvenv.cfg
  2. Set include-system-site-packages = true

All 4 comments

As I see, virtual environments creates via venv.EnvBuilder and virtualenv.create_environment:
https://github.com/sdispater/poetry/blob/df98fd289b9b629d2171900c1b1bddcee3696cff/poetry/utils/env.py#L301-L319
...so it shouldn'be hard.

I see this as a setting in poetry config with something like settings.virtualenvs.include-system-packages. Will (try to) implement tomorrow.

This would be very useful as its a significant space saving - e.g. on a single small repository the difference was 150MB of dependencies - multiply that out and its soon worthwhile.

someone please revive #1404 :'(
Or I'm willing to help if there're more to do to complete the feature.
I need that feature since I have needs some packages to be globally available in order to run setup.py of my private package installed from git.

I agree this functionality would be useful in Poetry, but for the meantime here are some workarounds (cross-posting across related issues):

Use case 1) I just want to save space use by my virtualenvs:

  1. Install https://rdfind.pauldreik.se/
  2. cd ~/.cache/pypoetry/virtualenvs/ && rdfind -makehardlinks true .

Use case 2) I need to use a globally installed package from my poetry venv.

  1. Open ~/.cache/pypoetry/virtualenvs/myvenv/pyvenv.cfg
  2. Set include-system-site-packages = true
Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbarlow83 picture jbarlow83  路  3Comments

jackemuk picture jackemuk  路  3Comments

jhrmnn picture jhrmnn  路  3Comments

probablykasper picture probablykasper  路  3Comments

etijskens picture etijskens  路  3Comments