You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ab3e000
Browse filesBrowse the repository at this point in the historyBrowse files
Add --all flag to hatch build for building all workspace members (#2352)
* Add --all flag to hatch build for building all workspace members
* Fix so all flag does not require root project as a member and build when no top level project defined handles workspace members only
Copy file name to clipboardExpand all lines: docs/history/hatch.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
8
9
9
## Unreleased
10
10
11
+
***Added:***
12
+
13
+
- Add the `--all`/`-a` flag to the `build` command to build the workspace root and every workspace member defined by the selected environment, consolidating artifacts in the workspace root's `dist` directory by default. A root that does not define a `project` table is skipped so that a top-level `pyproject.toml` may only contain workspace configuration
Copy file name to clipboardExpand all lines: docs/how-to/environment/workspace.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,6 +71,20 @@ workspace.members = [
71
71
]
72
72
```
73
73
74
+
## Building all members
75
+
76
+
Build an `sdist` and `wheel` for the workspace root and every workspace member with the [`build`](../../cli/reference.md#hatch-build) command's `--all` flag:
77
+
78
+
```
79
+
hatch build --all
80
+
```
81
+
82
+
The root project is built first and does not need to be listed as a member. If the top-level `pyproject.toml` does not define a `project` table and only serves as a container for workspace configuration, the root is skipped and only the members are built. Members are discovered from the selected environment's `workspace.members` option and artifacts are consolidated in the workspace root's `dist` directory by default, ready for e.g. `twine upload dist/*`. Pass a location argument to write artifacts elsewhere:
83
+
84
+
```
85
+
hatch build --all out/artifacts
86
+
```
87
+
74
88
## Test matrices with workspaces
75
89
76
90
Combine workspace configuration with test matrices:
0 commit comments