abundant-hospital-56388
06/15/2022, 1:15 PMhappy-kitchen-89482
06/15/2022, 3:53 PM--restartable
flag on `repl`: https://www.pantsbuild.org/docs/reference-repl#section-restartableChanges to the code are immediately reflected in the venv.I guess you need to re-import any code that has changed?
abundant-hospital-56388
06/17/2022, 2:48 PM./pants run
. I checked it out and I was afraid before that it would have to build the cache again after a change, but the second run even with code changes in between is super fast.
One question there. Is there a way to define a target to be callable for example as ./pants run main-app
instead of ./pants run project/src/apps/main:main-app
or something similar?
For the second use case, I think it would also already work using the ./pants run
command, if we mount the cache into the docker container 🤔
Here the ideal workflow (as it happens right now) is that we start up our docker container (with mounted code dir) with interactive shell and on startup a venv is created and activated that has editable installs of our code in there. I can now run a command like main-app
if it's defined as an entry-point in e.g. my setup.py
. I now see, that I need to change something to the code, can do that outside the container and run the command inside the container again (which will have the latest changes included).
Pants could be used here to generate setup.py files that allow for the editable install or even allow you to extend the export
command to allow you to also do editable installs into the exported venv.
But I think with the pants-cache mounted as well, we could call ./pants run sth
instead of the direct call through venv and deal with it having to cache the dependencies etc once for each command. That is pretty much equivalent to the purpose that the venv basically serves (to have the dependencies loaded and apps ready to be executed). This is probably the more compatible solution here.happy-kitchen-89482
06/18/2022, 6:44 PM./pants run //:main-app
and so onabundant-hospital-56388
06/19/2022, 1:45 PM