Skip to content

Commit 056afcd

Browse files
committed
Merge branch 'main' into detect-classvar
2 parents ec00297 + f255a8c commit 056afcd

11 files changed

+282
-208
lines changed

.copier-answers.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 1.5.2
2+
_commit: 1.5.7
33
_src_path: gh:pawamoy/copier-uv
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli

docs/insiders/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ else:
8888
```
8989
<!-- blacken-docs:on -->
9090

91+
Additionally, your sponsorship will give more weight to your upvotes on issues, helping us prioritize work items in our backlog. For more information on how we prioritize work, see this page: [Backlog management](https://pawamoy.github.io/backlog/).
92+
9193
## How to become a sponsor
9294

9395
Thanks for your interest in sponsoring! In order to become an eligible sponsor

duties.py

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def check_docs(ctx: Context) -> None:
8484
@duty
8585
def check_types(ctx: Context) -> None:
8686
"""Check that the code is correctly typed."""
87+
os.environ["FORCE_COLOR"] = "1"
8788
ctx.run(
8889
tools.mypy(*PY_SRC_LIST, config_file="config/mypy.ini"),
8990
title=pyprefix("Type-checking"),

pyproject.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Funding = "https://github.com/sponsors/pawamoy"
4545
[project.entry-points."mkdocstrings.python.templates"]
4646
griffe-pydantic = "griffe_pydantic:get_templates_path"
4747

48-
[tool.pdm]
49-
version = {source = "scm"}
48+
[tool.pdm.version]
49+
source = "call"
50+
getter = "scripts.get_version:get_version"
5051

5152
[tool.pdm.build]
52-
package-dir = "src"
53-
editable-backend = "editables"
53+
# Include as much as possible in the source distribution, to help redistributors.
5454
excludes = ["**/.pytest_cache"]
5555
source-includes = [
5656
"config",
@@ -65,15 +65,15 @@ source-includes = [
6565
]
6666

6767
[tool.pdm.build.wheel-data]
68+
# Manual pages can be included in the wheel.
69+
# Depending on the installation tool, they will be accessible to users.
70+
# pipx supports it, uv does not yet, see https://github.com/astral-sh/uv/issues/4731.
6871
data = [
6972
{path = "share/**/*", relative-to = "."},
7073
]
7174

72-
[tool.uv]
73-
dev-dependencies = [
74-
# dev
75-
"editables>=0.5",
76-
75+
[dependency-groups]
76+
dev = [
7777
# maintenance
7878
"build>=1.2",
7979
"git-changelog>=2.5",

scripts/gen_credits.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
pyproject = tomllib.load(pyproject_file)
2828
project = pyproject["project"]
2929
project_name = project["name"]
30-
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")]
3131

3232
PackageMetadata = dict[str, Union[str, Iterable[str]]]
3333
Metadata = dict[str, PackageMetadata]

scripts/get_version.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Get current project version from Git tags or changelog."""
2+
3+
import re
4+
from contextlib import suppress
5+
from pathlib import Path
6+
7+
from pdm.backend.hooks.version import SCMVersion, Version, default_version_formatter, get_version_from_scm
8+
9+
_root = Path(__file__).parent.parent
10+
_changelog = _root / "CHANGELOG.md"
11+
_changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$")
12+
_default_scm_version = SCMVersion(Version("0.0.0"), None, False, None, None) # noqa: FBT003
13+
14+
15+
def get_version() -> str:
16+
"""Get current project version from Git tags or changelog."""
17+
scm_version = get_version_from_scm(_root) or _default_scm_version
18+
if scm_version.version <= Version("0.1"): # Missing Git tags?
19+
with suppress(OSError, StopIteration): # noqa: SIM117
20+
with _changelog.open("r", encoding="utf8") as file:
21+
match = next(filter(None, map(_changelog_version_re.match, file)))
22+
scm_version = scm_version._replace(version=Version(match.group(1)))
23+
return default_version_formatter(scm_version)
24+
25+
26+
if __name__ == "__main__":
27+
print(get_version())

scripts/insiders.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
def human_readable_amount(amount: int) -> str: # noqa: D103
2727
str_amount = str(amount)
2828
if len(str_amount) >= 4: # noqa: PLR2004
29-
return f"{str_amount[:len(str_amount)-3]},{str_amount[-3:]}"
29+
return f"{str_amount[: len(str_amount) - 3]},{str_amount[-3:]}"
3030
return str_amount
3131

3232

scripts/make

-190
This file was deleted.

scripts/make

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
make.py

0 commit comments

Comments
 (0)