Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
278 lines (246 loc) · 10.1 KB
/
Copy pathpyproject.toml
File metadata and controls
278 lines (246 loc) · 10.1 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
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
[build-system]
requires = ["hatchling>=1.27.0", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "vcs"
# Only v<digit>* tags are releases. The default describe matches any tag
# containing a digit, so a non-release tag with a number in it could
# become the version and break the build.
raw-options = { scm = { git = { describe_command = "git describe --dirty --tags --long --abbrev=40 --match v[0-9]*" } } }
[tool.hatch.build.hooks.vcs]
version-file = "caldav/_version.py"
[tool.hatch.build.targets.sdist]
## The release is built from a clean checkout (see docs/design/RELEASE-HOWTO.md)
## and `tox -e package` fails if the sdist contains a single file git does not
## track, so this list does not have to enumerate every kind of junk - it only
## has to keep an *ordinary working tree* buildable.
##
## The reason it is needed at all: hatchling's VCS-ignore support honours only
## the ROOT .gitignore. A file hidden from `git status` by a nested .gitignore,
## or by the developer's global git ignore file, is invisible locally and lands
## in the tarball anyway. caldav-3.2.1.tar.gz shipped .claude/settings.json and
## 1755 files under venv/ that way - the venv because RELEASE-HOWTO used to
## create it inside the release clone.
exclude = [
".#*", # Emacs lock files
"\\#*\\#", # Emacs auto-save files - a bare "#" starts a comment
"*~", # Backup files
"*.swp", # Vim swap files
"*.pyc", # Python bytecode
"__pycache__",
".claude", # per-directory AI harness settings
".prompts", # AI prompt archive
".pytest_cache",
".ruff_cache",
"venv",
"/docs/build",
"/tests/caldav_test_servers.yaml", # may hold credentials
"/tests/conf_private.py",
]
[tool.hatch.build.targets.wheel]
packages = ["caldav"]
exclude = [
".#*",
"\\#*\\#",
"*~",
"*.swp",
"*.pyc",
"__pycache__",
]
[project]
name = "caldav"
authors = [{ name = "Cyril Robert", email = "cyril@hippie.io" }, { name = "Tobias Brox", email = "caldav@plann.no" }]
license = "GPL-3.0-or-later OR Apache-2.0"
license-files = ["COPYING.*"]
description = "CalDAV (RFC4791) client library"
keywords = []
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Office/Business :: Scheduling",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"lxml",
"niquests", ## see docs/source/http-libraries.rst
"recurring-ical-events>=2.0.0",
"typing_extensions;python_version<'3.11'",
"icalendar>6.0.0",
"icalendar-searcher>=1.1.0,<2",
"dnspython",
"python-dateutil",
"PyYAML",
"calendaring-config>=0.5", ## reads the config file, see issue 786
]
dynamic = ["version"]
[project.urls]
Repository = "https://github.com/python-caldav/caldav"
Issues = "https://github.com/python-caldav/caldav/issues"
Documentation = "https://caldav.readthedocs.io/"
Changelog = "https://github.com/python-caldav/caldav/blob/master/CHANGELOG.md"
[project.optional-dependencies]
## A no-op today, since niquests is an ordinary dependency above - it exists so
## that `caldav[niquests]` already resolves. v4.0 is planned to depend on no
## HTTP library by default, and this is how consumers will keep the current
## behaviour, so they can depend on it now and change nothing later. See
## docs/source/http-libraries.rst
niquests = ["niquests"]
## caldav.jmap is a thin wrapper around the standalone calendaring-jmap
## package (JMAP support was extracted out of this repo, see CHANGELOG).
## Optional because caldav/__init__.py never imports caldav.jmap eagerly.
jmap = ["calendaring-jmap>=1.1.0"]
test = [
"vobject",
"pytest",
"pytest-asyncio",
"coverage",
"manuel",
"proxy.py",
"tzlocal",
"xandikos>=0.3.3",
"radicale",
"pyfakefs",
"httpx",
"httpxyz",
## Deliberately NOT enabled, and not an oversight. testCheckCompatibility
## skips itself without caldav_server_tester, but enabling it here buys
## nothing and costs something:
## * caldav_server_tester depends on caldav, so this is a dependency cycle
## in the published metadata that every downstream packager inherits.
## * its probe set has to move in lockstep with compatibility_hints.py. A
## *released* checker only probes the features that existed when it
## shipped - 1.2.0 probes 63 of the 82 the current checkout does - so CI
## would go green while covering none of the features a feature branch
## just added. Green-but-vacuous is worse than skipped-and-honest.
## testCheckCompatibility is therefore run manually, against a
## caldav-server-tester checkout developed in step with this branch. See
## tests/README.md.
#"caldav_server_tester"
"deptry>=0.24.0; python_version >= '3.10'",
]
[tool.deptry]
ignore = ["DEP002"] # Test dependencies (pytest, coverage, etc.) are not imported in main code
[tool.deptry.per_rule_ignores]
DEP001 = ["conf", "h2", "calendaring_jmap"] # conf: Local test config, h2: Optional HTTP/2 support, calendaring_jmap: optional dep for caldav.jmap.
## httpxyz needed an entry here while it was imported by name; the httpx-family
## libraries are now imported dynamically (see _ASYNC_HTTPX_CANDIDATES), which
## deptry does not see at all.
DEP003 = ["aiohttp", "h2"] # aiohttp: optional dep used only in caldav/testing/__init__.py
## h2 needs an entry in both DEP001 and DEP003: which of the two the optional
## `import h2` in async_davclient.py trips depends on whether h2 happens to be
## installed - DEP001 "missing" when it is not (CI), DEP003 "transitive" when it
## is (a local checkout, where niquests or httpx has pulled it in).
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade (modernize code)
"B", # flake8-bugbear (find bugs)
]
## See https://github.com/python-caldav/caldav/issues/634 for ongoing work to reduce this list
ignore = [
"E501", # Line too long (formatter handles this)
"E402", # Module level import not at top of file (common with conditional imports)
"E722", # Bare except — 28 violations, each needs case-by-case review
"F401", # Unused imports — many are re-exports or conditional; needs audit
"F821", # Undefined names — often in TYPE_CHECKING blocks or docstrings
"UP031", # %-format — 31 violations; ruff only offers unsafe auto-fix
]
[tool.ruff.lint.per-file-ignores]
# Examples and docs may have undefined names for illustration, and an unused
# variable there is the point: it shows what a method hands back.
"examples/*.py" = ["F821", "F841"]
"docs/**/*.py" = ["F821", "F841"]
# Tests may use assertions and have unusual patterns
"tests/*.py" = ["B011", "B017"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.ruff.lint.isort]
known-first-party = ["caldav"]
[tool.pytest.ini_options]
asyncio_mode = "strict"
asyncio_default_fixture_loop_scope = "function"
filterwarnings = [
# Treat all warnings as errors by default
"error",
# Allow missing _version.py warning during development/testing (generated by hatch-vcs on build/install)
"ignore:You need to install the `build` package:UserWarning",
# An old key in the developer's own config file should not break the test run
"default:The config key '.*' is deprecated:FutureWarning",
"default:The compatibility profile '.*' has been renamed:FutureWarning",
# Ignore deprecation warnings from external libraries we can't control
# https://github.com/jawah/niquests/pull/327 https://github.com/jawah/niquests/issues/326
"ignore:.*asyncio.iscoroutinefunction.*:DeprecationWarning:niquests",
# Radicale upstream bugs: unclosed resources during server shutdown
# https://github.com/Kozea/Radicale/issues/1972
"ignore:unclosed.*:ResourceWarning",
"ignore:Exception ignored.*:pytest.PytestUnraisableExceptionWarning",
# Radicale uses deprecated importlib.abc.Traversable (Python 3.14 removal)
"ignore:.*importlib.abc.Traversable.*:DeprecationWarning",
# Show conf_private.py deprecation warning once (not as error) during migration period
"once:conf_private.py is deprecated:DeprecationWarning",
# caldav.jmap is deprecated in favour of the standalone calendaring-jmap
# package (see caldav/jmap/__init__.py); show it once, not as an error
"once:caldav.jmap is deprecated:DeprecationWarning",
# Zimbra test server uses HTTPS with self-signed cert (ssl_verify_cert=False)
"ignore:Unverified HTTPS request:urllib3_future.exceptions.InsecureRequestWarning",
]
## Changelog fragments: changes/README.md explains the file naming, and
## docs/design/RELEASE-HOWTO.md how they are merged into CHANGELOG.md.
[tool.towncrier]
directory = "changes"
filename = "CHANGELOG.md"
template = "changes/template.md.jinja"
start_string = "<!-- towncrier release notes start -->\n"
## The title, "## [{version}] - {date}", is rendered by the template
title_format = false
issue_format = "https://github.com/python-caldav/caldav/issues/{issue}"
## editor leftovers too, as an unknown file name aborts the build
ignore = ["README.md", "template.md.jinja", "*~", ".#*", "#*#"]
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking changes"
showcontent = true
[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true
[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true
[[tool.towncrier.type]]
directory = "removed"
name = "Removed"
showcontent = true
[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true
[[tool.towncrier.type]]
directory = "security"
name = "Security"
showcontent = true
[[tool.towncrier.type]]
directory = "tests"
name = "Tests and documentation"
showcontent = true