Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
383 lines (346 loc) · 12.4 KB
/
Copy pathpyproject.toml
File metadata and controls
383 lines (346 loc) · 12.4 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
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
377
378
379
380
381
382
383
#
# We use the pyproject.toml package specification.
# See https://packaging.python.org/en/latest/guides/section-build-and-publish/
# See https://github.com/collective/icalendar/issues/686
# See https://packaging.python.org/en/latest/specifications/pyproject-toml/
#
[build-system]
requires = ["hatchling>=1.27.0", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "icalendar"
license = "BSD-2-Clause"
license-files = ["LICENSE.rst"]
keywords = [
"calendar",
"calendaring",
"ical",
"icalendar",
"event",
"todo",
"journal",
"recurring",
"rfc5545",
]
# If an email address for the authors ever arises, then add it here.
# See https://github.com/collective/icalendar/pull/707#discussion_r1775275335
authors = [
{ name="Plone Foundation" },
]
maintainers = [
{ name="Nicco Kunzmann", email="niccokunzmann@rambler.ru" },
{ name="Sashank Bhamidi" },
{ name="Christian Geier" },
{ name="Jaca", email="vitouejj@gmail.com" },
]
# These attributes are dynamically generated by hatch-vcs
dynamic = [
"version"
]
description = "RFC 5545 compatible parser and generator of iCalendar files"
readme = { file = "README.rst", content-type = "text/x-rst" }
##
## When adjusting the Python Version, adjust also:
## - .github/workflows/tests.yml
## - .github/workflows/documentation.yml
## - the classifiers below
## - the documentation:
## - docs/contribute/development.rst
## - docs/how-to/upgrade.rst
## - dependencies - some are for compatibility and can be removed
## - tool.ruff.target-version
## - src/icalendar/compatibility.py
## - Makefile
##
requires-python = ">=3.10"
# see https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"python-dateutil",
# tzdata: IANA timezone database fallback for zoneinfo (required on Windows,
# provides current timezone data on all platforms)
"tzdata>=2025.3",
# typing.TypeIs was added in Python 3.13
# TODO: remove this dependency here and throughout code
# when we eventually drop support for Python 3.12.
"typing-extensions~=4.10; python_version < '3.13'",
]
# Static URLs for GitHub dependency graph compatibility
# See https://github.com/collective/icalendar/issues/1035
[project.urls]
Homepage = "https://icalendar.readthedocs.io/en/stable/"
Repository = "https://github.com/collective/icalendar"
Issues = "https://github.com/collective/icalendar/issues"
Documentation = "https://icalendar.readthedocs.io/en/stable/"
Changelog = "https://icalendar.readthedocs.io/en/stable/changelog.html"
Funding = "https://opencollective.com/python-icalendar"
# Local development dependencies
[dependency-groups]
dev = [
{include-group = "test"},
{include-group = "docs"},
{include-group = "formatting"},
"towncrier>=25.8.0",
"tox",
"tox-uv",
"zizmor==1.30.1", # also update .github/workflows/zizmor.yml
]
test = [
"coverage",
"hypothesis",
"mypy>=1.0",
"pytest",
"pytz>=2025.2",
"types-python-dateutil",
"types-pytz",
]
formatting = [
"ruff==0.15.2", # also update .pre-commit-config.yaml
"pre-commit",
]
docs = [
"pydata-sphinx-theme>=0.14.4",
"sphinx>=7",
"sphinx-autobuild>=2021.3.14",
"sphinx-autodoc-typehints",
"sphinx-copybutton>=0.5.2",
"sphinx-design>=0.5.0",
"sphinx-icalendar>=0.1.1",
"sphinx-issues>=5.0.1",
"sphinx-llms-txt>=0.7.1",
"sphinx-notfound-page>=1.1.0",
"sphinx-reredirects>=0.1.6",
"vale>=3.25.1",
]
[project.scripts]
icalendar = "icalendar.cli:main"
[tool.hatch.build]
exclude = [
"/.*", # Local tool and development configuration.
"/*.*", # Root project files; Hatch restores required package metadata.
"/build", # Python build output.
"/dist", # Release archives from an earlier build.
"/htmlcov", # Generated coverage report.
"/scripts", # Development scripts
"/src/icalendar/fuzzing", # Development-only fuzzing helpers.
]
[tool.hatch.build.targets.sdist.force-include]
# Tests for files included in the distribution reside here:
# src/icalendar/tests/test_create_release.sh
"funding.json" = "funding.json"
"generate_windows_to_olson_mapping.py" = "generate_windows_to_olson_mapping.py"
[tool.hatch.build.targets.wheel]
packages = ["src/icalendar"]
[tool.hatch.metadata.hooks.vcs.urls]
# Dynamic URLs for built packages (hatch-vcs replaces static [project.urls])
Homepage = "https://icalendar.readthedocs.io/en/stable/"
Repository = "https://github.com/collective/icalendar"
source_archive = "https://github.com/collective/icalendar/archive/{commit_hash}.zip"
Issues = "https://github.com/collective/icalendar/issues"
Documentation = "https://icalendar.readthedocs.io/en/stable/"
Changelog = "https://icalendar.readthedocs.io/en/stable/changelog.html"
Funding = "https://opencollective.com/python-icalendar"
[tool.hatch.version]
# This configuration allows us to use the version from the tags and dynamically generate
# version files. This speeds up the release process.
source = "vcs"
[tool.hatch.version.raw-options]
# see https://github.com/ofek/hatch-vcs/issues/43#issuecomment-1553065222
local_scheme = "no-local-version"
[tool.hatch.build.hooks.vcs]
version-file = "src/icalendar/_version.py"
[tool.hatch.metadata]
allow-direct-references = true
[tool.ruff]
target-version = "py310"
unsafe-fixes = true
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN", # flake8-annotations
"B020", # Loop control variable {name} overrides iterable it iterates
"C401", # Unnecessary generator (rewrite as a set comprehension)
"C901", # {name} is too complex ({complexity} > {max_complexity})
"COM812", # Trailing comma missing
"D1", # Missing docstring
"D2", # docstrings stuffs
"D4", # docstrings stuffs
"EM10", # Exception string usage
"ERA001", # Found commented-out code
"FBT002", # Boolean default positional argument in function definition
"FIX", # TODO comments
"ISC001", # Implicitly concatenated string literals on one line (to avoid with formatter)
"N818", # Exception name {name} should be named with an Error suffix
"PLR091", # Too many things (complexity, arguments, branches, etc...)
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"RUF012", # Mutable class attributes should be annotated with typing.ClassVar
"RUF015", # Prefer next({iterable}) over single element slice
"S101", # Use of assert detected
"TD", # TODO comments
"TRY003", # Avoid specifying long messages outside the exception class
"S104", # Possible binding to all interfaces
"E722", # Do not use bare `except`
"RUF005", # Consider iterable unpacking instead of concatenation
"DTZ005", # `datetime.datetime.now()` called without a `tz` argument
"PERF401", # Use a list comprehension to create a transformed list
"ARG002", # Unused method argument: ...
"ARG001", # Unused function argument: ...
"CPY001", # Files should start with a copyright notice
]
extend-safe-fixes = [
"PT006", # Wrong type passed to first argument of @pytest.mark.parametrize; expected {expected_string}
]
[tool.ruff.lint.per-file-ignores]
"src/icalendar/tests/**" = [
"B011", # Do not assert False (python -O removes these calls), raise AssertionError()
"B018", # useless expression, used to test property access errors
"DTZ001", # datetime.datetime() called without a tzinfo argument
"E501", # line too long
"E721", # comparing types with ==
"E741", # ambiguous variable name
"FBT001", # Boolean positional argument in function definition
"FBT003", # Boolean positional value in function call
"INP001", # implicit namespace package
"N802", # Function name {name} should be lowercase
"N803", # Argument name {name} for {param_type} should be lowercase
"N806", # Variable should be lowercase
"N999", # module name
"PLC0415", # import outside top-level - common in tests for isolation
"PT011", # pytest.raises({exception}) is too broad
"PT012", # pytest.raises() block should contain a single simple statement
"PT015", # Assertion always fails, replace with pytest.fail()
"PT027", # assertRaises
"RUF001", # String contains ambiguous character
"SIM300", # Yoda condition
"SLF001", # Private member accessed
"T201", # print found
"T203", # `pprint` found
]
"src/icalendar/tests/rfc_6321_xcal/**" = [
"S314", # unsafe XML parsing
]
"src/icalendar/cal/**" = [
"A002", # argument shadowing builtin (sorted)
"DTZ001", # datetime() called without tzinfo
"E501", # line too long (docstrings with RFC references)
"N802", # function name should be lowercase (TRIGGER_RELATED etc.)
"PERF203", # try-except in loop (parsing loop)
"PLW1641", # eq without hash (Component intentionally unhashable)
"PLW2901", # loop variable overwritten
"SLF001", # private member access
]
"src/icalendar/prop/**" = [
"A003", # class attribute shadowing builtin (vBinary.bytes, see #1289)
"DTZ001", # datetime() called without tzinfo
"DTZ007", # naive datetime from strptime
"E501", # line too long (docstrings with code examples)
"N801", # Class name should use CamelCase
"PERF203", # try-except in loop
"PLW1641", # eq without hash (mutable structured types)
"PLW2901", # loop variable overwritten
]
"src/icalendar/**" = [
"FBT001", # boolean positional argument
"FBT003", # boolean positional value in function call
"PLC0415", # import outside top-level (circular import avoidance)
]
"src/icalendar/fuzzing/*" = [
"T201", # print found
"N802", # Function name {name} should be lowercase
]
"docs/conf.py" = [
"INP001", # needs __init__.py
]
"src/icalendar/timezone/equivalent_timezone_ids_result.py" = [
"DTZ001", # `datetime.datetime()` called without a `tzinfo` argument
"E501", # line too long
]
"src/icalendar/timezone/equivalent_timezone_ids.py" = [
"T201", # print
"T203", # pprint
]
".github/workflows/test_generate_matrix.py" = [
"T201", # print
"INP001", # needs __init__.py
]
[tool.pytest.ini_options]
# see https://docs.pytest.org/en/6.2.x/customize.html
minversion = "6.0"
# see https://docs.pytest.org/en/6.2.x/reference.html?highlight=testpaths#confval-testpaths
testpaths = [
"src/icalendar/tests",
]
# see https://docs.pytest.org/en/6.2.x/reference.html?highlight=testpaths#confval-norecursedirs
norecursedirs = [
"src/icalendar/tests/hypothesis",
"build",
]
filterwarnings = [
"ignore::DeprecationWarning",
]
[tool.towncrier]
directory = "news/"
filename = "CHANGES.rst"
issue_format = "`Issue #{issue} <https://github.com/collective/icalendar/issues/{issue}>`_"
start_string = ".. towncrier release notes start\n"
title_format = "{version} ({project_date})"
# First underline is used for version/date header.
# Second underline is used for the type names (like 'Bug fixes:').
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 = false
[[tool.towncrier.type]]
directory = "security"
name = "Security fixes"
showcontent = true
[tool.uv]
python-preference = "managed"
[tool.uv.sources]
icalendar = { workspace = true, editable = true }
[tool.uv.workspace]
members = [
".",
]