hatch: Environment "path" does not support context formatting

When defining the “path” setting in an environment, it should I think be possible to use context formatting. For example, the {env_name} and {python} variables are not interpolated.

Steps to reproduce:

pyproject.toml

[tool.hatch.envs.venv]
path = ".venv/{python}"

[[tool.hatch.envs.venv.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11"]
hatch env find venv.py3.8

Expected:

/path/to/project/dir/.venv/3.8

Actual

/path/to/project/dir/{python}

About this issue

Most upvoted comments

Sorry, I meant to say for options that support context formatting it works. This option still does not but I will fix that soon.

Ah I see. Makes sense yeah. I think it would make more sense to support context formatting in the env path option. What do you think?

I am trying to set the default location for virtual environments to be in the project dir, so that I can easily use hatch environments with IDEs I understand this can be set using the [dirs.env] in the hatch configuration, but I wanted to be able to set this on a project level