hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Enable using a project-local hatch `config.toml` file without setting `HATCH_CONFIG`

Open johnpyp opened this issue 1 year ago • 3 comments

Hi, love the project!

The one thing that's been bothering me so far is that I can't customize the things in config.toml locally to a project, unless I set the environment override of HATCH_CONFIG manually / with some other tool.

For example, I'd like to add:

[dirs.env]
virtual = ".my-venv-path"

to a few specific projects, but not have to require my coworkers to set this themselves in their global hatch config, nor do I want to change the default for all of their projects. I'd also like to set other things like the cache dir, shell, etc. - locally.

This pattern is pretty common with other package managers / runners, like npm's .npmrc, which can be used globally and project-local.


Alternatively, rather than introducing the config.toml to the project alongside the other two main config files, a section in pyproject.toml or hatch.toml that is explicitly for overriding hatch behavior would work great too.

johnpyp avatar May 03 '24 22:05 johnpyp

Sure, I can do this! Thanks for the extra context.

ofek avatar May 04 '24 00:05 ofek

+1. Similar context. Looking forward to this feature!

smp4 avatar Sep 27 '24 10:09 smp4

Hello - is there a way to do this in pyproject/hatch.toml yet?

tmct avatar Apr 04 '25 09:04 tmct