Skip to content

Commit bc3ed4a

Browse files
authored
Merge pull request #24 from python-project-templates/copier-update-2025-07-29T22-55-28
Update from copier (2025-07-29T22:55:28)
2 parents b5d02dd + e260509 commit bc3ed4a

File tree

10 files changed

+233
-5
lines changed

10 files changed

+233
-5
lines changed

.copier-answers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Changes here will be overwritten by Copier
2-
_commit: c53b04c
2+
_commit: e29838a
33
_src_path: https://github.com/python-project-templates/base.git
44
add_docs: true
5-
add_wiki: true
65
add_extension: cpp
6+
add_wiki: true
77
88
github: python-project-templates
99
project_description: A C++-Python project template

.github/workflows/wiki.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "docs/**"
9+
- "README.md"
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: docs
14+
cancel-in-progress: true
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
deploy:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- run: cp README.md docs/wiki/Home.md
25+
- uses: Andrew-Chen-Wang/github-wiki-action@v4
26+
with:
27+
path: docs/wiki

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ install: ## install python library
2424
#########
2525
# LINTS #
2626
#########
27-
.PHONY: lint-py lint-cpp lint lints
27+
.PHONY: lint-py lint-cpp lint-docs lint lints
2828
lint-py: ## run python linter with ruff
2929
python -m ruff check python_template_cpp
3030
python -m ruff format --check python_template_cpp
3131

3232
lint-cpp: ## run cpp linter
3333
clang-format --dry-run -Werror -i -style=file `find ./cpp -name "*.*pp"`
3434

35+
lint-docs: ## lint docs with mdformat and codespell
36+
python -m mdformat --check README.md docs/wiki/
37+
python -m codespell_lib README.md docs/wiki/
38+
3539
lint: lint-cpp lint-py ## run project linters
3640

3741
# alias
@@ -45,7 +49,11 @@ fix-py: ## fix python formatting with ruff
4549
fix-cpp: ## fix cpp formatting
4650
clang-format -i -style=file `find ./cpp -name "*.*pp"`
4751

48-
fix: fix-cpp fix-py ## run project autoformatters
52+
fix-docs: ## autoformat docs with mdformat and codespell
53+
python -m mdformat README.md docs/wiki/
54+
python -m codespell_lib --write README.md docs/wiki/
55+
56+
fix: fix-cpp fix-py fix-docs ## run project autoformatters
4957

5058
# alias
5159
format: fix

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ A C++-Python project template
99

1010
## Overview
1111

12-
1312
> [!NOTE]
1413
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).

