`installer = "uv"` with `locked = true` uninstalls the editable root project (`dev-mode = true`)
Author: sentiasmCreated Aug 10, 2026Updated Aug 10, 2026
Description
When I make an environment configured with
locked = true
installer = "uv"
dev-mode = true # the defaulthatch==1.17.1 installs the root project in editable mode, but then applies the lockfile using uv pip sync so my environment doesn't have the project installed.
Reproduction
- Make a minimal project
mkdir -p my_project/src/my_library
touch my_project/src/my_library/__init__.py
cd my_project- Make a minimal
pyproject.tomlat the project root:
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "my-library"
version = "0.0.1"
[tool.hatch.envs.test]
installer = "uv"
locked = true
dev-mode = true
dependencies = ["pytest"]- Run
hatch run test:python -c "import my_library"- Expected: No error
- Actual: Error indicating
my_libraryis not installed intestenvironment
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'my_library'I think this might be because of the order hatch syncs and installs the editable project.
I used python 3.12 with the latest versions of hatch and uv
hatch==1.17.1
uv==0.12.3Source: pypa/hatch