-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
376 lines (346 loc) · 9.54 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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
[tool.poetry]
name = "toggl-api-wrapper"
version = "1.6.0"
description = "Simple Toggl API wrapper for non-premium features."
authors = ["David Kasakaitis <[email protected]>"]
license = "MIT"
readme = "docs/README.md"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: MIT License",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Natural Language :: English",
"Typing :: Typed",
]
packages = [
{ include = "toggl_api" },
{ include = "toggl_api/py.typed" },
{ include = "scripts" },
]
[tool.poetry.scripts]
clean-toggl-account = "scripts.clean_account:main"
[tool.poetry.urls]
"Homepage" = "https://ddkasa.github.io/toggl-api-wrapper/"
"Documentation" = "https://ddkasa.github.io/toggl-api-wrapper/api-guide/index.html"
"Source" = "https://github.com/ddkasa/toggl-api-wrapper"
"Bug Tracker" = "https://github.com/ddkasa/toggl-api-wrapper/issues"
"Changelog" = "https://ddkasa.github.io/toggl-api-wrapper/CHANGELOG.html"
"Coverage" = "https://app.codecov.io/gh/ddkasa/toggl-api-wrapper"
[tool.poetry.dependencies]
python = "^3.10"
httpx = "^0.27.0"
sqlalchemy = { version = "^2.0.30", optional = true }
[tool.poetry.extras]
sqlite = ["sqlalchemy"]
[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"
pytest-env = "^1.1.3"
pytest-order = "^1.2.1"
coverage = "^7.5.1"
tox-gh-actions = "^3.2.0"
pytest-httpx = "^0.30.0"
pytest-sqlalchemy-mock = "^0.1.6"
faker = "^25.2.0"
pytest-reportlog = "^0.4.0"
pytest-cov = "^5.0.0"
pytest-replay = "^1.5.2"
pytest-rerunfailures = "^14.0"
pytest-dependency = "^0.6.0"
tomli = "^2.0.2"
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.0"
mkdocs-callouts = "^1.13.2"
pymdown-extensions = "^10.8.1"
markdown = "^3.6"
markdown-callouts = "^0.4.0"
mdx-gh-links = "^0.4"
mkdocs-click = "^0.8.1"
mkdocs-redirects = "^1.2.1"
mkdocs-autorefs = "^1.0.1"
mkdocs-literate-nav = "^0.6.1"
mkdocstrings = { extras = ["python"], version = "^0.25.1" }
mkdocs-simple-hooks = "^0.1.5"
mkdocs-material = "^9.5.24"
mkdocs-glightbox = "^0.4.0"
mkdocs-mermaid2-plugin = "^1.1.1"
mkdocs-macros-plugin = "^1.0.5"
pygments = "^2.18.0"
mkdocs-panzoom-plugin = "^0.1.1"
git-cliff = "^2.6.1"
[tool.poetry.group.types.dependencies]
types-sqlalchemy = "^1.4.53.38"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".mypy_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"build",
"dist",
"venv",
]
line-length = 120
indent-width = 4
target-version = "py312"
[tool.ruff.lint]
preview = true
select = [
"F",
"E",
"W",
"C90",
"I",
"N",
"UP",
"YTT",
"ASYNC",
"S",
"BLE",
"FBT",
"B",
"A",
"COM",
"C4",
"DTZ",
"T10",
"DJ",
"EM",
"EXE",
"FA",
'ISC',
"ICN",
"G",
'INP',
'PIE',
"T20",
'PYI',
'PT',
"Q",
"RSE",
"RET",
"SLF",
"SLOT",
"SIM",
"TID",
"TCH",
"INT",
"PTH",
"ERA",
"PD",
"PGH",
"PL",
"TRY",
"FLY",
"NPY",
"AIR",
"PERF",
"FURB",
"LOG",
"RUF",
]
ignore = [
"S101", # Use of assert detected https://docs.astral.sh/ruff/rules/assert/
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"SIM102", # Sometimes it's better to nest
"N802",
"TC006",
"PLW2901",
"UP017", # Python 3.10 backwards compatibility
"PLR6301", # Class Method Suggestion
"S311", # Unsafe pseudo-random generator
"PLR0913", # Too many arguments.
"C901", # Complex functions
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint.per-file-ignores]
"docs/examples/*" = ["INP001", "T201"]
[tool.mypy]
ignore_missing_imports = true
[tool.pytest.ini_options]
markers = [
"unit: Basic unit tests using local cache.",
"integration: Tests that actively use the API.",
"slow: Tests that are slow to run or have delays included.",
]
testpaths = ["tests"]
addopts = "--report-log=logs/pytest.jsonl --cov --cov-append --cov-report xml"
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = ruff, mypy, py312, py311, py310, py313
[testenv]
skip_install = true
passenv = *
setenv =
GH_ACTION = "True"
TOGGL_WORKSPACE_ID = {env:TOGGL_WORKSPACE_ID}
TOGGL_API_TOKEN = {env:TOGGL_API_TOKEN}
PYTHONPATH = {toxinidir}
allowlist_externals = poetry
commands_pre =
poetry install --without=docs
commands =
poetry run pytest {posargs}
[gh-actions]
python =
3.10: py310
3.11: py311
3.12: ruff, mypy, py312
3.13: py313
[testenv:mypy]
allowlist_externals = mypy, poetry
basepython = python3.12
commands = mypy toggl_api
[testenv:ruff]
allowlist_externals = ruff, poetry
basepython = python3.12
commands = ruff check toggl_api
"""
[tool.coverage.run]
omit = [
"*/tests/*",
"*/.venv/*",
"*/.mypy_cache/*",
"*/.ruff_cache/*",
"*/.pytest_cache/*",
"docs/*",
"scripts/*",
"*/.github/*",
"*/.tox/*",
"*/.git/*",
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"except ImportError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.
[tool.git-cliff.changelog]
# template for the changelog header
header = """
---
hide:
- navigation
---
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\n
"""
# template for the changelog footer
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailing s
trim = true
# postprocessors
postprocessors = [
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
]
# render body even when there are no releases to process
# render_always = true
# output file path
# output = "test.md"
[tool.git-cliff.git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# Replace issue numbers
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
# Check spelling of the commit with https://github.com/crate-ci/typos
# If the spelling is incorrect, it will be automatically fixed.
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
]
commit_parsers = [
{ message = "^chore\\(release\\):", skip = true },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^chore\\(merge\\)", skip = true },
{ message = "^docs\\(changelog\\):", skip = true },
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 4 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 5 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
{ message = "^deprecate", group = "<!-- 3 -->🕸 Deprecations" },
{ message = "^style", group = "<!-- 6 -->🎨 Styling" },
{ message = "^test", group = "<!-- 7 -->🧪 Testing" },
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = "^wip", group = "<!-- 10 -->🚧 Work In Progress" },
] # regex for parsing and grouping commits
# filter out the commits that are not matched by commit parsers
filter_commits = false
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
[tool.git-cliff.remote.github]
owner = "ddkasa"
repo = "toggl-api-wrapper"