Skip to content

Commit 88cd603

Browse files
committed
chore: Template upgrade
1 parent fdeb16f commit 88cd603

4 files changed

Lines changed: 47 additions & 8 deletions

File tree

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 0.15.21
2+
_commit: 0.16.2
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: pawamoy@pm.me
55
author_fullname: Timothée Mazzucotelli

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ name: ci
22

33
on:
44
push:
5-
branches:
6-
- main
75
pull_request:
86
branches:
9-
- main
7+
- main
108

119
defaults:
1210
run:
@@ -78,11 +76,14 @@ jobs:
7876
- name: Checkout
7977
uses: actions/checkout@v3
8078

79+
- name: Fetch all tags
80+
run: git fetch --depth=1 --tags
81+
8182
- name: Set up PDM
8283
uses: pdm-project/setup-pdm@v3
8384
with:
8485
python-version: ${{ matrix.python-version }}
85-
prerelease: true
86+
allow-python-prereleases: true
8687

8788
- name: Resolving dependencies
8889
run: pdm lock -v --no-cross-platform -G ci-tests

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: release
2+
3+
on: push
4+
permissions:
5+
contents: write
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
if: startsWith(github.ref, 'refs/tags/')
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- name: Fetch all tags
15+
run: git fetch --depth=1 --tags
16+
- name: Setup Python
17+
uses: actions/setup-python@v4
18+
- name: Install git-changelog
19+
run: pip install git-changelog
20+
- name: Prepare release notes
21+
run: git-changelog --release-notes > release-notes.md
22+
- name: Create release
23+
uses: softprops/action-gh-release@v1
24+
with:
25+
body_path: release-notes.md

duties.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def check_quality(ctx: Context) -> None:
103103
ctx.run(
104104
ruff.check(*PY_SRC_LIST, config="config/ruff.toml"),
105105
title=pyprefix("Checking code quality"),
106+
command=f"ruff check --config config/ruff.toml {PY_SRC}",
106107
)
107108

108109

@@ -120,7 +121,11 @@ def check_dependencies(ctx: Context) -> None:
120121
allow_overrides=False,
121122
)
122123

123-
ctx.run(safety.check(requirements), title="Checking dependencies")
124+
ctx.run(
125+
safety.check(requirements),
126+
title="Checking dependencies",
127+
command="pdm export -f requirements --without-hashes | safety check --stdin",
128+
)
124129

125130

126131
@duty
@@ -132,7 +137,12 @@ def check_docs(ctx: Context) -> None:
132137
"""
133138
Path("htmlcov").mkdir(parents=True, exist_ok=True)
134139
Path("htmlcov/index.html").touch(exist_ok=True)
135-
ctx.run(mkdocs.build(strict=True, config_file=mkdocs_config()), title=pyprefix("Building documentation"))
140+
config = mkdocs_config()
141+
ctx.run(
142+
mkdocs.build(strict=True, config_file=config, verbose=True),
143+
title=pyprefix("Building documentation"),
144+
command=f"mkdocs build -vsf {config}",
145+
)
136146

137147

138148
@duty
@@ -145,6 +155,7 @@ def check_types(ctx: Context) -> None:
145155
ctx.run(
146156
mypy.run(*PY_SRC_LIST, config_file="config/mypy.ini"),
147157
title=pyprefix("Type-checking"),
158+
command=f"mypy --config-file config/mypy.ini {PY_SRC}",
148159
)
149160

150161

@@ -159,8 +170,9 @@ def check_api(ctx: Context) -> None:
159170

160171
griffe_check = lazy(g_check, name="griffe.check")
161172
ctx.run(
162-
griffe_check("griffe", search_paths=["src"]),
173+
griffe_check("griffe", search_paths=["src"], color=True),
163174
title="Checking for API breaking changes",
175+
command="griffe check -ssrc griffe",
164176
nofail=True,
165177
)
166178

@@ -276,6 +288,7 @@ def test(ctx: Context, match: str = "") -> None:
276288
ctx.run(
277289
pytest.run("-n", "auto", "tests", config_file="config/pytest.ini", select=match, color="yes", verbosity=10),
278290
title=pyprefix("Running tests"),
291+
command=f"pytest -c config/pytest.ini -n auto -k{match!r} --color=yes tests",
279292
)
280293

281294

0 commit comments

Comments
 (0)