-
-
Couldn't load subscription status.
- Fork 348
Description
Summary
Provide compatibility with uv workspaces.
Background
uv has recently added support for workspaces which you can read about here. When configured, all packages within a specific workspace are all automatically installed as editable. Workspaces also provides support for specific overrides, for example, by specifying that a package should be installed from a git+https link, or some absolute path.
In theory, uv automatically discovers the pyproject.toml file and any parent pyproject.toml file. For example, when using uv's own environment, running uv pip install --editable '.[devel]' works seamlessly. Unfortunately, the way Hatch invokes uv pip install somehow interfers with uv's automatic discovery of workspaces.
Workaround
The workaround at the moment is to run uv pip install --editable ... by hand using Hatch's pre-install commands. For example, the following works fine:
[tool.hatch.envs.default]
installer = "uv"
features = ["devel"]
pre-install-commands = ["uv pip install --editable '.[devel]'"] # omitting this results in a failureIt is unclear to me how this is a workaround, as I would have expected Hatch to run the same pre-install command in the background.