forked from beeware/toga
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (124 loc) · 4.53 KB
/
Copy pathpyproject.toml
File metadata and controls
138 lines (124 loc) · 4.53 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
[tool.codespell]
skip = ".git,*.pdf,*.svg"
# the way to make case sensitive skips of words etc
ignore-regex = "\bNd\b"
ignore-words-list = "MapPin"
# The coverage settings in this file only control `coverage report`. `coverage run` and
# `coverage combine` are controlled by the pyproject.toml files in each package's
# subdirectory.
#
# In each subdirectory's pyproject.toml, we use both of the following settings:
# * `source_pkgs`: detects the given packages no matter where they're imported from.
# * `source`: detects all files in the given directory, including files that are
# never imported by the tests.
#
# When running through `tox`, this will produce duplicate entries which must be merged
# with `coverage combine`.
[tool.coverage.run]
plugins = ["coverage_conditional_plugin"]
relative_files = true
[tool.coverage.report]
show_missing = true
skip_covered = true
skip_empty = true
precision = 1
exclude_lines = [
"pragma: no cover",
"@(abc\\.)?abstractmethod",
"NotImplementedError\\(\\)",
"if TYPE_CHECKING:",
"class .+?\\(Protocol.*\\):",
"@overload",
]
[tool.coverage.coverage_conditional_plugin.rules]
# Additional testbed rules are configured in the testbed module
no-cover-if-missing-setuptools_scm = "not is_installed('setuptools_scm')"
no-cover-if-missing-PIL = "not is_installed('PIL')"
no-cover-if-PIL-installed = "is_installed('PIL')"
no-cover-if-lt-py312 = "sys_version_info < (3, 12) and os_environ.get('COVERAGE_EXCLUDE_PYTHON_VERSION') != 'disable'"
no-cover-if-gte-py312 = "sys_version_info > (3, 12) and os_environ.get('COVERAGE_EXCLUDE_PYTHON_VERSION') != 'disable'"
no-cover-if-lt-py311 = "sys_version_info < (3, 11) and os_environ.get('COVERAGE_EXCLUDE_PYTHON_VERSION') != 'disable'"
no-cover-if-gte-py311 = "sys_version_info > (3, 11) and os_environ.get('COVERAGE_EXCLUDE_PYTHON_VERSION') != 'disable'"
[tool.ruff]
exclude = [
".template", # Ruff fails to run at all if allowed to lint the cookiecutter syntax
"core/src/toga/__init__.pyi"
]
[tool.ruff.lint]
# In addition to the default rules, these additional rules will be used:
extend-select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"YTT", # flake8-2020
"ASYNC", # flake8-async
"C4", # flake8-comprehensions
"I", # isort
# The SIM rules are *very* opinionated, and don't necessarily make for better code.
# They may be worth occasionally turning on just to see if something could actually
# use improvement.
# "SIM", # flake8-simplify
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-third-party = [
"android", # isort defaults to making this first-party because it can't be imported.
"textual", # We don't ever import textual, so Ruff doesn't know about it.
"travertino", # In this repo, but still a separate package
]
known-first-party = [
"testbed",
"toga",
"toga_android",
"toga_cocoa",
"toga_dummy",
"toga_gtk",
"toga_iOS",
"toga_textual",
"toga_web",
"toga_winforms",
]
[tool.towncrier]
directory = "changes"
package = "toga"
package_dir = "core/src"
filename = "docs/about/releases.md"
title_format = "## {version} ({project_date})"
issue_format = "[#{issue}](https://github.com/beeware/toga/issues/{issue})"
template = "changes/template.md"
type = [
{ directory = "feature", name = "Features", showcontent = true },
{ directory = "bugfix", name = "Bugfixes", showcontent = true },
{ directory = "removal", name = "Backward Incompatible Changes", showcontent = true },
{ directory = "doc", name = "Documentation", showcontent = true },
{ directory = "misc", name = "Misc", showcontent = false },
]
[tool.setuptools_scm]
# We're not doing anything Python-related at the root level of the repo, but if this
# declaration isn't here, tox commands run from the root directory raise a warning that
# pyproject.toml doesn't contain a setuptools_scm section.
[dependency-groups]
# Extras used by developers *of* Toga are pinned to specific versions to
# ensure environment consistency.
pre-commit = [
"pre-commit == 4.3.0",
]
towncrier = [
"towncrier==24.8.0",
]
tox-uv = [
"tox-uv == 1.28.0",
]
dev = [
{include-group = "pre-commit"},
{include-group = "tox-uv"},
]
# Docs are always built on a specific Python version; see RTD and tox config files,
# and the docs contribution guide.
docs = [
"beeware-docs-tools @ git+https://github.com/beeware/beeware-docs-tools",
"mkdocs-table-reader-plugin==3.1.0",
"setuptools-scm==9.2.0",
]