pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
5.86k stars 292 forks source link

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

Open johnpyp opened 4 months ago

johnpyp commented 4 months ago

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.

ofek commented 4 months ago

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