https://pantsbuild.org/ logo
#general
Title
# general
l

lively-exabyte-12840

02/22/2022, 5:51 PM
Another export question - I noticed that the ./bin directory in the venv created by
pants export ::
does not have a "pip" file in it. Is that by design? My use case for it is using e.g.
pip list | more
as a quick test of what's in the venv for when I want to run something outside of running it via pants
e

enough-analyst-54434

02/22/2022, 5:54 PM
Its not really by design. For all internal venvs Pants omits pip on purpose. We don;t want internal venvs ever mutated. For export, we should provide pip.
Yeah, this is done here: https://github.com/pantsbuild/pants/blob/793a39e7d6898f9920d264eafaaf4c7b9f37bc44/src/python/pants/backend/python/goals/export.py#L79-L113 So we use the immutable intenral venv infra and then create a symlink to one of these. That has a speed advantage, but robs you of a mutable venv.
I don't think @happy-kitchen-89482 set it up this way intentionally (immutable) and was probably only gunning for speed / re-use. @lively-exabyte-12840 this is certainly a feature that could be implemented. The only real question I can see is if it should be the default or behind an option or both.
l

lively-exabyte-12840

02/22/2022, 6:03 PM
Thanks, I'll write up a ticket if it seems like a need for my team
👍 2
e

enough-analyst-54434

02/22/2022, 6:06 PM
Excellent. Thank you.
c

curved-television-6568

02/22/2022, 6:29 PM
For the purposes of quickly creating a venv for tinkering in, this has come up when talking to my team as well.. not sure how frequently it would be used, but it helps ease new users into the Pants world, to be able to offer functionality that is familiar (a venv with pip in it).
👍 2
l

lively-exabyte-12840

02/22/2022, 6:54 PM
I definitely see this as easing new users into the Pants world, where it might be used a lot early on and then rarely used later on once the team is confident with Pants
👍 1
h

hundreds-father-404

02/22/2022, 6:57 PM
That makes sense to me! Given that you both think this would be helpful to newcomers, @lively-exabyte-12840 would you be willing to please open a feature request? https://github.com/pantsbuild/pants/issues/new/choose That helps us a lot with project planning
👍 1
h

happy-kitchen-89482

02/22/2022, 8:15 PM
Correct - that venv is not immutable on purpose, I just did the easiest thing that works when implementing export...
l

lively-exabyte-12840

02/25/2022, 9:32 PM
Just closing the loop on this - https://github.com/pantsbuild/pants/issues/14622
👍 1
h

happy-kitchen-89482

02/25/2022, 10:52 PM
Thanks!
Let me think about how to do this
5 Views