Open dhdaines opened 6 months ago
Seems reasonable, I will do this.
I haven't forgotten but this won't make it in the next minor release. Also FYI the way I will approach this is adding new commands e.g. for setup
.
Makes sense!
Also just want to add a note to anyone who reads this: running mypy --install-types
when setting up an environment is a bad example, don't do this :) since if your type checking fails, you won't have an environment! (you could add || true
if you really want to)
I often would like to run something like
mypy --install-types
orpre-commit install
when setting up a particular environment. Unfortunately, this does not work. For example if you put this in yourpyproject.toml
:Then you get this error:
Thankfully there is a workaround - if you add an
optional-dependencies
feature with these environment-specific dependencies, then they do get installed beforepost-install-commands
are run, e.g.:This seems unintuitive to me though. Hatch should install both the package and the environment dependencies before running
post-install-commands
as this seems like what the user would expect.