docs/wiki/_Footer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_This wiki is autogenerated. To made updates, open a PR against the original source file in [`docs/wiki`](https://github.com/python-project-templates/python-template-cpp/tree/main/docs/wiki)._

docs/wiki/_Sidebar.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--
2+
This sidebar is displayed on the GitHub Wiki section instead of the default sidebar.
3+
Notes for editors:
4+
- Ensure links don't have the file extensions (i.e., `.md`)
5+
- Do not use colons (':') in page titles, they don't render properly as links in the sidebar
6+
- Use only the filenames in this page (without the filepath and file extension)
7+
-->
8+
9+
**[Home](Home)**
10+
11+
**Get Started**
12+
13+
- [Installation](Installation)
14+
- [Contributing](Contribute)
15+
- [Development Setup](Local-Development-Setup)
16+
- [Build from Source](Build-from-Source)
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
`python-template-cpp` is written in Python. While prebuilt wheels are provided for end users, it is also straightforward to build `python-template-cpp` from either the Python [source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/) or the GitHub repository.
2+
3+
- [Make commands](#make-commands)
4+
- [Prerequisites](#prerequisites)
5+
- [Clone](#clone)
6+
- [Install Python dependencies](#install-python-dependencies)
7+
- [Build](#build)
8+
- [Lint and Autoformat](#lint-and-autoformat)
9+
- [Testing](#testing)
10+
11+
## Make commands
12+
13+
As a convenience, `python-template-cpp` uses a `Makefile` for commonly used commands. You can print the main available commands by running `make` with no arguments
14+
15+
```bash
16+
> make
17+
18+
build build the library
19+
clean clean the repository
20+
fix run autofixers
21+
install install library
22+
lint run lints
23+
test run the tests
24+
```
25+
26+
## Prerequisites
27+
28+
`python-template-cpp` has a few system-level dependencies which you can install from your machine package manager. Other package managers like `conda`, `nix`, etc, should also work fine.
29+
30+
## Clone
31+
32+
Clone the repo with:
33+
34+
```bash
35+
git clone https://github.com/python-project-templates/python-template-cpp.git
36+
cd python-template-cpp
37+
```
38+
39+
## Install Python dependencies
40+
41+
Python build and develop dependencies are specified in the `pyproject.toml`, but you can manually install them:
42+
43+
```bash
44+
make requirements
45+
```
46+
47+
Note that these dependencies would otherwise be installed normally as part of [PEP517](https://peps.python.org/pep-0517/) / [PEP518](https://peps.python.org/pep-0518/).
48+
49+
## Build
50+
51+
Build the python project in the usual manner:
52+
53+
```bash
54+
make build
55+
```
56+
57+
## Lint and Autoformat
58+
59+
`python-template-cpp` has linting and auto formatting.
60+
61+
| Language | Linter | Autoformatter | Description |
62+
| :------- | :---------- | :------------ | :---------- |
63+
| Python | `ruff` | `ruff` | Style |
64+
| Markdown | `mdformat` | `mdformat` | Style |
65+
| Markdown | `codespell` | | Spelling |
66+
67+
**Python Linting**
68+
69+
```bash
70+
make lint-py
71+
```
72+
73+
**Python Autoformatting**
74+
75+
```bash
76+
make fix-py
77+
```
78+
79+
**Documentation Linting**
80+
81+
```bash
82+
make lint-docs
83+
```
84+
85+
**Documentation Autoformatting**
86+
87+
```bash
88+
make fix-docs
89+
```
90+
91+
## Testing
92+
93+
`python-template-cpp` has extensive Python tests. The tests can be run via `pytest`. First, install the Python development dependencies with
94+
95+
```bash
96+
make develop
97+
```
98+
99+
**Python**
100+
101+
```bash
102+
make test
103+
```

docs/wiki/contribute/Contribute.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Contributions are welcome on this project. We distribute under the terms of the [Apache 2.0 license](https://github.com/python-project-templates/python-template-cpp/blob/main/LICENSE).
2+
3+
> [!NOTE]
4+
>
5+
> `python-template-cpp` requires [Developer Certificate of Origin](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin) for all contributions.
6+
> This is enforced by a [Probot GitHub App](https://probot.github.io/apps/dco/), which checks that commits are "signed".
7+
> Read [instructions to configure commit signing](Local-Development-Setup#configure-commit-signing).
8+
9+
For **bug reports** or **small feature requests**, please open an issue on our [issues page](https://github.com/python-project-templates/python-template-cpp/issues).
10+
11+
For **questions** or to discuss **larger changes or features**, please use our [discussions page](https://github.com/python-project-templates/python-template-cpp/discussions).
12+
13+
For **contributions**, please see our [developer documentation](Local-Development-Setup). We have `help wanted` and `good first issue` tags on our issues page, so these are a great place to start.
14+
15+
For **documentation updates**, make PRs that update the pages in `/docs/wiki`. The documentation is pushed to the GitHub wiki automatically through a GitHub workflow. Note that direct updates to this wiki will be overwritten.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## Table of Contents
2+
3+
- [Table of Contents](#table-of-contents)
4+
- [Step 1: Build from Source](#step-1-build-from-source)
5+
- [Step 2: Configuring Git and GitHub for Development](#step-2-configuring-git-and-github-for-development)
6+
- [Create your fork](#create-your-fork)
7+
- [Configure remotes](#configure-remotes)
8+
- [Authenticating with GitHub](#authenticating-with-github)
9+
- [Guidelines](#guidelines)
10+
11+
## Step 1: Build from Source
12+
13+
To work on `python-template-cpp`, you are going to need to build it from source. See
14+
[Build from Source](Build-from-Source) for
15+
detailed build instructions.
16+
17+
Once you've built `python-template-cpp` from a `git` clone, you will also need to
18+
configure `git` and your GitHub account for `python-template-cpp` development.
19+
20+
## Step 2: Configuring Git and GitHub for Development
21+
22+
### Create your fork
23+
24+
The first step is to create a personal fork of `python-template-cpp`. To do so, click
25+
the "fork" button at https://github.com/python-project-templates/python-template-cpp, or just navigate
26+
[here](https://github.com/python-project-templates/python-template-cpp/fork) in your browser. Set the
27+
owner of the repository to your personal GitHub account if it is not
28+
already set that way and click "Create fork".
29+
30+
### Configure remotes
31+
32+
Next, you should set some names for the `git` remotes corresponding to
33+
main python-project-templates repository and your fork. See the [GitHub Docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork) for more information.
34+
35+
### Authenticating with GitHub
36+
37+
If you have not already configured `ssh` access to GitHub, you can find
38+
instructions to do so
39+
[here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh),
40+
including instructions to create an SSH key if you have not done
41+
so. Authenticating with SSH is usually the easiest route. If you are working in
42+
an environment that does not allow SSH connections to GitHub, you can look into
43+
[configuring a hardware
44+
passkey](https://docs.github.com/en/authentication/authenticating-with-a-passkey/about-passkeys)
45+
or adding a [personal access
46+
token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
47+
to avoid the need to type in your password every time you push to your fork.
48+
49+
## Guidelines
50+
51+
After developing a change locally, ensure that both [lints](Build-from-Source#lint-and-autoformat) and [tests](Build-from-Source#testing) pass. Commits should be squashed into logical units, and all commits must be signed (e.g. with the `-s` git flag). We require [Developer Certificate of Origin](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin) for all contributions.
52+
53+
If your work is still in-progress, open a [draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests). Otherwise, open a normal pull request. It might take a few days for a maintainer to review and provide feedback, so please be patient. If a maintainer asks for changes, please make said changes and squash your commits if necessary. If everything looks good to go, a maintainer will approve and merge your changes for inclusion in the next release.
54+
55+
Please note that non substantive changes, large changes without prior discussion, etc, are not accepted and pull requests may be closed.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ develop = [
3737
"bump-my-version",
3838
"check-manifest",
3939
"cibuildwheel",
40+
"codespell>=2.4,<2.5",
4041
"hatch-cpp",
4142
"hatchling",
43+
"mdformat>=0.7.22,<0.8",
44+
"mdformat-tables>=1",
4245
"pytest",
4346
"pytest-cov",
4447
"ruff",
@@ -56,6 +59,7 @@ Homepage = "https://github.com/python-project-templates/python-template-cpp"
5659
current_version = "0.1.0"
5760
commit = true
5861
tag = true
62+
commit_args = "-s"
5963

6064
[[tool.bumpversion.files]]
6165
filename = "python_template_cpp/__init__.py"

0 commit comments

Comments
 (0)