Skip to content

Commit 2ae173b

Browse files
Modernize plugin template (#14)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v6.0.0](pre-commit/pre-commit-hooks@v4.4.0...v6.0.0) - https://github.com/asottile/reorder_python_importshttps://github.com/asottile/reorder-python-imports - [github.com/asottile/reorder-python-imports: v3.9.0 → v3.16.0](asottile/reorder-python-imports@v3.9.0...v3.16.0) - [github.com/asottile/setup-cfg-fmt: v2.2.0 → v3.2.0](asottile/setup-cfg-fmt@v2.2.0...v3.2.0) - https://github.com/psf/blackhttps://github.com/psf/black-pre-commit-mirror - [github.com/psf/black-pre-commit-mirror: 23.1.0 → 26.1.0](psf/black-pre-commit-mirror@23.1.0...26.1.0) - https://github.com/charliermarsh/ruff-pre-commithttps://github.com/astral-sh/ruff-pre-commit - [github.com/astral-sh/ruff-pre-commit: v0.0.241 → v0.15.2](astral-sh/ruff-pre-commit@v0.0.241...v0.15.2) - [github.com/dosisod/refurb: v1.10.0 → v2.3.0](dosisod/refurb@v1.10.0...v2.3.0) - [github.com/econchick/interrogate: 1.5.0 → 1.7.0](econchick/interrogate@1.5.0...1.7.0) - [github.com/executablebooks/mdformat: 0.7.16 → 1.0.0](hukkin/mdformat@0.7.16...1.0.0) - [github.com/executablebooks/mdformat: 0.7.16 → 1.0.0](hukkin/mdformat@0.7.16...1.0.0) - [github.com/codespell-project/codespell: v2.2.2 → v2.4.1](codespell-project/codespell@v2.2.2...v2.4.1) - [github.com/pre-commit/mirrors-mypy: v0.991 → v1.19.1](pre-commit/mirrors-mypy@v0.991...v1.19.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Modernize CI matrix and Miniconda setup * Use setup-miniconda v3 channel syntax * Unblock CI and pre-commit checks * Install pytest tooling directly in tox env * Pin cookiecutter conda environment python version * Add Python 3.13/3.14 CI support and fix docs build config * Modernize template tooling with uv, just, and merge queue CI * Fix RTD config schema for current build settings * Add required sphinx config key for Read the Docs * Switch pre-commit formatting to Ruff and align settings * Remove legacy conda scaffolding and switch docs bootstrap to uv * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add uv lockfile for reproducible tooling environments * Stabilize CI uv setup and unblock pre-commit --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tobias Raabe <tobias.raabe@quantilope.com>
1 parent 5119db0 commit 2ae173b

30 files changed

+2584
-481
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,55 @@ concurrency:
55
group: ${{ github.head_ref || github.run_id }}
66
cancel-in-progress: true
77

8-
env:
9-
CONDA_EXE: mamba
10-
118
on:
129
push:
1310
branches:
1411
- main
1512
pull_request:
1613
branches:
1714
- '*'
15+
merge_group:
1816

1917
jobs:
2018

19+
run-type-checking:
20+
21+
name: Run tests for type-checking
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: astral-sh/setup-uv@v7
27+
with:
28+
version: "0.9.9"
29+
enable-cache: true
30+
- name: Install just
31+
uses: extractions/setup-just@v3
32+
- run: just typing
33+
2134
run-tests:
2235

2336
name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
2437
runs-on: ${{ matrix.os }}
25-
env:
26-
CONDA_EXE: mamba
2738

2839
strategy:
2940
fail-fast: false
3041
matrix:
3142
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
32-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
43+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
3344

3445
steps:
35-
- uses: actions/checkout@v3
36-
- uses: conda-incubator/setup-miniconda@v2.2.0
46+
- uses: actions/checkout@v4
47+
- uses: astral-sh/setup-uv@v7
3748
with:
38-
auto-update-conda: false
49+
version: "0.9.9"
50+
enable-cache: true
3951
python-version: ${{ matrix.python-version }}
40-
channels: conda-forge,nodefaults
41-
miniforge-variant: Mambaforge
42-
43-
- name: Install core dependencies.
44-
shell: bash -l {0}
45-
run: mamba install -c conda-forge tox-conda coverage
46-
47-
- name: Run end-to-end tests.
48-
shell: bash -l {0}
49-
run: tox -e pytest -- tests -m end_to_end --cov=./ --cov-report=xml -n auto
50-
51-
- name: Upload coverage reports of end-to-end tests.
52-
if: runner.os == 'Linux' && matrix.python-version == '3.9'
53-
shell: bash -l {0}
54-
run: bash <(curl -s https://codecov.io/bash) -F end_to_end -c
52+
- name: Install just
53+
uses: extractions/setup-just@v3
54+
- name: Run end-to-end tests
55+
run: just test
56+
57+
- name: Upload coverage reports of tests.
58+
if: runner.os == 'Linux' && matrix.python-version == '3.11'
59+
uses: codecov/codecov-action@v5

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ pip-delete-this-directory.txt
3939

4040
# Unit test / coverage reports
4141
htmlcov/
42-
.tox/
4342
.nox/
4443
.coverage
4544
.coverage.*
@@ -135,7 +134,6 @@ coverage.*
135134
# Folders
136135
.idea
137136
.ipynb_checkpoints
138-
.tox
139137
.vscode
140138
_build
141139
__pycache__

.pre-commit-config.yaml

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exclude: |
55
66
repos:
77
- repo: https://github.com/pre-commit/pre-commit-hooks
8-
rev: v4.4.0
8+
rev: v6.0.0
99
hooks:
1010
- id: check-added-large-files
1111
args: ['--maxkb=25']
@@ -15,7 +15,6 @@ repos:
1515
- id: check-yaml
1616
exclude: |
1717
(?x)^(
18-
{{cookiecutter.package_name}}/environment.yml|
1918
{{cookiecutter.package_name}}/.pre-commit-config.yaml
2019
)$
2120
- id: debug-statements
@@ -34,76 +33,60 @@ repos:
3433
- id: python-no-log-warn
3534
- id: python-use-type-annotations
3635
- id: text-unicode-replacement-char
37-
- repo: https://github.com/asottile/reorder_python_imports
38-
rev: v3.9.0
39-
hooks:
40-
- id: reorder-python-imports
41-
args: [--py37-plus, --add-import, 'from __future__ import annotations']
4236
- repo: https://github.com/asottile/setup-cfg-fmt
43-
rev: v2.2.0
37+
rev: v3.2.0
4438
hooks:
4539
- id: setup-cfg-fmt
4640
exclude: |
4741
(?x)^(
4842
{{cookiecutter.package_name}}/setup.cfg
4943
)$
50-
- repo: https://github.com/psf/black
51-
rev: 23.1.0
52-
hooks:
53-
- id: black
54-
- repo: https://github.com/charliermarsh/ruff-pre-commit
55-
rev: v0.0.241
44+
- repo: https://github.com/astral-sh/ruff-pre-commit
45+
rev: v0.15.2
5646
hooks:
57-
- id: ruff
47+
- id: ruff
48+
args: [--fix, hooks, tests]
49+
pass_filenames: false
50+
- id: ruff-format
5851
args: [hooks, tests]
5952
pass_filenames: false
6053
- repo: https://github.com/dosisod/refurb
61-
rev: v1.10.0
54+
rev: v2.3.0
6255
hooks:
6356
- id: refurb
6457
args: [--ignore, FURB126]
6558
exclude: ({{cookiecutter.package_name}})
6659
- repo: https://github.com/econchick/interrogate
67-
rev: 1.5.0
60+
rev: 1.7.0
6861
hooks:
6962
- id: interrogate
7063
args: [-v, --fail-under=40]
7164
- repo: https://github.com/executablebooks/mdformat
72-
rev: 0.7.16
65+
rev: 1.0.0
7366
hooks:
7467
- id: mdformat
75-
additional_dependencies: [
76-
mdformat-gfm,
77-
mdformat-black,
78-
]
68+
additional_dependencies: [mdformat-gfm]
7969
args: [--wrap, "88"]
8070
files: (README\.md)
8171
exclude: |
8272
(?x)^(
8373
{{cookiecutter.package_name}}/README.md
8474
)$
8575
- repo: https://github.com/executablebooks/mdformat
86-
rev: 0.7.16
76+
rev: 1.0.0
8777
hooks:
8878
- id: mdformat
89-
additional_dependencies: [
90-
mdformat-myst,
91-
mdformat-black,
92-
]
79+
additional_dependencies: [mdformat-myst]
9380
args: [--wrap, "88"]
9481
files: (docs/.)
95-
# Exclude files with admonitions.
96-
# exclude: |
97-
# (?x)^(
98-
# path/to/file.py
99-
# )$
10082
- repo: https://github.com/codespell-project/codespell
101-
rev: v2.2.2
83+
rev: v2.4.1
10284
hooks:
10385
- id: codespell
10486
additional_dependencies: [tomli]
87+
exclude: (^|/)uv\.lock$
10588
- repo: https://github.com/pre-commit/mirrors-mypy
106-
rev: 'v0.991'
89+
rev: 'v1.19.1'
10790
hooks:
10891
- id: mypy
10992
args: [
@@ -115,4 +98,3 @@ repos:
11598
hooks:
11699
- id: check-hooks-apply
117100
- id: check-useless-excludes
118-
# - id: identity # Prints all files passed to pre-commits. Debugging.

.readthedocs.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
version: 2
22

33
build:
4-
image: latest
4+
os: ubuntu-24.04
5+
tools:
6+
python: "3.11"
7+
jobs:
8+
create_environment:
9+
- asdf plugin add uv
10+
- asdf install uv latest
11+
- asdf global uv latest
12+
- UV_NO_EDITABLE=1 UV_PROJECT_ENVIRONMENT=$READTHEDOCS_VIRTUALENV_PATH uv sync --group docs
13+
install:
14+
- "true"
515

6-
python:
7-
version: 3.8
8-
9-
conda:
10-
environment: docs/rtd_environment.yml
16+
sphinx:
17+
configuration: docs/source/conf.py
18+
fail_on_warning: false

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![image](https://img.shields.io/github/actions/workflow/status/pytask-dev/cookiecutter-pytask-plugin/main.yml?branch=main)](https://github.com/pytask-dev/cookiecutter-pytask-plugin/actions?query=branch%3Amain)
66
[![image](https://codecov.io/gh/pytask-dev/cookiecutter-pytask-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/pytask-dev/cookiecutter-pytask-plugin)
77
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pytask-dev/cookiecutter-pytask-plugin/main.svg)](https://results.pre-commit.ci/latest/github/pytask-dev/cookiecutter-pytask-plugin/main)
8-
[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
8+
[![code style: ruff](https://img.shields.io/badge/code%20style-ruff-261230.svg)](https://github.com/astral-sh/ruff)
99

1010
This repository contains a minimal cookiecutter template for a plugin for
1111
[pytask](https://github.com/pytask-dev/pytask) .
@@ -16,8 +16,6 @@ First, install cookiecutter.
1616

1717
```console
1818
$ pip install cookiecutter
19-
20-
$ conda install -c conda-forge cookiecutter
2119
```
2220

2321
Then, set up the template for the new plugin with

codecov.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ coverage:
2121
threshold: 1%
2222
flags:
2323
- end_to_end
24-
25-
ignore:
26-
- ".tox/**/*"

cookiecutter.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"github_username": "{{ cookiecutter.author.lower().replace(' ', '') }}",
77
"github_email": "{{ cookiecutter.email }}",
88
"python_version": "3.10",
9-
"add_tox": ["yes", "no"],
109
"add_github_actions": ["yes", "no"],
1110
"add_readthedocs": ["yes", "no"],
1211
"add_codecov": ["yes", "no"],
@@ -19,8 +18,6 @@
1918
"Not open source"
2019
],
2120
"make_initial_commit": ["no", "yes"],
22-
"conda_environment_name": "{{ cookiecutter.package_name }}",
23-
"create_conda_environment_at_finish": ["no", "yes"],
2421
"_copy_without_render": [
2522
".github/workflows/main.yml", ".github/workflows/publish-to-pypi.yml"
2623
],

docs/rtd_environment.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html
55
66
"""
7+
78
# -- Project information -----------------------------------------------------
89
from __future__ import annotations
910

environment.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)