Skip to content

Commit 67e937d

Browse files
authored
Merge pull request #37 from python-project-templates/copier-update-2025-07-29T20-00-07
Update from copier (2025-07-29T20:00:07)
2 parents 4a22b83 + 3202a07 commit 67e937d

File tree

10 files changed

+236
-9
lines changed

10 files changed

+236
-9
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: python
6+
add_wiki: true
77
email: 3105306+timkpaine@users.noreply.github.com
88
github: python-project-templates
99
project_description: A pure-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: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,27 @@ install: ## install library
1515
#########
1616
# LINTS #
1717
#########
18-
.PHONY: lint lints fix format
18+
.PHONY: lint-py lint-docs fix-py fix-docs lint lints fix format
1919

20-
lint: ## run python linter with ruff
20+
lint-py: ## lint python with ruff
2121
python -m ruff check python_template
2222
python -m ruff format --check python_template
2323

24-
# Alias
25-
lints: lint
24+
lint-docs: ## lint docs with mdformat and codespell
25+
python -m mdformat --check README.md docs/wiki/
26+
python -m codespell_lib README.md docs/wiki/
2627

27-
fix: ## fix python formatting with ruff
28+
fix-py: ## autoformat python code with ruff
2829
python -m ruff check --fix python_template
2930
python -m ruff format python_template
3031

31-
# alias
32+
fix-docs: ## autoformat docs with mdformat and codespell
33+
python -m mdformat README.md docs/wiki/
34+
python -m codespell_lib --write README.md docs/wiki/
35+
36+
lint: lint-py lint-docs ## run all linters
37+
lints: lint
38+
fix: fix-py fix-docs ## run all autoformatters
3239
format: fix
3340

3441
################

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ A pure-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/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` is written in Python. While prebuilt wheels are provided for end users, it is also straightforward to build `python-template` 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` 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` 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.git
36+
cd python-template
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` 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` 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/blob/main/LICENSE).
2+
3+
> [!NOTE]
4+
>
5+
> `python-template` 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/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/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`, 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` from a `git` clone, you will also need to
18+
configure `git` and your GitHub account for `python-template` 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`. To do so, click
25+
the "fork" button at https://github.com/python-project-templates/python-template, or just navigate
26+
[here](https://github.com/python-project-templates/python-template/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
@@ -32,7 +32,10 @@ develop = [
3232
"build",
3333
"bump-my-version",
3434
"check-manifest",
35+
"codespell>=2.4,<2.5",
3536
"hatchling",
37+
"mdformat>=0.7.22,<0.8",
38+
"mdformat-tables>=1",
3639
"pytest",
3740
"pytest-cov",
3841
"ruff",
@@ -51,6 +54,7 @@ Homepage = "https://github.com/python-project-templates/python-template"
5154
current_version = "0.1.0"
5255
commit = true
5356
tag = true
57+
commit_args = "-s"
5458

5559
[[tool.bumpversion.files]]
5660
filename = "python_template/__init__.py"

0 commit comments

Comments
 (0)