-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
95 lines (83 loc) · 2.99 KB
/
Copy pathpyproject.toml
File metadata and controls
95 lines (83 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[project]
name = "python-template"
version = "0.1.0"
description = "A template for yo61 Python projects."
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.11"
authors = [{ name = "Robin Bowes" }]
dependencies = [
"cyclopts>=4.11",
]
[project.scripts]
python-template = "pythontemplate.cli:main"
[dependency-groups]
dev = [
"hypothesis>=6",
"pytest>=8",
"pytest-cov>=5",
"ruff>=0.6",
"ty>=0.0.1a8",
]
[build-system]
requires = ["uv_build>=0.12.5,<0.13.0"]
build-backend = "uv_build"
[tool.uv]
# Pins uv to the 0.12 series. `setup-uv` reads `tool.uv.required-version`
# (src/version/file-parser.ts), so CI and the sync-lockfile job install the
# same series `mise.toml` provides locally. That job commits a lockfile; it
# should not be generated by a uv nobody else runs.
#
# The floor is the minor, not a patch. mise hides releases younger than its
# `minimum_release_age`, so pinning to the newest patch resolves to a version
# mise will not install for days -- CI green, every local uv command refusing
# to run.
#
# Belt and braces, not the real guard: uv.lock's `revision` has been 3 across
# 0.10, 0.11 and 0.12, so a format change is not imminent. `uv sync --locked`
# failing in CI is what actually catches a lockfile that has drifted.
required-version = ">=0.12,<0.13"
[tool.uv.build-backend]
# Required. uv_build derives the package directory from the distribution
# name, which normalises `python-template` to `python_template` -- but the
# package is `pythontemplate`. It also covers the case where bootstrap is
# given a package name that is not derived from the project name; it prompts
# for both separately. See docs how-to/use-hatchling to swap backends.
module-name = "pythontemplate"
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B", "SIM", "RUF", "TID"]
[tool.ruff.lint.flake8-tidy-imports]
# TID252 defaults to "parents", which flags `..` and lets `from .base import X`
# through. "all" is what "absolute imports only" means.
ban-relative-imports = "all"
[tool.ruff.format]
quote-style = "double"
[tool.ty.rules]
# strict-by-default; tighten as needed
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra --strict-markers --strict-config"
# tests/test_cli.py monkeypatches sys.argv and calls main(), which invokes
# app() with no tokens so cyclopts reads the replaced argv. That exercises the
# production argv-reading branch; cyclopts' stack inspection cannot tell it
# from a forgotten `app([])` and warns. False positive.
filterwarnings = [
"ignore:Cyclopts application invoked without tokens.*:UserWarning",
]
# Uncomment together with the layer packages when adopting DDD layering.
# See docs/site/content/docs/how-to/add-ddd-layers.mdx
# [tool.importlinter]
# root_package = "pythontemplate"
#
# [[tool.importlinter.contracts]]
# name = "DDD layers"
# type = "layers"
# layers = [
# "pythontemplate.commands",
# "pythontemplate.application",
# "pythontemplate.domain",
# ]