-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
180 lines (157 loc) · 4.54 KB
/
pyproject.toml
File metadata and controls
180 lines (157 loc) · 4.54 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "your-project-name"
version = "0.0.1"
description = "Your project description"
authors = ["Your Name <your.email@example.com>"]
readme = "README.md"
packages = [{include = "your_project_name", from = "src"}]
license = "MIT"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
[tool.poetry.dependencies]
python = ">=3.7,<4.0"
loguru = ">=0.7.3,<0.8.0"
platformdirs = ">=3,<4.0.0"
pydantic = ">=1.10.0,<2.0.0"
[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
pytest-cov = "^4.1.0"
commitizen = "^3.12.0"
ruff = "^0.9.0"
pyfakefs = "^5.8.0"
python-semantic-release = "^8.5.1"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
sphinx = "^7.2.6"
sphinx-rtd-theme = "^2.0.0"
myst-parser = "^2.0.0"
[tool.poetry.urls]
Homepage = "https://github.com/yourusername/your-project-name"
Issues = "https://github.com/yourusername/your-project-name/issues"
[tool.poetry.scripts]
your-project-name = "your_project_name.cli:main"
[tool.commitizen]
name = "cz_conventional_commits"
version = "0.0.1"
tag_format = "$version"
version_files = [
"pyproject.toml:version",
"src/your_project_name/__version__.py",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
[tool.coverage.run]
source = ["your_project_name"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"if TYPE_CHECKING:",
]
[tool.mypy]
python_version = "3.7"
strict = true
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
ignore_missing_imports = true
disable_error_code = ["type-arg", "misc", "no-any-return"]
[tool.ruff]
line-length = 120
target-version = "py37"
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"D", # pydocstyle
"UP", # pyupgrade
"RUF", # ruff-specific rules
]
ignore = ["D203", "D213", "ARG001", "D107", "D105", "D102", "F811", "I001"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*.py" = ["ARG001", "F401", "F811", "D107", "D105", "D102", "E501", "I001"]
"nox_actions/*.py" = ["D100", "D103", "D104", "E402"]
"noxfile.py" = ["D100", "E402", "D401", "D400"]
"examples/*.py" = ["D401", "D415", "RUF013", "E722", "D400"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.isort]
# Enforce import section headers.
import_heading_future = "Import future modules"
import_heading_stdlib = "Import built-in modules"
import_heading_thirdparty = "Import third-party modules"
import_heading_firstparty = "Import local modules"
profile = "black"
line_length = 120
force_sort_within_sections = true
force_single_line = true
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_first_party = ["your_project_name"]
[tool.nox]
sessions = ["lint", "pytest"]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
reuse_venv = true
[tool.nox.session.lint]
deps = ["ruff", "mypy", "isort"]
commands = [
"mypy --install-types --non-interactive",
"ruff check .",
"ruff format --check .",
"isort --check-only .",
"mypy src/your_project_name --strict"
]
[tool.nox.session.lint_fix]
deps = ["ruff", "mypy", "isort"]
commands = [
"ruff check --fix .",
"ruff format .",
"isort ."
]
[tool.nox.session.pytest]
deps = ["pytest", "pytest-cov"]
commands = [
"pytest tests/ --cov=your_project_name --cov-report=xml:coverage.xml --cov-report=term-missing"
]
[tool.semantic_release]
version_variable = [
"src/your_project_name/__version__.py:__version__",
"pyproject.toml:version"
]
branch = "main"
upload_to_pypi = false
upload_to_release = true
build_command = "pip install poetry && poetry build"