Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
190 lines (165 loc) · 6.09 KB
/
Copy pathpyproject.toml
File metadata and controls
190 lines (165 loc) · 6.09 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
[build-system]
requires = ["hatchling>=1.27", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "calendaring"
dynamic = ["version"]
description = "One Python API for calendars and task lists: CalDAV, iCalendar files and feeds, JMAP and issue trackers"
readme = "README.md"
requires-python = ">=3.11"
license = "GPL-3.0-or-later OR Apache-2.0"
license-files = ["COPYING.*"]
authors = [{ name = "Tobias Brox", email = "tobias@redpill-linpro.com" }]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Office/Business :: Scheduling",
"Typing :: Typed",
]
dependencies = [
"calendaring-config>=0.1",
# The files backend's lock on a single .ics file, on every platform.
"filelock>=3.12",
"icalendar>=7.3",
"icalendar-searcher>=1.1",
"recurring-ical-events>=3.8",
]
[project.optional-dependencies]
# 3.6: save(no_overwrite=True) sends If-None-Match: *, and save(raw_data=...) sends given bytes.
caldav = ["caldav>=3.7"]
# Embedded CalDAV servers the caldav backend's conformance tests run against.
# 3.7: caldav.testing, the registry of caldav's own test servers.
test-servers = ["caldav>=3.7", "xandikos>=0.2", "radicale>=3.2"]
# ruff and mypy are pinned exactly; keep ruff in step with .pre-commit-config.yaml.
# So is unasync: its output is committed, and the freshness test compares bytes.
dev = [
"calendaring[caldav,test-servers]",
"pytest>=8.0",
"pytest-asyncio>=1.0",
"pytest-xdist>=3.5",
"unasync==0.6.0",
"ruff==0.17.0",
"mypy==2.4.0",
"pre-commit>=4.0",
"towncrier>=25.8",
"coverage>=7.6",
]
[project.urls]
Repository = "https://github.com/pycalendar/calendaring"
Issues = "https://github.com/pycalendar/calendaring/issues"
Changelog = "https://github.com/pycalendar/calendaring/blob/main/docs/changelog.rst"
[tool.hatch.version]
source = "vcs"
# Only v<digit>* tags are releases. The default describe matches any tag
# containing a digit, so a date-stamped local tag on HEAD (a pre-rewrite
# backup, say) became the version and broke every 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 = "src/calendaring/_version.py"
[tool.hatch.build.targets.sdist]
# The prototypes are research for roadmap 0.2, not part of the package.
# tmp-* are the author's untracked scratch notes and must never be shipped.
exclude = ["/prototypes", "/.github", "/.claude", "tmp-*", "*~", "*.bak"]
[tool.ruff]
line-length = 120
target-version = "py311"
# The 0.2 prototypes are frozen research code with their own conventions, and
# the design documents align their code comments by hand. The specimens
# hold planted mistakes; tests/test_enforcement.py checks them on purpose.
extend-exclude = ["prototypes", "docs/design", "tests/specimens"]
# Also for files named on the command line, as pre-commit does: reformatting
# a generated _sync/ file would make the freshness test fail.
force-exclude = true
[tool.ruff.format]
# Generated by tools/generate_sync.py; unasync's renames change line lengths.
exclude = ["**/_sync/**"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "C4", "PT"]
ignore = ["E501"]
[tool.ruff.lint.per-file-ignores]
# Artefacts of unasync's token rewrite in generated code: renamed imports
# fall out of order, and "async for ... yield" becomes a plain loop.
"**/_sync/**" = ["I001", "UP028", "C416"]
[tool.ruff.lint.isort]
known-first-party = ["calendaring"]
[tool.mypy]
# The package ships py.typed and says Typing :: Typed, so CI checks it.
strict = true
# Check as the oldest supported Python, like ruff's target-version
python_version = "3.11"
files = ["src", "tests"]
# Planted mistakes, type-checked on purpose by tests/test_enforcement.py
exclude = ["^tests/specimens/"]
[[tool.mypy.overrides]]
# Partly annotated, but neither ships py.typed yet, so mypy would skip them.
module = ["icalendar_searcher.*", "recurring_ical_events.*"]
follow_untyped_imports = true
[[tool.mypy.overrides]]
# The sync code generator (roadmap 1.3); untyped, and a dev dependency only.
module = ["unasync"]
ignore_missing_imports = true
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
# Treat warnings as errors - tests should run clean (roadmap 1.3 demands it too)
filterwarnings = [
"error",
# A test server configured with ssl_verify_cert: false (caldav's Zimbra)
"ignore:Unverified HTTPS request:Warning",
]
norecursedirs = ["prototypes", "docs", "build"]
markers = [
"checks_refusal: a scenario story that, where no collection for its kind can be made, checks the refusal in one of another kind",
]
# The async tests need no marker, so the generated sync copy carries none.
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
[tool.towncrier]
# Same layout as calendaring-jmap, the pycalendar organisation's standard (D7).
directory = "news/"
filename = "docs/changelog.rst"
issue_format = "`#{issue} <https://github.com/pycalendar/calendaring/issues/{issue}>`_"
start_string = ".. towncrier release notes start\n"
title_format = "{version} ({project_date})"
underlines = ["-", "~", "`"]
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking changes"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Removals and deprecations"
showcontent = true
[[tool.towncrier.type]]
directory = "feature"
name = "New features"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug fixes"
showcontent = true
[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "deps"
name = "Dependency changes"
showcontent = true
[[tool.towncrier.type]]
directory = "internal"
name = "Internal changes"
showcontent = true
[[tool.towncrier.type]]
directory = "chore"
name = "Other tasks"
showcontent = true
[[tool.towncrier.type]]
directory = "security"
name = "Security fixes"
showcontent = true