pypa / hatch

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

Exposing system environment #810

Open ThmX opened 1 year ago

ThmX commented 1 year ago

Follow up from https://github.com/pypa/hatch/issues/796#issuecomment-1493407989

Yes please open a new issue, and consider whether improving and exposing this current environment type I call system as public would suffice https://github.com/pypa/hatch/blob/master/src/hatch/env/system.py

To focus on a concrete use case, although it is nice that we can simply set the environment using type = "system", it means that it has to be defined inside the pyproject.toml or hatch.toml. I'm thinking of the case where someone wants to use a venv but someone else does not (i.e.: system). In that case, I think that a global configuration for hatch in its config.toml would do that trick by defining the default environment type to be used.

This could be done here https://hatch.pypa.io/latest/config/hatch/ by adding a env.type variable.

I definitely see how this can be done within the current code base, but I wonder if that could also be done inside a plugin?

@ofek What do you think?

ThmX commented 1 year ago

Any update on this?

ofek commented 1 year ago

Sorry not yet but hopefully in a few weeks