Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ SED = sed -i '' -e
endif


.PHONY: lint fix format test
lint: ## lint this repo
fix: ## fix formatting in this repo
format: fix
test: ## run tests for this repo

.PHONY: gen-python gen-cpp gen-js gen-jupyter gen-rust gen-rustjswasm
gen-python: ## regenerate the python template from scratch
mkdir -p ../python-template && cd ../python-template && rm -rf ./* && rm -rf .copier-answers.yaml .gitignore .github .gitattributes
Expand Down
6 changes: 3 additions & 3 deletions cpp/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ js/*.tgz
.ipynb_checkpoints
.autoversion
Untitled*.ipynb
{{module}}/extension
{{module}}/nbextension
{{module}}/labextension
{{ module }}/extension
{{ module }}/nbextension
{{ module }}/labextension

# Mac
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion cpp/LICENSE.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 {{team}}
Copyright 2025 {{ team }}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
12 changes: 6 additions & 6 deletions cpp/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ install: ## install python library
#########
.PHONY: lint-py lint-cpp lint-docs lint lints
lint-py: ## run python linter with ruff
python -m ruff check {{module}}
python -m ruff format --check {{module}}
python -m ruff check {{ module }}
python -m ruff format --check {{ module }}

lint-cpp: ## run cpp linter
clang-format --dry-run -Werror -i -style=file `find ./cpp -name "*.*pp"`
Expand All @@ -40,8 +40,8 @@ lints: lint

.PHONY: fix-py fix-cpp fix format
fix-py: ## fix python formatting with ruff
python -m ruff check --fix {{module}}
python -m ruff format {{module}}
python -m ruff check --fix {{ module }}
python -m ruff format {{ module }}

fix-cpp: ## fix cpp formatting
clang-format -i -style=file `find ./cpp -name "*.*pp"`
Expand Down Expand Up @@ -76,13 +76,13 @@ check: checks
#########
.PHONY: test-py tests-py coverage-py
test-py: ## run python tests
python -m pytest -v {{module}}/tests
python -m pytest -v {{ module }}/tests

# alias
tests-py: test-py

coverage-py: ## run python tests and collect test coverage
python -m pytest -v {{module}}/tests --cov={{module}} --cov-report term-missing --cov-report xml
python -m pytest -v {{ module }}/tests --cov={{ module }} --cov-report term-missing --cov-report xml

.PHONY: test coverage tests
test: test-py ## run all tests
Expand Down
12 changes: 6 additions & 6 deletions cpp/README.md.jinja
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# {{project_name}}
# {{ project_name }}

{{project_description}}
{{ project_description }}

[![Build Status](https://github.com/{{github}}/{{project_name_formatted}}/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/{{github}}/{{project_name_formatted}}/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/{{github}}/{{project_name_formatted}}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{github}}/{{project_name_formatted}})
[![License](https://img.shields.io/github/license/{{github}}/{{project_name_formatted}})](https://github.com/{{github}}/{{project_name_formatted}})
[![PyPI](https://img.shields.io/pypi/v/{{project_name_formatted}}.svg)](https://pypi.python.org/pypi/{{project_name_formatted}})
[![Build Status](https://github.com/{{ github }}/{{ project_name_formatted }}/actions/workflows/build.yaml/badge.svg?branch=main&event=push)](https://github.com/{{ github }}/{{ project_name_formatted }}/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/{{ github }}/{{ project_name_formatted }}/branch/main/graph/badge.svg)](https://codecov.io/gh/{{ github }}/{{ project_name_formatted }})
[![License](https://img.shields.io/github/license/{{ github }}/{{ project_name_formatted }})](https://github.com/{{ github }}/{{ project_name_formatted }})
[![PyPI](https://img.shields.io/pypi/v/{{ project_name_formatted }}.svg)](https://pypi.python.org/pypi/{{ project_name_formatted }})

## Overview

Expand Down
2 changes: 1 addition & 1 deletion cpp/cpp/{{project_name_formatted}}/extension.cpp.jinja
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "{{project_name_formatted}}/extension.hpp"
#include "{{ project_name_formatted }}/extension.hpp"

int add(int i, int j) { return i + j; }
30 changes: 15 additions & 15 deletions cpp/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ requires = [
build-backend = "hatchling.build"

[project]
name = "{{project_name_formatted}}"
name = "{{ project_name_formatted }}"
authors = [
{name = "{{team}}", email = "{{email}}"},
{name = "{{ team }}", email = "{{ email }}"},
]
description = "{{project_description}}"
description = "{{ project_description }}"
readme = "README.md"
license = { text = "Apache-2.0" }
version = "0.1.0"
Expand Down Expand Up @@ -57,8 +57,8 @@ develop = [
[project.scripts]

[project.urls]
Repository = "https://github.com/{{github}}/{{project_name_formatted}}"
Homepage = "https://github.com/{{github}}/{{project_name_formatted}}"
Repository = "https://github.com/{{ github }}/{{ project_name_formatted }}"
Homepage = "https://github.com/{{ github }}/{{ project_name_formatted }}"

[tool.bumpversion]
current_version = "0.1.0"
Expand All @@ -67,7 +67,7 @@ tag = true
commit_args = "-s"

[[tool.bumpversion.files]]
filename = "{{module}}/__init__.py"
filename = "{{ module }}/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'

Expand Down Expand Up @@ -96,7 +96,7 @@ skip = "*win32 *arm_64"
[tool.coverage.run]
branch = true
omit = [
"{{module}}/tests/integration/",
"{{ module }}/tests/integration/",
]

[tool.coverage.report]
Expand All @@ -110,9 +110,9 @@ fail_under = 50

[tool.hatch.build]
artifacts = [
"{{module}}/*.dll",
"{{module}}/*.dylib",
"{{module}}/*.so",
"{{ module }}/*.dll",
"{{ module }}/*.dylib",
"{{ module }}/*.so",
]

[tool.hatch.build.sources]
Expand All @@ -121,26 +121,26 @@ src = "/"
[tool.hatch.build.hooks.hatch-cpp]
verbose = true
libraries = [
{name = "{{module}}/extension", sources = ["cpp/{{project_name_formatted}}/extension.cpp"], include-dirs = ["cpp"], binding="pybind11"}
{name = "{{ module }}/extension", sources = ["cpp/{{ project_name_formatted }}/extension.cpp"], include-dirs = ["cpp"], binding="pybind11"}
]

[tool.hatch.build.targets.sdist]
packages = [
"{{module}}",
"{{ module }}",
"cpp",
]

[tool.hatch.build.targets.wheel]
packages = [
"{{module}}",
"{{ module }}",
]

[tool.pytest.ini_options]
addopts = [
"-vvv",
"--junitxml=junit.xml",
]
testpaths = "{{module}}/tests"
testpaths = "{{ module }}/tests"

[tool.ruff]
line-length = 150
Expand All @@ -154,7 +154,7 @@ extend-select = [
combine-as-imports = true
default-section = "third-party"
known-first-party = [
"{{module}}",
"{{ module }}",
]
section-order = [
"future",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
## Pre-requisites

You need Python >=3.10 on your machine to install `{{project_name_formatted}}`.
You need Python >=3.10 on your machine to install `{{ project_name_formatted }}`.

## Install with `pip`

```bash
pip install {{project_name_formatted}}
pip install {{ project_name_formatted }}
```

## Install with `conda`

```bash
conda install {{project_name_formatted}} --channel conda-forge
conda install {{ project_name_formatted }} --channel conda-forge
```

## Source installation

For other platforms and for development installations, [build `{{project_name_formatted}}` from source](Build-from-Source).
For other platforms and for development installations, [build `{{ project_name_formatted }}` from source](Build-from-Source).
2 changes: 1 addition & 1 deletion cpp/{% if add_wiki %}docs{% endif %}/wiki/_Footer.md.jinja
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_This wiki is autogenerated. To made updates, open a PR against the original source file in [`docs/wiki`](https://github.com/{{github}}/{{project_name_formatted}}/tree/main/docs/wiki)._
_This wiki is autogenerated. To made updates, open a PR against the original source file in [`docs/wiki`](https://github.com/{{ github }}/{{ project_name_formatted }}/tree/main/docs/wiki)._
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`{{project_name_formatted}}` is written in Python. While prebuilt wheels are provided for end users, it is also straightforward to build `{{project_name_formatted}}` from either the Python [source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/) or the GitHub repository.
`{{ project_name_formatted }}` is written in Python. While prebuilt wheels are provided for end users, it is also straightforward to build `{{ project_name_formatted }}` from either the Python [source distribution](https://packaging.python.org/en/latest/specifications/source-distribution-format/) or the GitHub repository.

- [Make commands](#make-commands)
- [Prerequisites](#prerequisites)
Expand All @@ -10,7 +10,7 @@

## Make commands

As a convenience, `{{project_name_formatted}}` uses a `Makefile` for commonly used commands. You can print the main available commands by running `make` with no arguments
As a convenience, `{{ project_name_formatted }}` uses a `Makefile` for commonly used commands. You can print the main available commands by running `make` with no arguments

```bash
> make
Expand All @@ -25,15 +25,15 @@ test run the tests

## Prerequisites

`{{project_name_formatted}}` 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.
`{{ project_name_formatted }}` 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.

## Clone

Clone the repo with:

```bash
git clone https://github.com/{{github}}/{{project_name_formatted}}.git
cd {{project_name_formatted}}
git clone https://github.com/{{ github }}/{{ project_name_formatted }}.git
cd {{ project_name_formatted }}
```

## Install Python dependencies
Expand All @@ -56,7 +56,7 @@ make build

## Lint and Autoformat

`{{project_name_formatted}}` has linting and auto formatting.
`{{ project_name_formatted }}` has linting and auto formatting.

| Language | Linter | Autoformatter | Description |
| :------- | :---------- | :------------ | :---------- |
Expand Down Expand Up @@ -90,7 +90,7 @@ make fix-docs

## Testing

`{{project_name_formatted}}` has extensive Python tests. The tests can be run via `pytest`. First, install the Python development dependencies with
`{{ project_name_formatted }}` has extensive Python tests. The tests can be run via `pytest`. First, install the Python development dependencies with

```bash
make develop
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Contributions are welcome on this project. We distribute under the terms of the [Apache 2.0 license](https://github.com/{{github}}/{{project_name_formatted}}/blob/main/LICENSE).
Contributions are welcome on this project. We distribute under the terms of the [Apache 2.0 license](https://github.com/{{ github }}/{{ project_name_formatted }}/blob/main/LICENSE).

> [!NOTE]
>
> `{{project_name_formatted}}` requires [Developer Certificate of Origin](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin) for all contributions.
> `{{ project_name_formatted }}` requires [Developer Certificate of Origin](https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin) for all contributions.
> This is enforced by a [Probot GitHub App](https://probot.github.io/apps/dco/), which checks that commits are "signed".
> Read [instructions to configure commit signing](Local-Development-Setup#configure-commit-signing).

For **bug reports** or **small feature requests**, please open an issue on our [issues page](https://github.com/{{github}}/{{project_name_formatted}}/issues).
For **bug reports** or **small feature requests**, please open an issue on our [issues page](https://github.com/{{ github }}/{{ project_name_formatted }}/issues).

For **questions** or to discuss **larger changes or features**, please use our [discussions page](https://github.com/{{github}}/{{project_name_formatted}}/discussions).
For **questions** or to discuss **larger changes or features**, please use our [discussions page](https://github.com/{{ github }}/{{ project_name_formatted }}/discussions).

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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@

## Step 1: Build from Source

To work on `{{project_name_formatted}}`, you are going to need to build it from source. See
To work on `{{ project_name_formatted }}`, you are going to need to build it from source. See
[Build from Source](Build-from-Source) for
detailed build instructions.

Once you've built `{{project_name_formatted}}` from a `git` clone, you will also need to
configure `git` and your GitHub account for `{{project_name_formatted}}` development.
Once you've built `{{ project_name_formatted }}` from a `git` clone, you will also need to
configure `git` and your GitHub account for `{{ project_name_formatted }}` development.

## Step 2: Configuring Git and GitHub for Development

### Create your fork

The first step is to create a personal fork of `{{project_name_formatted}}`. To do so, click
the "fork" button at https://github.com/{{github}}/{{project_name_formatted}}, or just navigate
[here](https://github.com/{{github}}/{{project_name_formatted}}/fork) in your browser. Set the
The first step is to create a personal fork of `{{ project_name_formatted }}`. To do so, click
the "fork" button at https://github.com/{{ github }}/{{ project_name_formatted }}, or just navigate
[here](https://github.com/{{ github }}/{{ project_name_formatted }}/fork) in your browser. Set the
owner of the repository to your personal GitHub account if it is not
already set that way and click "Create fork".

### Configure remotes

Next, you should set some names for the `git` remotes corresponding to
main {{github}} 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.
main {{ github }} 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.

### Authenticating with GitHub

Expand Down
2 changes: 1 addition & 1 deletion cpp/{{module}}/tests/test_all.py.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from {{module}} import add
from {{ module }} import add


class TestAll:
Expand Down
2 changes: 1 addition & 1 deletion cppjswasm/.github/CODE_OF_CONDUCT.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at {{email}}. All
reported by contacting the project team at {{ email }}. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
4 changes: 2 additions & 2 deletions cppjswasm/.github/workflows/build.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["{{python_version_primary}}"]
python-version: ["{{ python_version_primary }}"]
cibuildwheel: ["cp{{python_version_primary.replace('.', '')}}"]
node-version: [20.x]

Expand All @@ -45,7 +45,7 @@ jobs:
with:
version: 22.x

- uses: mymindstorm/setup-emsdk@v14
- uses: mymindstorm/setup-emsdk@v16

- name: Install dependencies
run: make develop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v6
- uses: actions-ext/python/setup@main
- uses: actions-ext/node/setup@main
- uses: mymindstorm/setup-emsdk@v14
- uses: mymindstorm/setup-emsdk@v16
- run: make develop
- run: uv pip install .
- run: uv pip install yardang
Expand Down
6 changes: 3 additions & 3 deletions cppjswasm/.gitignore.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ js/*.tgz
.ipynb_checkpoints
.autoversion
Untitled*.ipynb
{{module}}/extension
{{module}}/nbextension
{{module}}/labextension
{{ module }}/extension
{{ module }}/nbextension
{{ module }}/labextension

# Mac
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion cppjswasm/LICENSE.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 {{team}}
Copyright 2025 {{ team }}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Loading
Loading