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
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: 0.1.3
_commit: v0.1.4
_src_path: .
copyright_holder: Stephen Kent
copyright_holder_email: smkent@smkent.net
Expand Down
34 changes: 10 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
# Contributing to copier-python

## Development setup
**Contributions are welcome!**

### Prerequisites
Thank you for your time and interest in improving
**copier-python**!

- [Astral's **uv** Python project manager][uv]
- [`poethepoet`][poe] task runner: `uv tool install poethepoet`
## Contribution resources

### Project setup

```sh
git clone https://github.com/smkent/copier-python
cd copier-python
uv run poe setup # Enables git hooks
```

## Common tasks

| Command | Description |
|---|---|
| `poe docs` | Run documentation server locally |
| `poe lint` | Run all formatters and static checks |
| `poe lt` | Run all formatters, static checks and tests (`lint` and `test`) |
| `poe snapup` | Update test snapshots |
| `poe test` | Run tests |

[poe]: https://poethepoet.naln1.net/
[uv]: https://docs.astral.sh/uv/
* **Web site**: **<https://smkent.github.io/copier-python>**
for general project information, usage, and development documentation
* **Repository**: <https://github.com/smkent/copier-python>
for submitting pull requests
* **Issue tracker**: <https://github.com/smkent/copier-python/issues>
for questions or bug reports
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ This template was inspired by [pawamoy/copier-uv][copier-uv] and
[copier-update]: https://copier.readthedocs.io/en/stable/updating/
[copier-uv]: https://pawamoy.github.io/copier-uv/
[copier]: https://copier.readthedocs.io
[docs-usage]: https://smkent.github.io/copier-python/prerequisites/
[docs-usage]: https://smkent.github.io/copier-python/requirements/
[ghcr-docs]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
[github-actions]: https://github.com/features/actions
[github-pages]: https://pages.github.com
Expand Down
8 changes: 6 additions & 2 deletions copier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ _message_after_copy: |
{%- if project_visibility == 'public' %}

For GitHub repository configuration and additional features setup,
either see MAINTAINING.md, or run the documentation site locally:
see copier-python's Completing Setup documentation at
https://smkent.github.io/copier-python/project-setup/
{%- if enable_docs %}
OR run the documentation site locally:

uv run poe docs

Then, see First Time Setup at: http://localhost:8000/{{ project_name }}/maintaining/
Then, see One Time Setup at: http://localhost:8000/{{ project_name }}/setup/
{%- endif %}
{%- endif %}

_message_after_update: |
Expand Down
1 change: 1 addition & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: Contributing
icon: lucide/code
---

Expand Down
8 changes: 3 additions & 5 deletions docs/prerequisites.md → docs/development/requirements.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
title: Required software
icon: lucide/bookmark-check
---

# Prerequisites
# Required software

- [x] A [supported version][python-versions] of [**Python**][python]
- [x] [**git** for verson control][git]
- [x] [Astral's **uv** Python project manager][uv]: `pip install uv` or
[other supported method][uv-installation]
- [x] [**Copier**][copier]: `uv tool install copier`

## Optional, but recommended

- [x] [Poe the Poet][poethepoet]: `uv tool install poethepoet`
- [x] [Poe the Poet][poethepoet] (recommended): `uv tool install poethepoet`

This provides `poe` without the `uv run` prefix,
e.g. `poe test` instead of `uv run poe test`
Expand Down
33 changes: 33 additions & 0 deletions docs/development/updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Template updates
icon: lucide/git-merge
---

# Applying copier-python template updates

Copier can update your project with template changes that have occurred since
the project was created.

To apply updates, simply run in your project directory:

```sh
copier update
```

This will repeat the setup prompts, in case any prompts have been added or
changed.

!!! tip
To change template-provided features in your project, simply change your
answers in the update prompts.

To apply updates without being prompted (reusing all previous answers), run:

```sh
copier update -l
```

When `copier update` is finished, view changes with `git status` and `git diff`.
Resolve any conflicts, and then commit the result.

[copier-update]: https://copier.readthedocs.io/en/stable/updating/
49 changes: 49 additions & 0 deletions docs/development/workflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Development workflow
icon: lucide/braces
---

# Project development workflow

## Cloning the repository

Run `poe setup` in new repository clones to enable git hooks:

```sh
git clone https://github.com/smkent/copier-python
cd copier-python
poe setup # Enables git hooks
```

## Development tools

* `poe lint`: Run formatters and static checks
* `poe test`: Run tests

The `lint` and `test` tasks can also be run as a single combined command with:

```sh
poe lt
```

### Test snapshots

Many copier-python tests compare template-rendered files with saved snapshots.
When templates are modified, the snapshots need to be updated. Update test
snapshots by running:

```sh
poe snapup
```

## Documentation server

Start the development server with:

```sh
poe docs
```

The documentation site will be served at **<http://localhost:8000>**.

To use a different bind host/port, run `poe --help docs` for arguments info.
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Overview
icon: lucide/book-open
hide:
- path
---

--8<-- "README.md"
1 change: 1 addition & 0 deletions docs/license.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: License
icon: lucide/scale
---

Expand Down
5 changes: 0 additions & 5 deletions docs/maintaining.md

This file was deleted.

1 change: 1 addition & 0 deletions docs/project-creation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: Creating a project
icon: lucide/wand-sparkles
---

Expand Down
31 changes: 18 additions & 13 deletions docs/project-development.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: Development workflow
icon: lucide/braces
---

Expand All @@ -11,24 +12,28 @@ Run `poe setup` in new repository clones to enable git hooks:
```sh
git clone https://github.com/<github_user>/<project_name>
cd project_name
uv run poe setup # Enables git hooks
poe setup # Enables git hooks
```

## Common tasks
## Development tools

| Command | Description |
|---|---|
| `poe docs` | Run documentation server locally |
| `poe lint` | Run all formatters and static checks |
| `poe lt` | Run all formatters, static checks and tests (`lint` and `test`) |
| `poe snapup` | Update test snapshots |
| `poe test` | Run tests |
* `poe lint`: Run formatters and static checks
* `poe test`: Run tests

## Creating a release
The `lint` and `test` tasks can also be run as a single combined command with:

Create and push a tag:
```sh
poe lt
```

## Documentation server

Start the development server with:

```sh
git tag vX.Y.Z
git push --tags
poe docs
```

The documentation site will be served at **<http://localhost:8000>**.

To use a different bind host/port, run `poe --help docs` for arguments info.
25 changes: 25 additions & 0 deletions docs/project-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Releasing a project
icon: lucide/rocket
---

# Releasing a project

Release version numbers should follow [Semantic Versioning][semver].

To create a new release, simply create and push a tag with the new release
version number:

```sh
git tag vX.Y.Z # for example, v1.2.3
git push --tags
```

* A corresponding GitHub release will be created automatically.
* If PyPI publishing is enabled, a release package will be built and uploaded to
PyPI.
* If container image build and publishing is enabled, a container image will be
built and published to the [GitHub Container Registry (GHCR)][ghcr-docs].

[ghcr-docs]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry
[semver]: https://semver.org/
12 changes: 6 additions & 6 deletions docs/project-features.md → docs/project-setup.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
---
title: Completing setup
icon: lucide/settings
---

# Preparing project features
# Completing project setup

!!! tip
These instructions are also present in your new project, with links directly
to your project's specific settings pages! To view these instructions in
your project:
If you selected **Enable documentation site** during project creation,
these instructions are also present in your new project along with links
directly to your project's specific settings pages! To view:

1. Start the local documentation server: `poe docs`
2. In your browser:

1. Open **<http://localhost:8000>**
2. Click the **Development** tab
3. Click **Maintaining** in the left nav bar
2. Navigate to **Project Operations** → **One time setup**


## GitHub repository
Expand Down
1 change: 1 addition & 0 deletions docs/project-updates.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
title: Template updates
icon: lucide/git-merge
---

Expand Down
35 changes: 35 additions & 0 deletions docs/releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Releasing a new version
icon: lucide/rocket
---

# Releasing a new version

Release version numbers should follow [Semantic Versioning][semver].

To create a new release, simply create and push a tag with the new release
version number:

```sh
git tag vX.Y.Z # for example, v1.2.3
git push --tags
```

* A corresponding [GitHub release][github-releases]
will be created automatically.

[![GitHub Release][github-release-badge]][github-release-latest]

* A release package will be built and [uploaded to PyPI][pypi-project].

[![PyPI][pypi-badge]][pypi-project]

* A container image will be built and published to
the [GitHub Container Registry (GHCR)][ghcr-project].

[ghcr-project]: https://github.com/smkent/copier-python/pkgs/container/copier-python
[github-release-latest]: https://github.com/smkent/copier-python/releases/latest
[github-releases]: https://github.com/smkent/copier-python/releases
[github-release-badge]: https://img.shields.io/github/v/release/smkent/copier-python
[pypi-badge]: https://img.shields.io/pypi/v/copier-python
[pypi-project]: https://pypi.org/project/copier-python/
24 changes: 24 additions & 0 deletions docs/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Required software
icon: lucide/bookmark-check
---

# Required software

- [x] A [supported version][python-versions] of [**Python**][python]
- [x] [**git** for verson control][git]
- [x] [Astral's **uv** Python project manager][uv]: `pip install uv` or
[other supported method][uv-installation]
- [x] [**Copier**][copier]: `uv tool install copier`
- [x] [Poe the Poet][poethepoet] (recommended): `uv tool install poethepoet`

This provides `poe` without the `uv run` prefix,
e.g. `poe test` instead of `uv run poe test`

[copier]: https://copier.readthedocs.io
[git]: https://git-scm.com
[poethepoet]: https://poethepoet.natn.io/
[python-versions]: https://devguide.python.org/versions/
[python]: https://python.org
[uv-installation]: https://docs.astral.sh/uv/getting-started/installation/
[uv]: https://docs.astral.sh/uv/
Loading
Loading