Hi all, I'm currently using the environment create...
# general
Hi all, I'm currently using the environment created by
./pants export ::
but noticed that it is a symlink to the pants cache. In my CI pipeline I need a venv that also includes my own package, so I install it into the exported venv using
pip install -e .
. However this causes other builds to break, since I'm touching the same venv from multiple builds. Is there any easy way to do one of the following: • Get an independent copy of this venv (not a symlink to the cache) • Get a venv that includes my package along with the 3rd party dependencies Thanks!
Hi Dimitrios, Not my area of expertise, but perhaps if you can package your code up as a pex binary, you can then “install” that into a venv on disk as needed, which would include your first-party code along with all your 3rdparty requirements.
Perhaps draw inspiration of how this can be done by looking at this hint: https://pex.readthedocs.io/en/latest/recipes.html#pex-app-in-a-container ignore the bit about it being for container use.
so, without the
option on the pex invocation, I think you’d end up with both (a complete venv) in one go.
Hi Andreas, thanks for the answer. I can't seem to make out how to configure a pex binary from the link you sent about
. Could you elaborate just a bit more how you mean that? I'll read about pex binaries a bit more, I haven't used them till now, and I'm a bit overwhelmed coming from the simpler venv world...
Yeah, sorry about that, it was the wrong link, I’ve replaced it with the correct one.
That makes more sense 🙂 I think that's the right direction, thanks again!
Great. And within a few hours, there’ll be some experts around to help give better answers too 🙂
👍 1
Which version of Pants are you on? From (I think) 2.11, export will create isolated venvs that aren't symlinks
👍 1
@happy-kitchen-89482 thanks, I'll look into it, I'm one version behind, currently on 2.10.0.