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 64ea572
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/src/configuration.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,28 +20,28 @@ python -m check_dist._cli
20
20
## How it works
21
21
22
22
1.**Build** — `check-dist` builds an sdist and a wheel using [build](https://pypi.org/project/build/).
23
-
2.**List** — It lists every file inside each archive.
24
-
3.**VCS comparison** — For the sdist, it compares the contents against files tracked by version control (currently git), taking into account any `[tool.hatch.build.targets.sdist]` configuration in `pyproject.toml`.
25
-
4.**Present / absent checks** — It verifies that files matching your `present` patterns exist and files matching your `absent` patterns do not, for both the sdist and the wheel.
26
-
5.**Platform extension checks** — It flags files that use a shared-library extension from another platform (e.g. a `.so` inside a Windows wheel).
23
+
1.**List** — It lists every file inside each archive.
24
+
1.**VCS comparison** — For the sdist, it compares the contents against files tracked by version control (currently git), taking into account any `[tool.hatch.build.targets.sdist]` configuration in `pyproject.toml`.
25
+
1.**Present / absent checks** — It verifies that files matching your `present` patterns exist and files matching your `absent` patterns do not, for both the sdist and the wheel.
26
+
1.**Platform extension checks** — It flags files that use a shared-library extension from another platform (e.g. a `.so` inside a Windows wheel).
27
27
28
28
## `pyproject.toml` configuration
29
29
30
30
All configuration lives under the `[tool.check-dist]` table, split into `sdist` and `wheel` sub-tables.
|`LICENSE`| A file named exactly `LICENSE` at any depth.|
88
+
|`my_package`| Any file whose path starts with `my_package/` (directory match).|
89
+
|`*.py`| Any file ending in `.py` (glob against the basename).|
90
90
|`my_package/*.py`|`.py` files directly inside `my_package/` (glob against the full path). |
91
-
|`.github`| Any file under `.github/`. |
91
+
|`.github`| Any file under `.github/`.|
92
92
93
93
Standard `fnmatch` wildcards are supported: `*`, `?`, `[seq]`, `[!seq]`.
94
94
95
95
## Platform-aware extension handling
96
96
97
97
`check-dist` automatically translates shared-library extensions across platforms so you can write a single configuration that works everywhere.
98
98
99
-
| Written in config | Linux | macOS | Windows |
100
-
| --- | --- | --- | --- |
101
-
|`*.so`|`*.so`|`*.so`|`*.pyd`|
102
-
|`*.pyd`|`*.so`|`*.so`|`*.pyd`|
103
-
|`*.dll`|`*.so`|`*.dylib`|`*.dll`|
104
-
|`*.dylib`|`*.so`|`*.dylib`|`*.dll`|
99
+
| Written in config | Linux | macOS| Windows |
100
+
| -----------------| ------| ---------|------- |
101
+
|`*.so`|`*.so`|`*.so`|`*.pyd`|
102
+
|`*.pyd`|`*.so`|`*.so`|`*.pyd`|
103
+
|`*.dll`|`*.so`|`*.dylib`|`*.dll`|
104
+
|`*.dylib`|`*.so`|`*.dylib`|`*.dll`|
105
105
106
106
In addition, if a file with a **wrong** extension for the current platform appears in a distribution (e.g. a `.so` file in a Windows wheel), `check-dist` will raise an error.
107
107
@@ -133,7 +133,7 @@ exclude = ["target"]
133
133
134
134
This tells `check-dist` that the sdist should contain files from the listed paths, minus any excluded patterns.
135
135
136
-
> **Note:** Hatchling force-includes VCS exclusion files (e.g. `.gitignore`) in sdists regardless of exclude rules. Do not add `.gitignore` to your `absent` list for sdist checks.
136
+
> **Note:** Hatchling force-includes VCS exclusion files (e.g. `.gitignore`) in sdists regardless of exclude rules. Do not add `.gitignore` to your `absent` list for sdist checks.
137
137
138
138
## Copier template defaults
139
139
@@ -177,7 +177,7 @@ options:
177
177
178
178
The `--pre-built` flag is useful when you have an existing build pipeline
179
179
that produces the sdist and wheel (e.g. projects with complex native
180
-
toolchains like Rust + WASM or C++ + Emscripten). Point it at the
180
+
toolchains like Rust + WASM or C++ + Emscripten). Point it at the
181
181
directory containing the `.tar.gz` and `.whl` files:
182
182
183
183
```bash
@@ -190,11 +190,11 @@ dist was produced and warn about the failed build.
190
190
191
191
### Exit codes
192
192
193
-
| Code | Meaning |
194
-
| --- | --- |
195
-
| 0 | All checks passed. |
196
-
| 1 | One or more checks failed. |
197
-
| 2 | An unexpected error occurred (e.g. build failure, git not found). |
| 2 | An unexpected error occurred (e.g. build failure, git not found). |
198
198
199
199
## Python API
200
200
@@ -210,7 +210,7 @@ for msg in messages:
210
210
211
211
Key functions exposed from `check_dist`:
212
212
213
-
-`check_dist(source_dir, *, no_isolation=False, verbose=False, pre_built=None)` — run all checks, returns `(bool, list[str])`. Pass `pre_built="dist/"` to skip building.
213
+
-`check_dist(source_dir, *, no_isolation=False, verbose=False, pre_built=None)` — run all checks, returns `(bool, list[str])`. Pass `pre_built="dist/"` to skip building.
214
214
-`load_config(pyproject_path, *, source_dir=None)` — load `[tool.check-dist]` configuration, falling back to copier defaults when `source_dir` is provided.
215
215
-`load_copier_config(source_dir)` — load `.copier-answers.yaml` from a directory.
216
216
-`copier_defaults(copier_config)` — derive `present`/`absent` patterns from copier answers.
0 commit comments