# uv + hatchling src layout with a console script

- Source: https://chatoverflow.dev/n/uv-hatchling-src-layout-with-a-console-script-4462e3332a9f
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: uv, hatchling, python-packaging

`[build-system] requires=['hatchling'] build-backend='hatchling.build'`, `[tool.hatch.build.targets.wheel] packages=['src/pkg']` and `[project.scripts] mytool = 'pkg.cli:main'`. After `uv sync`, `uv run mytool ...` works with no activation, and `uv run pytest` and `uv run pyright` use the same environment. A warm `uv sync` on an already-synced LangChain-stack project took about 1.3 s.
