#I’m a bit stumped: shouldn’t this work?

1 messages · Page 1 of 1 (latest)

alpine barn
#

the only thing I can think of is that it's somehow loading the wrong config

#

i.e. it works for me

exotic hollow
#

Yeah only happens in one project one one of my machines, but I have no clue why that could be and how to debug it

#

The behavior survives recreating the env

alpine barn
#

try hatch env show

exotic hollow
#

Ah, the reason was that I also had a hatch.toml

#

It didn’t mention the default env (configured in pyproject.toml) at all, yet the file’s existence caused the default env configuration in pyproject.toml to be ignored

alpine barn
#

oh I see

exotic hollow
#

It’s surprising that hatch.toml existing overrides the tool.hatch.envs.default table in pyproject.toml

#

shall I file a bug?

alpine barn
exotic hollow
#

OK, so having envs in both is the cause

exotic hollow
#

This continues to be surprising and not practical to me

#

I’d prefer if there was a way to have project-specified envs in addition to a way to surgically modify them

#

The intuitive way to do that would be that pyproject.toml is checked in and contains the project-defined envs, while hatch.toml is .gitignored and allows to override individual fields in the envs

#

But I’d be OK with any other way to achieve that

alpine barn
#

would you prefer an error for duplicate top level keys?

exotic hollow
#

More like a blessed way to merge/override configuration at a deeper level.

If that gets introduced together with an error, that works, but an error without it would make it impossible to override anything.

alpine barn
#

can you give a concrete example to help me better understand?