File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ rye build --wheel
7373uv build --wheel projects/the_project
7474```
7575
76+ _ Are you using the ` uv ` build backend (and not the recommended ` hatch ` build backend)?_
77+ _ If so, you need to run the ` poly build setup ` and ` poly build teardown ` commands before and after the ` uv build ` command._
78+ _ This is needed because of the missing build hook support of the uv build backend._
79+
7680#### Maturin
7781``` shell
7882cd projects/the_project
Original file line number Diff line number Diff line change @@ -193,7 +193,8 @@ __Choose the name wisely.__ Have a look in [PEP-423](https://peps.python.org/pep
193193` --theme ` the structure of the workspace, ` loose ` is the recommended structure for Python.
194194
195195#### Edit the project configuration
196- Make sure that the build backend for ` uv ` is set to Hatch, having this section in the ` pyproject.toml ` :
196+ The recommended build backend for ` uv ` is Hatch. This is because of the very useful build hook support.
197+ Make sure to add this section, if not already added, in the ` pyproject.toml ` :
197198
198199``` toml
199200[build-system ]
@@ -213,6 +214,17 @@ Run the `sync` command to update the virtual environment:
213214uv sync
214215```
215216
217+ ##### What about the uv Build Backend?
218+ You can use the ` uv ` build backend with Polylith, even if the ` hatch ` backend is the recommended one.
219+
220+ Add this configuration, to make ` uv ` aware of namespace packages and the top namespace.
221+
222+ ``` toml
223+ [tool .uv .build-backend ]
224+ namespace = true
225+ module-name = " <the polylith top namespace here>"
226+ module-root = " "
227+ ```
216228
217229### Maturin
218230Add the ` polylith-cli ` as a development dependency to your ` pyproject.toml ` file:
You can’t perform that action at this time.
0 commit comments