Skip to content

Commit 44be179

Browse files
committed
chore: Template upgrade
1 parent 4f7682e commit 44be179

File tree

14 files changed

+281
-230
lines changed

14 files changed

+281
-230
lines changed

.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: 1.4.1
2+
_commit: 1.5.7
33
_src_path: gh:pawamoy/copier-uv
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli

.github/workflows/ci.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,20 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
fetch-tags: true
2831

29-
- name: Fetch all tags
30-
run: git fetch --depth=1 --tags
31-
32-
- name: Set up Python
32+
- name: Setup Python
3333
uses: actions/setup-python@v5
3434
with:
35-
python-version: "3.11"
35+
python-version: "3.12"
3636

37-
- name: Install uv
38-
run: pip install uv
37+
- name: Setup uv
38+
uses: astral-sh/setup-uv@v3
39+
with:
40+
enable-cache: true
41+
cache-dependency-glob: pyproject.toml
3942

4043
- name: Install dependencies
4144
run: make setup
@@ -61,12 +64,12 @@ jobs:
6164
- macos-latest
6265
- windows-latest
6366
python-version:
64-
- "3.8"
6567
- "3.9"
6668
- "3.10"
6769
- "3.11"
6870
- "3.12"
6971
- "3.13"
72+
- "3.14"
7073
resolution:
7174
- highest
7275
- lowest-direct
@@ -76,22 +79,27 @@ jobs:
7679
- os: windows-latest
7780
resolution: lowest-direct
7881
runs-on: ${{ matrix.os }}
79-
continue-on-error: ${{ matrix.python-version == '3.13' }}
82+
continue-on-error: ${{ matrix.python-version == '3.14' }}
8083

8184
steps:
8285
- name: Checkout
8386
uses: actions/checkout@v4
87+
with:
88+
fetch-depth: 0
89+
fetch-tags: true
8490

85-
- name: Set up Python
91+
- name: Setup Python
8692
uses: actions/setup-python@v5
8793
with:
8894
python-version: ${{ matrix.python-version }}
8995
allow-prereleases: true
9096

9197
- name: Setup uv
92-
uses: astral-sh/setup-uv@v1
98+
uses: astral-sh/setup-uv@v3
9399
with:
94100
enable-cache: true
101+
cache-dependency-glob: pyproject.toml
102+
cache-suffix: py${{ matrix.python-version }}
95103

96104
- name: Install dependencies
97105
env:

.github/workflows/release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4
14-
- name: Fetch all tags
15-
run: git fetch --depth=1 --tags
14+
with:
15+
fetch-depth: 0
16+
fetch-tags: true
1617
- name: Setup Python
17-
uses: actions/setup-python@v4
18-
- name: Install git-changelog
19-
run: pip install git-changelog
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
- name: Setup uv
22+
uses: astral-sh/setup-uv@v3
2023
- name: Prepare release notes
21-
run: git-changelog --release-notes > release-notes.md
24+
run: uv tool run git-changelog --release-notes > release-notes.md
2225
- name: Create release
23-
uses: softprops/action-gh-release@v1
26+
uses: softprops/action-gh-release@v2
2427
with:
2528
body_path: release-notes.md

