Skip to content

Commit c210c72

Browse files
authored
Merge pull request #42 from python-project-templates/copier-update-2025-07-29T22-53-42
Update from copier (2025-07-29T22:53:42)
2 parents c7d858b + b143f86 commit c210c72

File tree

11 files changed

+266
-6
lines changed

11 files changed

+266
-6
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: js
6+
add_wiki: true
77
88
github: python-project-templates
99
project_description: A JavaScript-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

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"eslint.workingDirectories": ["./js"]
3+
}

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,28 @@ lint-py: ## run python linter with ruff
3434
lint-js: ## run js linter
3535
cd js; pnpm lint
3636

37-
lint: lint-js lint-py ## run project linters
37+
lint-docs: ## lint docs with mdformat and codespell
38+
python -m mdformat --check README.md docs/wiki/
39+
python -m codespell_lib README.md docs/wiki/
40+
41+
lint: lint-js lint-py lint-docs ## run project linters
3842

3943
# alias
4044
lints: lint
4145

42-
.PHONY: fix-py fix-js fix format
46+
.PHONY: fix-py fix-js fix-docs fix format
4347
fix-py: ## fix python formatting with ruff
4448
python -m ruff check --fix python_template_js
4549
python -m ruff format python_template_js
4650

4751
fix-js: ## fix js formatting
4852
cd js; pnpm fix
4953

50-
fix: fix-js fix-py ## run project autoformatters
54+
fix-docs: ## autoformat docs with mdformat and codespell
55+
python -m mdformat README.md docs/wiki/
56+
python -m codespell_lib --write README.md docs/wiki/
57+
58+
fix: fix-js fix-py fix-docs ## run project autoformatters
5159

5260
# alias
5361
format: fix

README.md

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

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-js/blob/main/LICENSE).
2+
3+
> [!NOTE]
4+
>
5+
> `python-template-js` 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-js/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-js/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-js`, 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-js` from a `git` clone, you will also need to
18+
configure `git` and your GitHub account for `python-template-js` 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-js`. To do so, click
25+
the "fork" button at https://github.com/python-project-templates/python-template-js, or just navigate
26+
[here](https://github.com/python-project-templates/python-template-js/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.

0 commit comments

Comments
 (0)