-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
181 lines (160 loc) · 5.56 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
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
[tool.poetry]
name = "libpdf"
version = "0.1.0"
description = "Extract structured data from PDFs."
authors = [
"Marco Heinemann <[email protected]>",
]
maintainers = [
"Jui-Wen Chen <[email protected]>",
"Haiyang Zhang <[email protected]>",
]
license = 'MIT'
readme = 'README.rst'
homepage = 'http://pypi.python.org/pypi/libpdf'
repository = 'http://github.com/useblocks/libpdf'
documentation = 'http://libpdf.readthedocs.io/en/latest'
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing',
'Topic :: Utilities',
]
include = [
'deps/*'
]
[tool.poetry.dependencies]
python = "^3.8"
chardet = "^4"
click = "^8"
PyYAML = "^6"
"ruamel.yaml" = "^0.17"
# optional deps for progress bars
tqdm = { version = "^4.50.0", optional = true }
colorama = { version = "^0.4.4", optional = true }
# dependencies needed by pdfminer.six and pdfplumber which are deliverd as wheels in the deps folder
# the libs were patched and no upstream PR has been raised yet
# see [tool.poetry.dev-dependencies] for the forked libraries
pycryptodome = "^3.9.9"
sortedcontainers = "^2.3.0"
pillow = "~9.0.1" # cannot go higher because of this bug https://github.com/jsvine/pdfplumber/discussions/637
unicodecsv = "^0.14.1"
wand = "^0.6.5"
# optional deps for docs, needed to make RTD work with pyproject.toml
# see https://github.com/readthedocs/readthedocs.org/issues/4912#issuecomment-664002569
sphinx = { version = "*", optional = true }
sphinx_rtd_theme = { version = "*", optional = true }
sphinxcontrib-plantuml = { version = "*", optional = true }
[tool.poetry.extras]
tqdm = ["tqdm"]
colorama = ["colorama"]
docs = ["sphinx", "sphinx_rtd_theme", "sphinxcontrib-plantuml"]
[tool.poetry.dev-dependencies]
# forked libraries;
# they must be dev deps so make them invisible to PyPI and the egg/wheel requires section
# 'poetry install' installs those by default, so the Git deps are actually used instead of the wheels in the deps
# folder; see also libpdf/_import_forks.py
pdfplumber = { git = "https://github.com/useblocks/pdfplumber.git" }
"pdfminer.six" = {git = "https://github.com/useblocks/pdfminer.six", rev = "develop"}
# testing
pytest = "^7"
pytest-cov = "*"
tox = "*"
pytest-xdist = "*" # parallelisation
# linting, formatting
ruff = "^0.2.0"
# docs
sphinx = "*"
sphinx_rtd_theme = "*"
sphinxcontrib-plantuml = "*"
[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv",
]
# use Black's default
line-length = 88
# lint according to oldest supported version
target-version = "py38"
# try out unstable rules, fixes, and formatting
# changes are reviewed anyway
preview = true
[tool.ruff.lint]
# concept: select all rules by default and ignore unwanted (maybe just per file)
# this comes at a cost: new added rules are applied automatically, so a CI that
# runs green today might fail tomorow in case ruff gets updated
# (which brings more good than bad)
# TODO ENABLE NEXT LINE
select = ["ALL"]
# select = [] # commented out (don't want to fix all issues with this PR)
ignore = [
"COM812", # may conflict with Ruff formatter
"D107", # undocumented-public-init - commonly the docstring provides no helpful information
"D203", # D203 and D211 are mutually exclusive: https://github.com/PyCQA/pydocstyle/issues/141
"D212", # D212 and D213 are mutually exclusive: https://stackoverflow.com/a/45990465
"FIX002", # line-contains-todo - TODOs are considered helpful
"ISC001", # may conflict with Ruff formatter
"TD003", # missing-todo-link - no big processes for us
"ANN101", # missing-type-self - infer typing is simple for this library
"CPY001", # missing-copyright-notice - specified on project level
"FBT001", # boolean-type-hint-positional-argument - good message, but need a concept how to deal with this
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = [
"D400", # ends-in-period - dangerous to use (ruff may confuse summary line and content)
"ERA001", # commented-out-code - commented code is commonly there for a reason
]
[tool.ruff.lint.pylint]
max-args = 8
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true # no init return type needed if at least one arg is annotated
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.per-file-ignores]
# "docs/conf.py" = ["E402"]
"**/__init__.py" = [
"D104",
] # Missing docstring in public package - not needed for inits
"tests/**/*.py" = [
"S101", # Use of `assert` detected
]
[tool.poetry.scripts]
libpdf = 'libpdf.core:main_cli'
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"