Skip to content

Commit e76aa66

Browse files
authored
Merge pull request #53 from python-project-templates/copier-update-2025-07-29T22-54-16
Update from copier (2025-07-29T22:54:16)
2 parents 30d4fdc + 600c258 commit e76aa66

File tree

11 files changed

+277
-25
lines changed

11 files changed

+277
-25
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: rust
6+
add_wiki: true
77
88
github: python-project-templates
99
project_description: A Rust-Python project template

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383

8484
- name: Make dist
8585
run: |
86-
make dist-rust
86+
make dist-rs
8787
make dist-py-sdist
8888
make dist-py-wheel
8989
make dist-check

.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: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
#########
22
# BUILD #
33
#########
4-
.PHONY: develop-py develop-rust develop
4+
.PHONY: develop-py develop-rs develop
55
develop-py:
66
uv pip install -e .[develop]
77

8-
develop-rust:
8+
develop-rs:
99
make -C rust develop
1010

11-
develop: develop-rust develop-py ## setup project for development
11+
develop: develop-rs develop-py ## setup project for development
1212

13-
.PHONY: build-py build-rust build dev
13+
.PHONY: build-py build-rs build dev
1414
build-py:
1515
maturin build
1616

17-
build-rust:
17+
build-rs:
1818
make -C rust build
1919

2020
dev: build ## lightweight in-place build for iterative dev
2121
$(_CP_COMMAND)
2222

23-
build: build-rust build-py ## build the project
23+
build: build-rs build-py ## build the project
2424

2525
.PHONY: install
2626
install: ## install python library
@@ -36,28 +36,36 @@ endif
3636
#########
3737
# LINTS #
3838
#########
39-
.PHONY: lint-py lint-rust lint lints
39+
.PHONY: lint-py lint-rs lint-docs lint lints
4040
lint-py: ## run python linter with ruff
4141
python -m ruff check python_template_rust
4242
python -m ruff format --check python_template_rust
4343

44-
lint-rust: ## run rust linter
44+
lint-rs: ## run rust linter
4545
make -C rust lint
4646

47-
lint: lint-rust lint-py ## run project linters
47+
lint-docs: ## lint docs with mdformat and codespell
48+
python -m mdformat --check README.md docs/wiki/
49+
python -m codespell_lib README.md docs/wiki/
50+
51+
lint: lint-rs lint-py lint-docs ## run project linters
4852

4953
# alias
5054
lints: lint
5155

52-
.PHONY: fix-py fix-rust fix format
56+
.PHONY: fix-py fix-rs fix-docs fix format
5357
fix-py: ## fix python formatting with ruff
5458
python -m ruff check --fix python_template_rust
5559
python -m ruff format python_template_rust
5660

57-
fix-rust: ## fix rust formatting
61+
fix-rs: ## fix rust formatting
5862
make -C rust fix
5963

60-
fix: fix-rust fix-py ## run project autoformatters
64+
fix-docs: ## autoformat docs with mdformat and codespell
65+
python -m mdformat README.md docs/wiki/
66+
python -m codespell_lib --write README.md docs/wiki/
67+
68+
fix: fix-rs fix-py fix-docs ## run project autoformatters
6169

6270
# alias
6371
format: fix
@@ -88,19 +96,19 @@ tests-py: test-py
8896
coverage-py: ## run python tests and collect test coverage
8997
python -m pytest -v python_template_rust/tests --cov=python_template_rust --cov-report term-missing --cov-report xml
9098

91-
.PHONY: test-rust tests-rust coverage-rust
92-
test-rust: ## run rust tests
99+
.PHONY: test-rs tests-rs coverage-rs
100+
test-rs: ## run rust tests
93101
make -C rust test
94102

95103
# alias
96-
tests-rust: test-rust
104+
tests-rs: test-rs
97105

98-
coverage-rust: ## run rust tests and collect test coverage
106+
coverage-rs: ## run rust tests and collect test coverage
99107
make -C rust coverage
100108

