feat: Add working_directory configuration option
In my projects, I often work in a subdirectory of the project root.
When executing scripts hatch changes its working directory to the project root, which is confusing when scripts take files as arguments.
This PR introduces a new global configuration option to allow the user to select how hatch should behave:
- change the working directory to the project root as it is now;
- execute the script in the current working directory.
I left the old behavior as the default one.
i'm not sure whether i understand the docs correctly, but have you considered to make that option available on the environment-level as well? please ignore if that's already happeneing here.
i'm not sure whether i understand the docs correctly, but have you considered to make that option available on the environment-level as well? please ignore if that's already happeneing here.
This PR provides only the global option.
I don't have time to do it right now, but I'll be happy to add it later
@ofek Is there a workaround for this at the moment ?
Sorry for the lack of review time! The next minor release introduces a breaking change such that the current directory will no longer be modified if already inside the root: https://github.com/pypa/hatch/pull/1371