-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathpyproject.toml
More file actions
123 lines (112 loc) · 4.36 KB
/
Copy pathpyproject.toml
File metadata and controls
123 lines (112 loc) · 4.36 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[project]
name = "danger-python"
version = "0.2.0"
description = "Write your Dangerfiles in Python."
readme = "README.md"
requires-python = ">=3.13"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Orta Therox", email = "danger@orta.io" },
{ name = "Jakub Turek", email = "jkbturek@gmail.com" },
{ name = "Danger org contributors" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Quality Assurance",
]
dependencies = [
"click>=8",
"click-default-group>=1.2.4",
"pydantic>=2",
]
[project.urls]
Homepage = "https://github.com/danger/python"
Repository = "https://github.com/danger/python"
[project.scripts]
danger-python = "danger_python.cli:cli"
[dependency-groups]
dev = [
"pytest>=8",
"pytest-cov>=5",
"ruff>=0.15",
"pyrefly>=1.1",
"jinja2>=3",
"pyfakefs>=5",
"stringcase>=1.2.0",
"testfixtures>=8",
"bump-pydantic>=0.8",
]
[build-system]
requires = ["uv_build>=0.11.0,<0.12.0"]
build-backend = "uv_build"
# The package lives at the repository root (flat layout: ./danger_python),
# not under ./src, so point uv_build at the root.
[tool.uv.build-backend]
module-root = ""
module-name = "danger_python"
[tool.ruff]
line-length = 88
target-version = "py313"
# dangerfile.py runs under the danger runtime, which injects `danger`/`warn`
# as globals; it was excluded from the old flake8 config for the same reason.
extend-exclude = ["dangerfile.py"]
[tool.ruff.lint]
# Extend (not replace) Ruff's defaults so Pyflakes (F) and pycodestyle (E)
# checks are retained; add import sorting (I), pyupgrade (UP), bugbear (B),
# comprehensions (C4), and simplify (SIM).
extend-select = ["E", "F", "I", "UP", "B", "C4", "SIM"]
# Line length is enforced by the formatter (line-length = 88); E501 only fires
# on lines the formatter cannot wrap (e.g. long string literals in the
# generated models.py). The previous flake8 config ignored E501 for the same
# reason — keep that intent so lint and format do not disagree.
ignore = ["E501"]
[tool.pyrefly]
# Migrated from the old mypy config in setup.cfg ([mypy]):
# files = danger_python,tests -> project-includes
# ignore_missing_imports = true -> ignore-missing-imports = ["*"]
# `pyrefly init --migrate-from mypy` only emits a default project-includes (it
# does not read setup.cfg's [mypy] table), so the two settings are ported by
# hand below.
#
# Target the >=3.13 support floor (not the 3.14 dev interpreter) so results
# reflect the minimum supported version, matching ruff's target-version = "py313".
python-version = "3.13"
# Scope checks to the package and its tests — mirrors mypy `files = danger_python,tests`.
project-includes = ["danger_python", "tests"]
# Preserve the old mypy `ignore_missing_imports = true`: treat any module that
# cannot be resolved / ships no type information (e.g. stringcase,
# click-default-group) as `Any` instead of raising an import error. "*" is
# pyrefly module-globbing for "all module paths".
ignore-missing-imports = ["*"]
# danger_python/models.py is machine-generated by scripts/generate_scheme.py.
# Pyrefly skips any file containing a `@generated` marker (treating it as
# excluded), which prevents false positives on codegen output. The marker is
# emitted by the Jinja template (danger_python/generator/templates/dsl.py.jinja)
# as of the Group 6.3 template migration, so the regenerated models.py is
# auto-ignored.
ignore-errors-in-generated-code = true
# Migrated from setup.cfg [tool:pytest] (Group 5 config consolidation).
# The old [tool:pytest] `source = danger_python` line was not a valid pytest
# option (pytest ignored it); coverage's own [tool.coverage.run] source below
# is what scopes coverage, so it is intentionally not carried over. The
# [pytest-watch] section is dropped with pytest-watch itself (removed in Group 2).
[tool.pytest.ini_options]
python_files = ["test_*.py"]
addopts = "--cov --cov-report xml:cov.xml --cov-report term"
# Migrated from setup.cfg [coverage:run] / [coverage:report]. The 100% gate
# (fail_under) is preserved unchanged.
[tool.coverage.run]
branch = true
source = ["danger_python"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self\\.debug",
]
fail_under = 100