bumpy-fireman-59234
10/21/2023, 4:31 PMprint(os.environ)
as the first line of my code, and the vars in .env are already present. Is that the default behavior?
2. It looks like if I use the relative path from source root, I can access data files without making a resource target and dependency. Is that correct? (This is for playing around, I know if I need to package things up, I'll need to create a target and dependency for the pex.)
3. Is the CWD always the source root when I do a pants run
late-advantage-75311
10/21/2023, 5:46 PMlate-advantage-75311
10/21/2023, 5:53 PMcurved-television-6568
10/21/2023, 6:15 PM.env
file will be loaded when pants is bootstrapped (by scie-pants
) but I wouldn't have expected those to leak through to your executed process unless you have punched holes for them in pants configuration.
for running python sources, it depends on this setting: https://www.pantsbuild.org/docs/reference-python_source#coderun_goal_use_sandboxcode
the CWD is always repo root when using the pants daemon, but if you don't, it'll be using your current CWD. This is an unfortunate nuance we'd like to make consistent. https://github.com/pantsbuild/pants/issues/19682bumpy-fireman-59234
10/21/2023, 6:34 PMprint(os.environ)
, and a .env with a single variable. Even in that case, it leaked through.bitter-ability-32190
10/21/2023, 8:02 PMcurved-television-6568
10/21/2023, 8:54 PM