Skip to content

Commit 64ea572

Browse files
authored
Merge pull request #41 from python-project-templates/copier-update-2026-10-11T11-27-22Z
Update from Copier (2026-10-11T11-27-22Z)
2 parents 1e4faa1 + 7088ae3 commit 64ea572

6 files changed

Lines changed: 40 additions & 38 deletions

File tree

‎.copier-answers.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: ebb6e1c
2+
_commit: '4372075'
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
55
add_extension: python

‎.github/workflows/build.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
workflow_dispatch:
1616

1717
concurrency:
18-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
group: ${{ github.workflow }}-${{ github.ref }}
1919
cancel-in-progress: true
2020

2121
permissions:

‎Makefile‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ lint-py: ## lint python with ruff
2525
python -m ruff format --check check_dist
2626

2727
lint-docs: ## lint docs with mdformat and codespell
28-
python -m mdformat --check README.md
29-
python -m codespell_lib README.md
28+
python -m mdformat --check README.md $(wildcard docs/src)
29+
python -m codespell_lib README.md $(wildcard docs/src)
3030

3131
fix-py: ## autoformat python code with ruff
3232
python -m ruff check --fix check_dist
3333
python -m ruff format check_dist
3434

3535
fix-docs: ## autoformat docs with mdformat and codespell
36-
python -m mdformat README.md
37-
python -m codespell_lib --write README.md
36+
python -m mdformat README.md $(wildcard docs/src)
37+
python -m codespell_lib --write README.md $(wildcard docs/src)
3838

3939
lint: lint-py lint-docs ## run all linters
4040
lints: lint
@@ -52,7 +52,7 @@ check-dist: ## check python sdist and wheel with check-dist
5252
check-types: ## check python types with ty
5353
ty check --python $$(which python)
5454

55-
checks: check-dist
55+
checks: check-dist check-types
5656

5757
# Alias
5858
check: checks

‎check_dist/tests/test_all.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,7 @@ def test_no_project_name(self):
798798

799799
def test_common_patterns_present(self):
800800
cfg = copier_defaults({"add_extension": "cpp", "project_name": "foo"})
801+
assert cfg is not None
801802
assert "LICENSE" in cfg["sdist"]["present"]
802803
assert "pyproject.toml" in cfg["sdist"]["present"]
803804
assert ".copier-answers.yaml" in cfg["sdist"]["absent"]

‎docs/src/configuration.md‎

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,28 @@ python -m check_dist._cli
2020
## How it works
2121

2222
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).
2727

2828
## `pyproject.toml` configuration
2929

3030
All configuration lives under the `[tool.check-dist]` table, split into `sdist` and `wheel` sub-tables.
3131

3232
### `[tool.check-dist.sdist]`
3333

34-
| Key | Type | Description |
35-
| --- | --- | --- |
34+
| Key | Type | Description |
35+
| --------- | --------------- | ------------------------------------------------------------ |
3636
| `present` | list of strings | Patterns that **must** match at least one file in the sdist. |
37-
| `absent` | list of strings | Patterns that **must not** match any file in the sdist. |
37+
| `absent` | list of strings | Patterns that **must not** match any file in the sdist. |
3838

3939
### `[tool.check-dist.wheel]`
4040

41-
| Key | Type | Description |
42-
| --- | --- | --- |
41+
| Key | Type | Description |
42+
| --------- | --------------- | ------------------------------------------------------------ |
4343
| `present` | list of strings | Patterns that **must** match at least one file in the wheel. |
44-
| `absent` | list of strings | Patterns that **must not** match any file in the wheel. |
44+
| `absent` | list of strings | Patterns that **must not** match any file in the wheel. |
4545

4646
### Example
4747

@@ -82,26 +82,26 @@ absent = [
8282

8383
Patterns in `present` and `absent` lists support several matching modes:
8484

85-
| Pattern | Matches |
86-
| --- | --- |
87-
| `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). |
85+
| Pattern | Matches |
86+
| ----------------- | ----------------------------------------------------------------------- |
87+
| `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). |
9090
| `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/`. |
9292

9393
Standard `fnmatch` wildcards are supported: `*`, `?`, `[seq]`, `[!seq]`.
9494

9595
## Platform-aware extension handling
9696

9797
`check-dist` automatically translates shared-library extensions across platforms so you can write a single configuration that works everywhere.
9898

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` |
105105

106106
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.
107107

@@ -133,7 +133,7 @@ exclude = ["target"]
133133

134134
This tells `check-dist` that the sdist should contain files from the listed paths, minus any excluded patterns.
135135

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.
137137
138138
## Copier template defaults
139139

@@ -177,7 +177,7 @@ options:
177177
178178
The `--pre-built` flag is useful when you have an existing build pipeline
179179
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
181181
directory containing the `.tar.gz` and `.whl` files:
182182
183183
```bash
@@ -190,11 +190,11 @@ dist was produced and warn about the failed build.
190190

191191
### Exit codes
192192

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). |
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). |
198198

199199
## Python API
200200

@@ -210,7 +210,7 @@ for msg in messages:
210210

211211
Key functions exposed from `check_dist`:
212212

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.
214214
- `load_config(pyproject_path, *, source_dir=None)` — load `[tool.check-dist]` configuration, falling back to copier defaults when `source_dir` is provided.
215215
- `load_copier_config(source_dir)` — load `.copier-answers.yaml` from a directory.
216216
- `copier_defaults(copier_config)` — derive `present`/`absent` patterns from copier answers.

‎pyproject.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ develop = [
3939
"codespell",
4040
"hatchling",
4141
"mdformat",
42+
"mdformat-frontmatter",
4243
"mdformat-tables>=1",
4344
"pytest",
4445
"pytest-cov",
@@ -108,7 +109,7 @@ absent = [
108109
[tool.coverage.run]
109110
branch = true
110111
omit = [
111-
"check_dist/tests/integration/",
112+
"check_dist/tests/integration/*",
112113
]
113114

114115
[tool.coverage.report]

0 commit comments

Comments
 (0)