Skip to content

Commit

Permalink
chore: Template upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Mar 20, 2024
1 parent cf7cdd2 commit a2faa4f
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Changes here will be overwritten by Copier
_commit: 1.1.3
_commit: 1.2.6
_src_path: gh:pawamoy/copier-pdm
author_email: pawamoy@pm.me
author_email: dev@pawamoy.fr
author_fullname: Timothée Mazzucotelli
author_username: pawamoy
copyright_date: '2023'
copyright_holder: Timothée Mazzucotelli
copyright_holder_email: pawamoy@pm.me
copyright_holder_email: dev@pawamoy.fr
copyright_license: ISC License
insiders: false
project_description: Griffe extension for inheriting docstrings.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- name: Set up PDM
uses: pdm-project/setup-pdm@v3
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.8"

Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up PDM
uses: pdm-project/setup-pdm@v3
uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Fetch all tags
run: git fetch --depth=1 --tags
- name: Setup Python
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
.vscode/
__pycache__/
*.py[cod]
dist/
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
pawamoy@pm.me.
dev@pawamoy.fr.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
SHELL := bash
DUTY := $(if $(VIRTUAL_ENV),,pdm run) duty
export PDM_MULTIRUN_VERSIONS ?= 3.8 3.9 3.10 3.11 3.12
export PDM_MULTIRUN_USE_VENVS ?= $(if $(shell pdm config python.use_venv | grep True),1,0)

args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
check_quality_args = files
Expand Down
6 changes: 5 additions & 1 deletion config/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
target-version = "py38"
line-length = 132
line-length = 120
exclude = [
"fixtures",
"site",
Expand Down Expand Up @@ -102,3 +102,7 @@ known-first-party = ["griffe_inherited_docstrings"]

[pydocstyle]
convention = "google"

[format]
docstring-code-format = true
docstring-code-line-length = 80
4 changes: 2 additions & 2 deletions config/vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"configurations": [
{
"name": "python (current file)",
"type": "python",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "test",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"justMyCode": false,
Expand Down
4 changes: 2 additions & 2 deletions duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import TYPE_CHECKING, Iterator

from duty import duty
from duty.callables import black, coverage, lazy, mkdocs, mypy, pytest, ruff, safety
from duty.callables import coverage, lazy, mkdocs, mypy, pytest, ruff, safety

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


@duty(post=["docs-deploy"])
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "pdm.backend"
[project]
name = "griffe-inherited-docstrings"
description = "Griffe extension for inheriting docstrings."
authors = [{name = "Timothée Mazzucotelli", email = "pawamoy@pm.me"}]
authors = [{name = "Timothée Mazzucotelli", email = "dev@pawamoy.fr"}]
license = {text = "ISC"}
readme = "README.md"
requires-python = ">=3.8"
Expand Down
5 changes: 3 additions & 2 deletions scripts/gen_ref_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
nav = mkdocs_gen_files.Nav()
mod_symbol = '<code class="doc-symbol doc-symbol-nav doc-symbol-module"></code>'

src = Path(__file__).parent.parent / "src"
root = Path(__file__).parent.parent
src = root / "src"

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

mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path)
mkdocs_gen_files.set_edit_path(full_doc_path, ".." / path.relative_to(root))

with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())
7 changes: 7 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ if ! pdm self list 2>/dev/null | grep -q pdm-multirun; then
fi

if [ -n "${PDM_MULTIRUN_VERSIONS}" ]; then
if [ "${PDM_MULTIRUN_USE_VENVS}" -eq "1" ]; then
for version in ${PDM_MULTIRUN_VERSIONS}; do
if ! pdm venv --path "${version}" &>/dev/null; then
pdm venv create --name "${version}" "${version}"
fi
done
fi
pdm multirun -v pdm install -G:all
else
pdm install -G:all
Expand Down

0 comments on commit a2faa4f

Please sign in to comment.