Skip to content

How To Run a Python Source That Uses Files In Repo Subdirectory #20206

Answered by huonw
justicefreed asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@justicefreed
Comment options

@huonw
Comment options

huonw Nov 21, 2023
Collaborator

Answer selected by justicefreed
@justicefreed
Comment options

@justicefreed
Comment options

@justicefreed
Comment options

@justicefreed
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants