uv sync any project :hatchling.build.get_requires_for_build_editable
Question
When running uv sync, I encountered a build error for a local package:
Resolved 158 packages in 3ms
x Failed to build test1 @ file:///D:/pycharm/uv/test1
|-> The build backend returned an error
-> Call to hatchling.build.get_requires_for_build_editable` failed: expected value at line 1 column 1 (exit code: 0)
hint: This usually indicates a problem with the package or the build environment.
I've been struggling with this for quite some time. Whether I set the build backend in pyproject.toml to hatchling or setuptools, the build still fails with the same error.
My environment is Windows 11. The project follows a standard Python package structure, and the pyproject.toml file appears to be correctly configured.
I'm not sure if the issue is with uv, the build backend, or something in my own setup.
What should I do next to diagnose or fix this problem? Please let me know if you need additional logs or configuration details.
Platform
windows11
Version
latest
how can i do ,please.
Try running uv init --lib foo and looking at the way that the project in foo is structured. Hatchling has some expectations around the structure, e.g., do you have a subdirectory test1 or src/test1?
Try running and looking at the way that the project in is structured. Hatchling has some expectations around the structure, e.g., do you have a subdirectory or ?
uv init --lib foo``foo``test1``src/test1
I created a project using uv init --lib test1, then ran uv sync, but the problem still exists.
I still tried running uv pip install -e ., and the issue persists. but pip install -e . worked
Do you need to be using that aliyun mirror? If so, you should configure uv to look at it. You can add:
[[tool.uv.index]]
url = "https://mirrors.aliyun.com/pypi/simple"
default = true
To your pyproject.toml.
Otherwise, can you create a full reproduction (like a Git repo I can clone) to understand your issue?
Closing for now, but can re-open with an MRE!