lemon-oxygen-2929
11/24/2023, 1:54 PM__file__ in one of the files in the project's root. We do it this way in order to avoid being sensitive to the working directory the command is run from, and to avoid making any assumptions about where the code lives on a user's file system.
But unsurprisingly, when I run this as a pex, it now writes to a directory under ~/.pex/user_code, which is not what I want.
Is there a good pattern for figuring out a directory outside the pex build, without being sensitive to the current working directory?gorgeous-winter-99296
11/24/2023, 3:17 PMpants run, it'll use the workspace as working directory by default
Option (3): use something like platformdirs to resolve a place to log togorgeous-winter-99296
11/24/2023, 3:20 PMplatformdirs.user_log_dir() (or similar), direct artifacts to cwd, other workspaces passed by path.lemon-oxygen-2929
11/25/2023, 12:54 PMOption (2): when youThis is what I was missing, and I think it makes the most sense in this case. But all of these options are helpful and I can see them being useful for different things. Thanks very much!, it'll use the workspace as working directory by defaultpants run