forked from py-pdf/pdfly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
146 lines (135 loc) · 5.5 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
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "pdfly"
authors = [{ name = "Martin Thoma", email = "[email protected]" }]
maintainers = [{ name = "Martin Thoma", email = "[email protected]" }]
description = "A pure-python CLI application to manipulate PDF files"
readme = "README.md"
dynamic = ["version"]
license = { file = "LICENSE" }
requires-python = ">=3.6.1"
# https://pypi.org/pypi?%3Aaction=list_classifiers
classifiers = [
"Development Status :: 1 - Planning",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"pypdf>=3.8.2",
"typer>=0.9.0",
"pillow",
"pydantic",
"rich",
"fpdf2",
]
[project.urls]
Source = "https://github.com/py-pdf/pdfly"
[project.scripts]
pdfly = "pdfly.cli:entry_point"
[tool.pytest.ini_options]
addopts = "--disable-socket --doctest-modules --cov=. --cov-report html:tests/reports/coverage-html --cov-report term-missing --ignore=docs/ --durations=3 --timeout=30"
doctest_encoding = "utf-8"
testpaths = ["tests"]
[tool.black]
line-length = 79
[tool.isort]
line_length = 79
indent = ' '
multi_line_output = 3
include_trailing_comma = true
known_third_party = ["pytest", "setuptools"]
[tool.ruff]
line-length = 120
select = ["ALL"]
ignore = [
"D404", # First word of the docstring should not be "This"
# I would like to have it, but there are a few annoying exceptions:
"D401", # First line of docstring should be in imperative mood - false positives
"ERA001",
"UP031",
"D205", # 1 blank line required between summary line and description
"D400", # First line should end with a period
"D415", # First line should end with a period
# Introduces bugs
"RUF001", "RUF002", "RUF005",
"ARG",
"DTZ001", # The use of `datetime.datetime()` without `tzinfo` is necessary
# Personal preference
"D406", # Section name should end with a newline ("Returns")
"D212", # I want multiline-docstrings to start at the second line
"D407", # google-style docstrings don't have dashses
"N806", # Variable `NO` in function should be lowercase
"N814", # Camelcase `PageAttributes` imported as constant `PG`
"N817", # CamelCase `PagesAttributes` imported as acronym `PA`
"ANN101", # annotating 'self' seems weird (at least before 3.11)
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN204", # Missing return type annotation for special method `__init__`
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"BLE", # we want to capture Exception sometimes
"COM812", # yes, they make the diff smaller
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D203", # one-blank-line-before-class
"EM", # exception messages
"G004", # f-string in logging statement
"RET",
"S110", # `try`-`except`-`pass` detected, consider logging the exception
"SIM105", # contextlib.suppress
"SIM108", # don't enforce ternary operators
"SIM300", # yoda conditions
"TID252", # we want relative imports
"TRY", # I don't know what this is about
# As long as we are not on Python 3.9+
"UP035", # PEP 585
# As long as we are not on Python 3.10+
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` - PEP 604
# As long as we are not on Python 3.11+
"UP006", "UP007",
# for the moment, fix it later:
"T201", # print
"DTZ006", # datetime without timezone
"SIM115", # context handler for opening files
"A", # Variable is shadowing a built-in
"B904", # Within an `except` clause, raise exceptions with
"B905", # `zip()` without an explicit `strict=` parameter
"C901",
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D417", # Missing argument descriptions in the docstring
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
"FBT003", # Boolean positional value in function call
"PGH", # Use specific error messages
"PLE", # too many arguments for logging
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"PLR0915", # Too many statements
"PLR2004", # Magic value
"PLW", # global variables
"PT011", # `pytest.raises(ValueError)` is too broad, set the `match`
"PT012", # `pytest.raises()` block should contain a single simple statement
"PTH123", # `open()` should be replaced by `Path.open()`
"S101", # Use of `assert` detected
"SLF001", # Private member accessed
"INP001", # File `docs/conf.py` is part of an implicit namespace package. Add an `__init__.py`.
"FA100", # Missing `from __future__ import annotations`, but uses `typing.Optional`
]
[tool.ruff.mccabe]
max-complexity = 20 # Recommended: 10
[tool.ruff.per-file-ignores]
"sample-files/*" = ["D100", "INP001", "FA102", "I001"]
"make_release.py" = ["T201", "S603", "S607"]