Replies: 2 comments
-
Hardlinks or Softlinks/SymlinksI'm not a developer of poetry, but since I'm trying to find out whether poetry is able to create virtual environments using hardlinks or softlinks/symlinks, I stumbled upon this question. As a side note I believe this is an overlooked issue. I'm, perhaps naively, imagining that poetry could host a global "repository" (different from the cache, that may be emptied at any time) that would contain all packages used throughout the system. When installing new packages poetry would instead of copying, just hardlink or soflink/symlink files from this repository. Besides the apparent gain of less disk usage (we're talking many GB in many situations), I imagine that IDE:s that are indexing code would be more efficient if they were pointed to a single source, instead of needing to index multiple copies of the same file over and over. always-copy not utilized?Anyhow, why I replied in this thread is that I tried to understand how this options was utilized, and to my surprise I found nowhere in the code where the setting The setting is being picked up, and it's appearing in some unit tests, but it's never passed to any function. I searched these code bases:
Using the regex: |
Beta Was this translation helpful? Give feedback.
-
the option is simply passed through to virtualenv, see poetry/src/poetry/utils/env/env_manager.py Line 588 in 0811469 |
Beta Was this translation helpful? Give feedback.
-
Hello.
I have a python application which uses poetry & docker. The venv created by poetry is mounted inside my docker container.
If I create the venv from w/in docker (ie: run
poetry install
as part of the Dockerfile) [situation 1] then the ".venv/pyvenv.cfg" file includes content like this:And if I create the venv in the local filesystem (ie: run
poetry install
before launching Docker) [situation 2] then the ".venv/pyvenv.cfg" file includes content like this:And sure enough
python
in the venv is symlinked to those files.Clearly, if I try and run an executable (like, say,
yapf
) from outside docker in situation 1 it will fail.I naively assumed that setting
virtualenvs.options.always-copy=true
would actually copy the python executable into the venv instead of symlinking it. But that had no effect.Am I misunderstanding that setting?
Beta Was this translation helpful? Give feedback.
All reactions