Skip to content

Commit b531772

Browse files
committed
chore: Template upgrade
1 parent 790391e commit b531772

File tree

6 files changed

+61
-19
lines changed

6 files changed

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

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### For reviewers
2+
<!-- Help reviewers by letting them know whether AI was used to create this PR. -->
3+
4+
- [ ] I did not use AI
5+
- [ ] I used AI and thorougly reviewed every code/docs change
6+
7+
### Description of the change
8+
<!-- Quick sentence for small changes, longer description for more impacting changes. -->
9+
10+
11+
### Relevant resources
12+
<!-- Link to any relevant GitHub issue, PR or discussion, section in online docs, etc. -->
13+
14+
-
15+
-
16+
-

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![ci](https://github.com/mkdocstrings/griffe-pydantic/workflows/ci/badge.svg)](https://github.com/mkdocstrings/griffe-pydantic/actions?query=workflow%3Aci)
44
[![documentation](https://img.shields.io/badge/docs-mkdocs-708FCC.svg?style=flat)](https://mkdocstrings.github.io/griffe-pydantic/)
55
[![pypi version](https://img.shields.io/pypi/v/griffe-pydantic.svg)](https://pypi.org/project/griffe-pydantic/)
6-
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://app.gitter.im/#/room/#griffe-pydantic:gitter.im)
6+
[![gitter](https://img.shields.io/badge/matrix-chat-4DB798.svg?style=flat)](https://app.gitter.im/#/room/#griffe-pydantic:gitter.im)
77

88
[Griffe](https://mkdocstrings.github.io/griffe/) extension for [Pydantic](https://github.com/pydantic/pydantic).
99

duties.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
WINDOWS = os.name == "nt"
2727
PTY = not WINDOWS and not CI
2828
MULTIRUN = os.environ.get("MULTIRUN", "0") == "1"
29+
PY_VERSION = f"{sys.version_info.major}{sys.version_info.minor}"
30+
PY_DEV = "314"
2931

3032

3133
def pyprefix(title: str) -> str:
@@ -84,7 +86,7 @@ def check(ctx: Context) -> None:
8486
"""Check it all!"""
8587

8688

87-
@duty
89+
@duty(nofail=PY_VERSION == PY_DEV)
8890
def check_quality(ctx: Context) -> None:
8991
"""Check the code quality."""
9092
ctx.run(
@@ -93,7 +95,7 @@ def check_quality(ctx: Context) -> None:
9395
)
9496

9597

96-
@duty
98+
@duty(nofail=PY_VERSION == PY_DEV)
9799
def check_docs(ctx: Context) -> None:
98100
"""Check if the documentation builds correctly."""
99101
Path("htmlcov").mkdir(parents=True, exist_ok=True)
@@ -105,7 +107,7 @@ def check_docs(ctx: Context) -> None:
105107
)
106108

107109

108-
@duty
110+
@duty(nofail=PY_VERSION == PY_DEV)
109111
def check_types(ctx: Context) -> None:
110112
"""Check that the code is correctly typed."""
111113
os.environ["FORCE_COLOR"] = "1"
@@ -115,7 +117,7 @@ def check_types(ctx: Context) -> None:
115117
)
116118

117119

118-
@duty
120+
@duty(nofail=PY_VERSION == PY_DEV)
119121
def check_api(ctx: Context, *cli_args: str) -> None:
120122
"""Check for API breaking changes."""
121123
ctx.run(
@@ -236,15 +238,14 @@ def coverage(ctx: Context) -> None:
236238
ctx.run(tools.coverage.html(rcfile="config/coverage.ini"))
237239

238240

239-
@duty
241+
@duty(nofail=PY_VERSION == PY_DEV)
240242
def test(ctx: Context, *cli_args: str, match: str = "") -> None: # noqa: PT028
241243
"""Run the test suite.
242244
243245
Parameters:
244246
match: A pytest expression to filter selected tests.
245247
"""
246-
py_version = f"{sys.version_info.major}{sys.version_info.minor}"
247-
os.environ["COVERAGE_FILE"] = f".coverage.{py_version}"
248+
os.environ["COVERAGE_FILE"] = f".coverage.{PY_VERSION}"
248249
ctx.run(
249250
tools.pytest(
250251
"tests",

scripts/make.py

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from collections.abc import Iterator
1515

1616

17-
PYTHON_VERSIONS = os.getenv("PYTHON_VERSIONS", "3.9 3.10 3.11 3.12 3.13").split()
17+
PYTHON_VERSIONS = os.getenv("PYTHON_VERSIONS", "3.9 3.10 3.11 3.12 3.13 3.14").split()
18+
PYTHON_DEV = "3.14"
1819

1920

2021
def shell(cmd: str, *, capture_output: bool = False, **kwargs: Any) -> str | None:
@@ -67,16 +68,31 @@ def setup() -> None:
6768
uv_install(venv_path)
6869

6970

71+
class _RunError(subprocess.CalledProcessError):
72+
def __init__(self, *args: Any, python_version: str, **kwargs: Any):
73+
super().__init__(*args, **kwargs)
74+
self.python_version = python_version
75+
76+
7077
def run(version: str, cmd: str, *args: str, **kwargs: Any) -> None:
7178
"""Run a command in a virtual environment."""
7279
kwargs = {"check": True, **kwargs}
7380
uv_run = ["uv", "run", "--no-sync"]
74-
if version == "default":
75-
with environ(UV_PROJECT_ENVIRONMENT=".venv"):
76-
subprocess.run([*uv_run, cmd, *args], **kwargs) # noqa: S603, PLW1510
77-
else:
78-
with environ(UV_PROJECT_ENVIRONMENT=f".venvs/{version}", MULTIRUN="1"):
79-
subprocess.run([*uv_run, cmd, *args], **kwargs) # noqa: S603, PLW1510
81+
try:
82+
if version == "default":
83+
with environ(UV_PROJECT_ENVIRONMENT=".venv"):
84+
subprocess.run([*uv_run, cmd, *args], **kwargs) # noqa: S603, PLW1510
85+
else:
86+
with environ(UV_PROJECT_ENVIRONMENT=f".venvs/{version}", MULTIRUN="1"):
87+
subprocess.run([*uv_run, cmd, *args], **kwargs) # noqa: S603, PLW1510
88+
except subprocess.CalledProcessError as process:
89+
raise _RunError(
90+
returncode=process.returncode,
91+
python_version=version,
92+
cmd=process.cmd,
93+
output=process.output,
94+
stderr=process.stderr,
95+
) from process
8096

8197

8298
def multirun(cmd: str, *args: str, **kwargs: Any) -> None:
@@ -195,7 +211,14 @@ def main() -> int:
195211
if __name__ == "__main__":
196212
try:
197213
sys.exit(main())
198-
except subprocess.CalledProcessError as process:
214+
except _RunError as process:
199215
if process.output:
200216
print(process.output, file=sys.stderr)
201-
sys.exit(process.returncode)
217+
if (code := process.returncode) == 139: # noqa: PLR2004
218+
print(
219+
f"✗ (python{process.python_version}) '{' '.join(process.cmd)}' failed with return code {code} (segfault)",
220+
file=sys.stderr,
221+
)
222+
if process.python_version == PYTHON_DEV:
223+
code = 0
224+
sys.exit(code)

tests/test_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def test_api_matches_inventory(inventory: Inventory, public_objects: list[griffe
137137
"""All public objects are added to the inventory."""
138138
ignore_names = {"__getattr__", "__init__", "__repr__", "__str__", "__post_init__"}
139139
not_in_inventory = [
140-
obj.path for obj in public_objects if obj.name not in ignore_names and obj.path not in inventory
140+
f"{obj.relative_filepath}:{obj.lineno}: {obj.path}"
141+
for obj in public_objects
142+
if obj.name not in ignore_names and obj.path not in inventory
141143
]
142144
msg = "Objects not in the inventory (try running `make run mkdocs build`):\n{paths}"
143145
assert not not_in_inventory, msg.format(paths="\n".join(sorted(not_in_inventory)))

0 commit comments

Comments
 (0)