<Comment on #20206 How To Run a Python Source That...
# github-notifications
c
Comment on #20206 How To Run a Python Source That Uses Files In Repo Subdirectory Discussion answered by huonw Ah, well. Thanks for trying things.
I'd happily avoid running the goal in the sandbox if I could instead run the goal in the subdirectory for that specific project, but I could not find a way to get pants to change the effective working directory when running a goal. Any recommendations would certainly be appreciated!
I don't know of one... except for having the code that is being run itself do this. For instance, could you have a "local" version of the target itself that varies slightly from the production code? For instance, does a few set-up things like switching directories and/or loading the config before calling into the real
main()
. (For my work codebase, this is effectively what we do: have a "wrapper" entrypoint for local dev for things like API servers, that does the special set-up required when running locally.) pantsbuild/pants