hatch icon indicating copy to clipboard operation
hatch copied to clipboard

[feature request] Hatch Plugin Updates

Open juftin opened this issue 1 year ago • 1 comments

The tool.hatch.env table has been extremely useful for getting environment plugins installed into hatch's own environment:

[tool.hatch.env]
requires = [
    "hatch-pip-compile"
]

However there are cases where users might want to update plugins for new features / bug fixes and this can be difficult. Personally, I use pipx to install hatch for this reason because it gives me full control of the entire hatch environment:

pipx install --python=$(which python3.12) hatch
pipx inject hatch hatch-pip-compile
pipx runpip hatch install --upgrade hatch-pip-compile

Installing from the binary doesn't support something like this AFAICT. The best way I know how to achieve this would be to temporarily change the tool.hatch.env table and run hatch once:

[tool.hatch.env]
requires = [
    "hatch-pip-compile>=1.11.1"
]

A new CLI command giving users access to hatch's own environment could be very useful for this:

hatch self runpip install --upgrade hatch-pip-compile

or a command that just adds the --upgrade flag to pip install the dependencies listed in tool.hatch.env.requires:

hatch self env install --update

Related to https://github.com/juftin/hatch-pip-compile/issues/77 Related to https://github.com/pypa/hatch/issues/442

juftin avatar Mar 04 '24 18:03 juftin

We have a similar problem with a builder plugin (configured under [build-system]'s requires entry). The only way to upgrade it seems to be to specify the version number explicitly as above.

Is there a way to figure out which environment hatch uses for its plugins? Neither my system installation, nor the virtual environments listed via hatch env show contain the hatch plugins.

ssiccha avatar May 21 '25 07:05 ssiccha