.gitpod.dockerfile

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

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ make setup
2323
> You can install it with:
2424
>
2525
> ```bash
26-
> python3 -m pip install --user pipx
27-
> pipx install uv
26+
> curl -LsSf https://astral.sh/uv/install.sh | sh
2827
> ```
2928
>
3029
> Now you can try running `make setup` again,
31-
> or simply `uv install`.
30+
> or simply `uv sync`.
3231
3332
You now have the dependencies installed.
3433

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,20 @@
33
[![ci](https://github.com/mkdocstrings/griffe2md/workflows/ci/badge.svg)](https://github.com/mkdocstrings/griffe2md/actions?query=workflow%3Aci)
44
[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://mkdocstrings.github.io/griffe2md/)
55
[![pypi version](https://img.shields.io/pypi/v/griffe2md.svg)](https://pypi.org/project/griffe2md/)
6-
[![gitpod](https://img.shields.io/badge/gitpod-workspace-708FCC.svg?style=flat)](https://gitpod.io/#https://github.com/mkdocstrings/griffe2md)
76
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#griffe2md:gitter.im)
87

98
Output API docs to Markdown using Griffe.
109

1110
## Installation
1211

13-
With `pip`:
14-
1512
```bash
1613
pip install griffe2md
1714
```
1815

19-
With [`pipx`](https://github.com/pipxproject/pipx):
16+
With [`uv`](https://docs.astral.sh/uv/):
2017

2118
```bash
22-
python3.8 -m pip install --user pipx
23-
pipx install griffe2md
19+
uv tool install griffe2md
2420
```
2521

2622
## Usage

config/ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
target-version = "py38"
1+
target-version = "py39"
22
line-length = 120
33

44
[lint]

duties.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
from contextlib import contextmanager
88
from importlib.metadata import version as pkgversion
99
from pathlib import Path
10-
from typing import TYPE_CHECKING, Iterator
10+
from typing import TYPE_CHECKING
1111

1212
from duty import duty, tools
1313

1414
if TYPE_CHECKING:
15+
from collections.abc import Iterator
16+
1517
from duty.context import Context
1618

1719

@@ -82,6 +84,7 @@ def check_docs(ctx: Context) -> None:
8284
@duty
8385
def check_types(ctx: Context) -> None:
8486
"""Check that the code is correctly typed."""
87+
os.environ["FORCE_COLOR"] = "1"
8588
ctx.run(
8689
tools.mypy(*PY_SRC_LIST, config_file="config/mypy.ini"),
8790
title=pyprefix("Type-checking"),

pyproject.toml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ classifiers = [
2323
"Programming Language :: Python :: 3.11",
2424
"Programming Language :: Python :: 3.12",
2525
"Programming Language :: Python :: 3.13",
26+
"Programming Language :: Python :: 3.14",
2627
"Topic :: Documentation",
2728
"Topic :: Software Development",
2829
"Topic :: Utilities",
@@ -47,12 +48,12 @@ Funding = "https://github.com/sponsors/pawamoy"
4748
[project.scripts]
4849
griffe2md = "griffe2md.cli:main"
4950

50-
[tool.pdm]
51-
version = {source = "scm"}
51+
[tool.pdm.version]
52+
source = "call"
53+
getter = "scripts.get_version:get_version"
5254

5355
[tool.pdm.build]
54-
package-dir = "src"
55-
editable-backend = "editables"
56+
# Include as much as possible in the source distribution, to help redistributors.
5657
excludes = ["**/.pytest_cache"]
5758
source-includes = [
5859
"config",
@@ -67,19 +68,19 @@ source-includes = [
6768
]
6869

6970
[tool.pdm.build.wheel-data]
71+
# Manual pages can be included in the wheel.
72+
# Depending on the installation tool, they will be accessible to users.
73+
# pipx supports it, uv does not yet, see https://github.com/astral-sh/uv/issues/4731.
7074
data = [
7175
{path = "share/**/*", relative-to = "."},
7276
]
7377

74-
[tool.uv]
75-
dev-dependencies = [
76-
# dev
77-
"editables>=0.5",
78-
78+
[dependency-groups]
79+
dev = [
7980
# maintenance
8081
"build>=1.2",
8182
"git-changelog>=2.5",
82-
"twine>=5.0; python_version < '3.13'",
83+
"twine>=5.1",
8384

8485
# ci
8586
"duty>=1.4",
@@ -104,5 +105,6 @@ dev-dependencies = [
104105
"mkdocs-material>=9.5",
105106
"mkdocs-minify-plugin>=0.8",
106107
"mkdocstrings[python]>=0.25",
108+
# YORE: EOL 3.10: Remove line.
107109
"tomli>=2.0; python_version < '3.11'",
108110
]

scripts/gen_credits.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
import os
66
import sys
77
from collections import defaultdict
8+
from collections.abc import Iterable
89
from importlib.metadata import distributions
910
from itertools import chain
1011
from pathlib import Path
1112
from textwrap import dedent
12-
from typing import Dict, Iterable, Union
13+
from typing import Union
1314

1415
from jinja2 import StrictUndefined
1516
from jinja2.sandbox import SandboxedEnvironment
1617
from packaging.requirements import Requirement
1718

18-
# TODO: Remove once support for Python 3.10 is dropped.
19+
# YORE: EOL 3.10: Replace block with line 2.
1920
if sys.version_info >= (3, 11):
2021
import tomllib
2122
else:
@@ -26,10 +27,10 @@
2627
pyproject = tomllib.load(pyproject_file)
2728
project = pyproject["project"]
2829
project_name = project["name"]
29-
devdeps = [dep for dep in pyproject["tool"]["uv"]["dev-dependencies"] if not dep.startswith("-e")]
30+
devdeps = [dep for dep in pyproject["dependency-groups"]["dev"] if not dep.startswith("-e")]
3031

31-
PackageMetadata = Dict[str, Union[str, Iterable[str]]]
32-
Metadata = Dict[str, PackageMetadata]
32+
PackageMetadata = dict[str, Union[str, Iterable[str]]]
33+
Metadata = dict[str, PackageMetadata]
3334

3435

3536
def _merge_fields(metadata: dict) -> PackageMetadata:

0 commit comments

Comments
 (0)