fierce-keyboard-91032
07/31/2022, 8:33 AMmake_migration
) in a Pants repository. I need to do this outside of the sandbox, since they generate some new files for the codebase.
Looking at #12129 and previous discussions, it seems people were working on adding a run_in_sandbox
flag to pex_binary
, but it got reverted in #15849.
What would be the recommended way to do this now?sparse-lifeguard-95737
07/31/2022, 2:59 PMpython_source
targetrhythmic-glass-66959
07/31/2022, 5:01 PMAt this point we need to run. Unfortunately there isn’t a great path for this on Pants as of writing. What I found worked best was the following.makemigrations
Copy code./pants run src:manage -- makemigrations --dry-run --verbosity 3 polls
This command prints the proposed migration files to stdout. You then need to write this output to.src/polls/migrations/0001_initial.py
bitter-ability-32190
07/31/2022, 5:41 PMsource
is a Python file is now automatically runnable (albeit in a sandbox).
Then you can either set the `run_goal_use_sandbox`flag on the target or the [python].default_run_goal_use_sandbox
to change the entire repo. Setting it to false runs the source in your repo tree directly.
Eventually this will be the default behaviorrhythmic-glass-66959
08/01/2022, 1:34 AMfierce-keyboard-91032
08/01/2022, 7:26 AMdefault_run_goal_use_sandbox
to false seems to work, albeit as a workaround.
If I can set the flag in ./pants run
, that would be great! E.g., ./pants run --run_in_sandbox=false
.bitter-ability-32190
08/01/2022, 10:22 AM./pants --no-python-default-run-in-sandbox