forked from JackLilhammers/pyside6-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
104 lines (89 loc) · 2.72 KB
/
pyproject.toml
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
[project]
name = "app"
description = "Pyside6 Application Boilerplate"
authors = [
{name = "adehad", email = "[email protected]"},
]
dependencies = [
"PySide6",
"pydantic>=2.5.3",
]
requires-python = ">=3.12,<3.13"
readme = "README.rst"
license = { text = "MIT" }
dynamic = ["version"]
[project.gui-scripts]
app = "app.__main__:main"
[project.optional-dependencies]
dev = [
# Lint
"mypy>=1.8.0",
# Installer
"PyInstaller>=6.3.0",
# Docs
"Sphinx>=7.2.6",
"furo>=2023.9.10",
"sphinx-copybutton>=0.5.2",
"babel<2.12", # https://github.com/python-babel/babel/issues/990#issuecomment-1481568645
# Tests
"pytest>=7.4.4",
"pytest-cov>=4.1.0",
"PySide6-stubs>=6.4.2.0",
"pytest-qt>=4.3.1",
]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
########################################################################################
# PDM Config
########################################################################################
[tool.pdm.version]
source = "scm"
[tool.pdm]
package-type = "library"
[tool.pdm.scripts]
post_install = "python -m app._ui._autogen"
cov = "pytest -vv --cov-report=term-missing --cov-config=pyproject.toml --cov=src/app --cov=tests {args} --cov-report=xml:dist/cov/coverage.xml --cov-report=html:dist/cov/coverage.html"
docs = "sphinx-build -a -n -v -W --keep-going -b html --color -d dist/docs_doctree docs/ {args:dist/docs}"
exe = "pyinstaller app.spec"
# Can't run in pre-commit as needs autogenerated files and deps
mypy = "mypy src"
########################################################################################
# External Tool Config
########################################################################################
[tool.mypy]
python_version = "3.12"
show_error_codes = true
warn_unused_configs = true
namespace_packages = true
check_untyped_defs = true
plugins = "pydantic.mypy"
exclude = '''(?x)(
^src\/app\/_ui\/.*_ui.py$ # autogenerated ui files
)'''
[tool.ruff]
select = [
"E", # pydocstyle
"W", # pydocstyle
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"D", # docstrings
"RUF", # ruff
]
ignore = []
extend-exclude = ["./src/app/_ui/*_ui.py"]
# Same as Black.
line-length = 88
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.12. (minimum supported)
target-version = "py312"
# The source code paths to consider, e.g., when resolving first- vs. third-party imports
src = ["app", "tests"]
[tool.ruff.isort]
known-first-party = ["app", "tests"]
required-imports = ["from __future__ import annotations"]
[tool.ruff.pydocstyle]
# Use Google-style docstrings.
convention = "google"