For my mono-repo, Im planning to use all that pych...
# general
c
For my mono-repo, Im planning to use all that pycharm has to offer in terms of developing debugging. However I'm unsure how to approach the venv. I now have three projects and will have five once im finished implementing pants. Ideally I would have a venv for each. I've been looking into the pants export functionality, as it creates a venv, but im unsure how to hook it up to pycharm since its a PEX file. I've seen some comments around slack about using PEX_TOOLS to create a venv from the pex, but I cant find any proper documentation about it. Is this the way to go, or should I work with the requirement.txt files that are corresponding to each project? Has anybody solved this for pycharm and whats best practice here?
e
pants export --py-resolve-format=mutable_virtualenv --resolve=<your resolve here>
will create a venv at `dist/export/python/virtualenvs/<your resolve name>/<python version>`which you can point your editor to. I'm not sure about Pycharm, but for VSCode I just had to do the "Select Interpreter" command, and then browse to
dist/export/python/virtualenvs/<your resolve name>/<python version>/bin/python
and select it. (The IDE couldn't autofind the venv, but once I manually selected it once, it preserved the settings and I've never had to do it again)
I'd expect Pycharm has some similar kind of "Set your python interpreter" type feature
c
Thanks for your response Luke, I wasnt able to select the python files there. Is it normal that these are 0KB
e
Not sure, I haven't really inspected them much. But its probably likely that they are syminks, so that's not surprising.
c
I'm on a windows machine and have been using WSL, so rn I'm asuming its pointing to my Python interpreter under Linux
e
That seems to make sense
c
I've added the windows variant of a symlink, seems to be working for now. maybe some other windows/unix incompatibilities show up. Thanks again Luke!
e
no problem