Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
65 lines (55 loc) · 2.25 KB
/
Copy pathpyproject.toml
File metadata and controls
65 lines (55 loc) · 2.25 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
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"
[project]
name = "things.py"
description = "A simple Python 3 library to read your Things app data."
readme = "README.md"
requires-python = ">=3.11"
authors = [{ name = "Alexander Willner, Michael B.", email = "alex@willner.ws" }]
urls = { Homepage = "https://github.com/thingsapi/things.py" }
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Natural Language :: English",
]
dependencies = []
dynamic = ["version"]
[tool.setuptools.dynamic]
version = { attr = "things.__version__" }
[tool.setuptools.packages.find]
where = ["."]
include = ["things*", "tests*"]
# Ruff configuration: target the oldest supported version
# (pyproject.toml: requires-python >= 3.11, CI tests 3.11+).
# This allows modern annotation syntax (PEP 585/604).
[tool.ruff]
target-version = "py311"
line-length = 88
[tool.ruff.lint]
# E/W mirror the old flake8/pycodestyle setup (E501 and friends stay ignored:
# layout is owned by `ruff format`). I/D take over isort/pydocstyle, C901
# takes over flake8 max-complexity, UP keeps the annotations modern.
select = ["E", "W", "F", "I", "D", "UP", "C901", "TRY"]
# TRY004 wants TypeError instead of ValueError for wrong types. ValueError
# is part of the API contract here: things/api.get() catches ValueError
# and the tests expect it.
# The D-ignores mirror the old pydocstyle section from setup.cfg. D417 and
# TRY003 are new: ruff is stricter than the tools it replaces here, and both
# touch the public API shape (docstring/kwargs style, exception classes),
# so they stay off instead of churning user-visible code.
ignore = ["TRY004", "TRY003", "E501", "E203", "E231", "E241", "E202", "D102", "D212", "D213", "D413", "D203", "D409", "D405", "D406", "D407", "D417"]
[tool.ruff.lint.isort]
force-sort-within-sections = true
lines-after-imports = 2
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.isort]
force_sort_within_sections = true
lines_after_imports = 2
[tool.pylint."MESSAGES CONTROL"]
disable = ["missing-function-docstring", "C0412"]
[tool.pytest.ini_options]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "ELLIPSIS"]