101109
.PHONY: test coverage tests
102-
test: test-py test-rust ## run all tests
103-
coverage: coverage-py coverage-rust ## run all tests and collect test coverage
110+
test: test-py test-rs ## run all tests
111+
coverage: coverage-py coverage-rs ## run all tests and collect test coverage
104112

105113
# alias
106114
tests: test
@@ -125,21 +133,21 @@ major: ## bump a major version
125133
########
126134
# DIST #
127135
########
128-
.PHONY: dist-py-wheel dist-py-sdist dist-rust dist-check dist publish
136+
.PHONY: dist-py-wheel dist-py-sdist dist-rs dist-check dist publish
129137

130138
dist-py-wheel: # build python wheel
131139
python -m cibuildwheel --output-dir dist
132140

133141
dist-py-sdist: # build python sdist
134142
python -m build --sdist -o dist
135143

136-
dist-rust: # build rust dists
144+
dist-rs: # build rust dists
137145
make -C rust dist
138146

139147
dist-check: ## run python dist checker with twine
140148
python -m twine check dist/*
141149

142-
dist: clean build dist-rust dist-py-wheel dist-py-sdist dist-check ## build all dists
150+
dist: clean build dist-rs dist-py-wheel dist-py-sdist dist-check ## build all dists
143151

144152
publish: dist # publish python assets
145153

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ A Rust-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-rust/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: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
`python-template-rust` is written in Python and Rust. While prebuilt wheels are provided for end users, it is also straightforward to build `python-template-rust` 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-rust` 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-rust` 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-rust.git
36+
cd python-template-rust
37+
```
38+
39+
## Install Rust
40+
41+
Follow the instructions for [installing Rust](https://rustup.rs) for your system.
42+
43+
## Install Python dependencies
44+
45+
Python build and develop dependencies are specified in the `pyproject.toml`, but you can manually install them:
46+
47+
```bash
48+
make requirements
49+
```
50+
51+
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/).
52+
53+
## Build
54+
55+
Build the python project in the usual manner:
56+
57+
```bash
58+
make build
59+
```
60+
61+
## Lint and Autoformat
62+
63+
`python-template-rust` has linting and auto formatting.
64+
65+
| Language | Linter | Autoformatter | Description |
66+
| :------- | :---------- | :------------ | :---------- |
67+
| Python | `ruff` | `ruff` | Style |
68+
| Python | `ruff` | `ruff` | Imports |
69+
| Rust | `clippy` | `clippy` | Style |
70+
| Markdown | `mdformat` | `mdformat` | Style |
71+
| Markdown | `codespell` | | Spelling |
72+
73+
**Python Linting**
74+
75+
```bash
76+
make lint-py
77+
```
78+
79+
**Python Autoformatting**
80+
81+
```bash
82+
make fix-py
83+
```
84+
85+
**Rust Linting**
86+
87+
```bash
88+
make lint-rs
89+
```
90+
91+
**Rust Autoformatting**
92+
93+
```bash
94+
make fix-rs
95+
```
96+
97+
**Documentation Linting**
98+
99+
```bash
100+
make lint-docs
101+
```
102+
103+
**Documentation Autoformatting**
104+
105+
```bash
106+
make fix-docs
107+
```
108+
109+
## Testing
110+
111+
`python-template-rust` has both Python and JavaScript tests. The bulk of the functionality is tested in Python, which can be run via `pytest`. First, install the Python development dependencies with
112+
113+
```bash
114+
make develop
115+
```
116+
117+
**Python**
118+
119+
```bash
120+
make test-py
121+
```
122+
123+
**Rust**
124+
125+
```bash
126+
make test-rs
127+
```

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-rust/blob/main/LICENSE).
2+
3+
> [!NOTE]
4+
>
5+
> `python-template-rust` 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-rust/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-rust/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.

0 commit comments

Comments
 (0)