Hi guys. Quick question. We are trying to run djan...
# general
i
Hi guys. Quick question. We are trying to run django migrations inside of the pex binary, but the migration files end up being generated inside the sandbox, which means they go away. To get around this, we have been running with
-no-run-cleanup
to preserve the files, but it is tedious to copy the files out of the pex sandbox. Anybody dealt with this and have a good solution?
h
Hi, which Pants version? And what command are you running?
We have solutions for this and several other Djangoisms, that I should really document…
c
Have this handy because we were just looking at it: https://www.pantsbuild.org/docs/python-run-goal#execution-semantics
run_goal_use_sandbox = False
is likely what you need
i
We are running
2.12.0
and running
./pants run --no-run-cleanup src/xxx/manage.py -- makemigrations xxx
omg...i'm not sure how we missed this. will try it out now
h
So in Pants 2.13 doing
run path/to/manage.py
will not run in a sandbox, while
run path/to:manage_target
will run in a sandbox, but in 2.12 that field is what you need
i
So we just tried updating to 2.13 and it still generated inside a tmp
Where do we put
run_goal_use_sandbox
^ adding
run_goal_use_sandbox
in fact worked
h
Oh, maybe it’s 2.14
@bitter-ability-32190?
b
We haven't changed the default semantics yet. There's some FUD around it. So in every version it'll always default to sandboxing
(Although https://github.com/pantsbuild/pants/issues/17372 means you might never run in the sandbox 😅 but thats a bug )
i
lol. ok. thanks guys