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
73
73
uv build --wheel projects/the_project
74
74
```
75
75
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
+
76
80
#### Maturin
77
81
``` shell
78
82
cd 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
193
193
` --theme ` the structure of the workspace, ` loose ` is the recommended structure for Python.
194
194
195
195
#### 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 ` :
197
198
198
199
``` toml
199
200
[build-system ]
@@ -213,6 +214,17 @@ Run the `sync` command to update the virtual environment:
213
214
uv sync
214
215
```
215
216
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
+ ```
216
228
217
229
### Maturin
218
230
Add the ` polylith-cli ` as a development dependency to your ` pyproject.toml ` file:
You can’t perform that action at this time.
0 commit comments