generated from microsoft/python-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
203 lines (191 loc) · 8.23 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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# ** Buildkit: Flit **
# Flit is a tool for building Python packages. It is configured to use the
# `flit_core.buildapi` backend, to require Flit Core version 3.2 or higher,
# and to use the `flit_core` package.
[build-system]
build-backend = "flit_core.buildapi"
requires = ["flit_core >=3.8,<4"]
# -- Project metadata.
[project]
name = "shorthand_datetime"
authors = [{ name = "Wout Weijtjens", email = "wout.weijtjens@gmail.com" },
{ name = "Pietro D'Antuono", email = "pietro.dantuono@24sea.eu" }]
readme = "README.rst"
dynamic = ["description", "version"]
classifiers=["Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3"]
license = { file = "LICENSE" }
# -- Project dependencies.
# requires-python = ">=3.0"
dependencies = ["pytz"]
[project.optional-dependencies]
dev = ["black==24.*", "mypy==1.*", "pycln==2.4.*", "isort==5.*",
"ruff==0.*", "commitizen==3.*", "pre-commit==3.*",
"types-PyYAML", "types-pytz", "types-requests"] #, "jupytext"]
test = ["pytest", "pytest-mock", "hypothesis", "pytest-cov"]
build = ["twine", "build"]
docs = ["sphinx", "sphinx-rtd-theme"]
# -- Project URLs.
[project.urls]
Homepage = "https://pypi.org/project/shorthand-datetime/"
Documentation = "https://pypi.org/project/shorthand-datetime/"
Repository = "https://github.com/wweijtje/shorthand-datetime/"
Bug-Tracker = "https://github.com/wweijtje/shorthand-datetime/issues"
# ** CI-Related **
# ** Black **
# Black is the codeformatter used by Ruff. It is configured to use the same
# line length as Ruff, 120 characters, and to use double quotes for strings.
[tool.black]
line-length = 120 # Code length
include = '\.pyi?$'
exclude = '''
(
/(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| docs
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
)
'''
# ** Pycln **
# Pycln is a tool for removing unused imports and unused variables. It is
# configured to remove unused imports and unused variables, and to remove
# unused variables from the global scope.
[tool.pycln]
all = true
exclude = ["__init__.py", "conftest.py", "*.notebooks.*", "*.docs.*",
"*.database.*", "*.docker.*", "*.__frontend.*", "*.templates.*",
"*.static.*", "*.staticfiles.*", "*.sql.*", "*.migrations.*"]
# ** Isort **
# Isort is a tool for sorting imports. It is configured to use the same line
# length as Ruff, 120 characters, and to use a multi-line output of 3.
[tool.isort]
line_length = 120
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
# ** Ruff **
# Ruff is a tool for linting Python code. It is configured to use the same
# line length as Black, 120 characters, and to ignore a variety of commonly
# ignored directories.
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py38"
# -- Exclude a variety of commonly ignored directories.
exclude = [".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg",
".mypy_cache", ".nox", ".pants.d", ".pytype", ".ruff_cache",
".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out",
"build", "dist", "node_modules", "venv", "api", "docs", "notebooks",
"scripts", "test", "config", "docker", "logs"] # -- Allow unused variables when underscore-prefixed.
# -- Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
[tool.ruff.lint]
select = ["E", "F"]
ignore = ["E501"]
# -- Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W",
"ANN","ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT",
"ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH",
"PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP",
"YTT"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# ** Ruff: McCabe **
# McCabe is a tool for measuring cyclomatic complexity. It is configured to
# use a complexity level of 15. The complexity level is the amount of
# different paths through a function, for example, a function with a single
# if statement has a complexity level of 2.
[tool.ruff.lint.mccabe]
# -- Unlike Flake8, default to a complexity level of 15.
max-complexity = 15
# ** Mypy **
# Mypy is a tool for type checking Python code. It is configured to use
# Python 3.8, to disallow untyped definitions, to show error codes, to
# disallow implicit optionals, to warn on any return type, to warn on unused
# ignores, and to exclude a variety of commonly ignored directories from being
# type checked.
[tool.mypy]
python_version = "3.8"
disallow_untyped_defs = false
show_error_codes = true
no_implicit_optional = true
warn_return_any = true
warn_unused_ignores = true
follow_imports = "skip"
strict_optional = true
ignore_missing_imports = true
ignore_errors = false
[tool.mypy-yaml]
ignore_missing_imports = true
# ** Pylint **
# Pylint is a tool for linting Python code. It is configured to use the same
# line length as Black, 120 characters, to use the same complexity level as
# McCabe, 15, to use the same list of ignored directories as Ruff, and to
# exclude a variety of commonly ignored directories from being linted.
[tool.pylint.'MESSAGES CONTROL']
max-line-length = 120
max-complexity = 20
max-local-variables = 20
max-return-statements = 10
max-instance-attributes = 10
max-args = 10
max-returning-statements = 10
ignore-patterns = [".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg",
".mypy_cache", ".nox", ".pants.d", ".pytype", ".ruff_cache",
".svn", ".tox", ".venv", "__pypackages__", "_build",
"buck-out", "build", "dist", "node_modules", "venv", "api",
"docs", "notebooks", "scripts", "test", "config", "docker",
"logs"]
# ** Pytest **
# Pytest is a tool for testing Python code. It is configured to use the same
# list of ignored directories as Ruff, and to exclude a variety of commonly
# ignored directories from being tested.
[tool.pytest.ini_options]
norecursedirs = [".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg",
".mypy_cache", ".nox", ".pants.d", ".pytype", ".ruff_cache",
".svn", ".tox", ".venv", "__pypackages__", "_build",
"buck-out", "build", "dist", "node_modules", "venv", "api",
"docs", "notebooks", "scripts", "test", "config", "docker",
"logs"]
minversion = "6.0"
addopts = "-ra -q"
testpaths = ["test", "tests"]
# ** Commitizen **
# Commitizen is a tool for creating commit messages. It is configured to use
# the cz_conventional_commits adapter, to use the same list of ignored
# directories as Ruff, and to exclude a variety of commonly ignored
# directories from being committed.
[tool.commitizen]
name = "cz_conventional_commits"
version = "3.13.0"
bump_message = "bump(version): {current_version} → {new_version}"
update_changelog_on_bump = true
style = [["qmark", "fg:#ff9d00 bold"],
["question", "bold"],
["answer", "fg:#ff9d00 bold"],
["pointer", "fg:#ff9d00 bold"],
["highlighted", "fg:#ff9d00 bold"],
["selected", "fg:#cc5454"],
["separator", "fg:#cc5454"],
["instruction", ""],
["text", ""],
["disabled", "fg:#858585 italic"]]