Skip to content

Commit 49c3d9d

Browse files
author
dummy
committed
chore: Template upgrade
1 parent f191ed7 commit 49c3d9d

12 files changed

+31
-17
lines changed

.copier-answers.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 1.1.3
2+
_commit: 1.2.6
33
_src_path: gh:pawamoy/copier-pdm
4-
author_email: [email protected]
4+
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli
66
author_username: pawamoy
77
copyright_date: '2020'
88
copyright_holder: Timothée Mazzucotelli
9-
copyright_holder_email: [email protected]
9+
copyright_holder_email: [email protected]
1010
copyright_license: ISC License
1111
insiders: false
1212
project_description: Automatic Changelog generator using Jinja2 templates.

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323

2424
steps:
2525
- name: Checkout
26-
uses: actions/checkout@v3
26+
uses: actions/checkout@v4
2727

2828
- name: Fetch all tags
2929
run: git fetch --depth=1 --tags
3030

3131
- name: Set up PDM
32-
uses: pdm-project/setup-pdm@main
32+
uses: pdm-project/setup-pdm@v4
3333
with:
3434
python-version: "3.8"
3535

@@ -74,10 +74,10 @@ jobs:
7474

7575
steps:
7676
- name: Checkout
77-
uses: actions/checkout@v3
77+
uses: actions/checkout@v4
7878

7979
- name: Set up PDM
80-
uses: pdm-project/setup-pdm@v3
80+
uses: pdm-project/setup-pdm@v4
8181
with:
8282
python-version: ${{ matrix.python-version }}
8383
allow-python-prereleases: true

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
if: startsWith(github.ref, 'refs/tags/')
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
- name: Fetch all tags
1515
run: git fetch --depth=1 --tags
1616
- name: Setup Python

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/
2+
.vscode/
23
__pycache__/
34
*.py[cod]
45
dist/

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
63+
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
SHELL := bash
33
DUTY := $(if $(VIRTUAL_ENV),,pdm run) duty
44
export PDM_MULTIRUN_VERSIONS ?= 3.8 3.9 3.10 3.11 3.12
5+
export PDM_MULTIRUN_USE_VENVS ?= $(if $(shell pdm config python.use_venv | grep True),1,0)
56

67
args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
78
check_quality_args = files

config/ruff.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
target-version = "py38"
2-
line-length = 132
2+
line-length = 120
33
exclude = [
44
"fixtures",
55
"site",
@@ -103,3 +103,7 @@ known-first-party = ["git_changelog"]
103103

104104
[pydocstyle]
105105
convention = "google"
106+
107+
[format]
108+
docstring-code-format = true
109+
docstring-code-line-length = 80

config/vscode/launch.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"configurations": [
44
{
55
"name": "python (current file)",
6-
"type": "python",
6+
"type": "debugpy",
77
"request": "launch",
88
"program": "${file}",
99
"console": "integratedTerminal",
1010
"justMyCode": false
1111
},
1212
{
1313
"name": "test",
14-
"type": "python",
14+
"type": "debugpy",
1515
"request": "launch",
1616
"module": "pytest",
1717
"justMyCode": false,

duties.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import TYPE_CHECKING, Iterator
1111

1212
from duty import duty
13-
from duty.callables import black, coverage, lazy, mkdocs, mypy, pytest, ruff, safety
13+
from duty.callables import coverage, lazy, mkdocs, mypy, pytest, ruff, safety
1414

1515
if TYPE_CHECKING:
1616
from duty.context import Context
@@ -211,7 +211,7 @@ def format(ctx: Context) -> None:
211211
ruff.check(*PY_SRC_LIST, config="config/ruff.toml", fix_only=True, exit_zero=True),
212212
title="Auto-fixing code",
213213
)
214-
ctx.run(black.run(*PY_SRC_LIST, config="config/black.toml"), title="Formatting code")
214+
ctx.run(ruff.format(*PY_SRC_LIST, config="config/ruff.toml"), title="Formatting code")
215215

216216

217217
@duty(post=["docs-deploy"])

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "pdm.backend"
55
[project]
66
name = "git-changelog"
77
description = "Automatic Changelog generator using Jinja2 templates."
8-
authors = [{name = "Timothée Mazzucotelli", email = "[email protected]"}]
8+
authors = [{name = "Timothée Mazzucotelli", email = "[email protected]"}]
99
license = {text = "ISC"}
1010
readme = "README.md"
1111
requires-python = ">=3.8"

scripts/gen_ref_nav.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
nav = mkdocs_gen_files.Nav()
88
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'
99

10-
src = Path(__file__).parent.parent / "src"
10+
root = Path(__file__).parent.parent
11+
src = root / "src"
1112

1213
for path in sorted(src.rglob("*.py")):
1314
module_path = path.relative_to(src).with_suffix("")
@@ -30,7 +31,7 @@
3031
ident = ".".join(parts)
3132
fd.write(f"::: {ident}")
3233

33-
mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path)
34+
mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path.relative_to(root))
3435

3536
with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
3637
nav_file.writelines(nav.build_literate_nav())

scripts/setup.sh

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ if ! pdm self list 2>/dev/null | grep -q pdm-multirun; then
1212
fi
1313

1414
if [ -n "${PDM_MULTIRUN_VERSIONS}" ]; then
15+
if [ "${PDM_MULTIRUN_USE_VENVS}" -eq "1" ]; then
16+
for version in ${PDM_MULTIRUN_VERSIONS}; do
17+
if ! pdm venv --path "${version}" &>/dev/null; then
18+
pdm venv create --name "${version}" "${version}"
19+
fi
20+
done
21+
fi
1522
pdm multirun -v pdm install -G:all
1623
else
1724
pdm install -G:all

0 commit comments

Comments
 (0)