forked from Future-House/paper-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
199 lines (185 loc) · 6.7 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
[build-system]
build-backend = "setuptools.build_meta"
# Pin to 62.6 for support from reading requirements from requirements.txt
requires = ["setuptools >= 62.6.0"]
[project]
authors = [
{email = "[email protected]", name = "Andrew White"},
]
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python",
]
dependencies = [
"PyCryptodome",
"html2text",
"numpy",
"openai>=1",
"pydantic>=2",
"pypdf",
"tiktoken>=0.4.0",
]
description = "LLM Chain for answering questions from docs"
dynamic = ["optional-dependencies"]
keywords = ["question answering"]
license = {file = "LICENSE"}
maintainers = [
{email = "[email protected]", name = "James Braza"},
{email = "[email protected]", name = "Andrew White"},
]
name = "paper-qa"
readme = "README.md"
requires-python = ">=3.8"
urls = {repository = "https://github.com/whitead/paper-qa"}
version = "4.6.0"
[tool.codespell]
check-filenames = true
check-hidden = true
# SEE: https://github.com/codespell-project/codespell/issues/1212#issuecomment-1744768533
ignore-regex = ".{1024}|.*codespell-ignore.*"
ignore-words-list = "aadd,ser"
[tool.mypy]
# Type-checks the interior of functions without type annotations.
check_untyped_defs = true
# Allows enabling one or multiple error codes globally. Note: This option will
# override disabled error codes from the disable_error_code option.
enable_error_code = [
"ignore-without-code",
"mutable-override",
"redundant-cast",
"redundant-expr",
"redundant-self",
"truthy-bool",
"truthy-iterable",
"unreachable",
"unused-awaitable",
"unused-ignore",
]
# Shows a short summary line after error messages.
error_summary = false
# Use visually nicer output in error messages: use soft word wrap, show source
# code snippets, and show error location markers.
pretty = true
# Shows column numbers in error messages.
show_column_numbers = true
# Shows error codes in error messages.
# SEE: https://mypy.readthedocs.io/en/stable/error_codes.html#error-codes
show_error_codes = true
# Prefixes each error with the relevant context.
show_error_context = true
# Warns about casting an expression to its inferred type.
warn_redundant_casts = true
# Shows a warning when encountering any code inferred to be unreachable or
# redundant after performing type analysis.
warn_unreachable = true
# Warns about per-module sections in the config file that do not match any
# files processed when invoking mypy.
warn_unused_configs = true
# Warns about unneeded `# type: ignore` comments.
warn_unused_ignores = true
[[tool.mypy.overrides]]
# Suppresses error messages about imports that cannot be resolved.
ignore_missing_imports = true
# Per-module configuration options
module = [
"fitz",
"pyzotero", # SEE: https://github.com/urschrei/pyzotero/issues/110
"sentence_transformers", # SEE: https://github.com/UKPLab/sentence-transformers/issues/1723
]
[tool.pytest.ini_options]
# List of directories that should be searched for tests when no specific directories,
# files or test ids are given in the command line when executing pytest from the rootdir
# directory. File system paths may use shell-style wildcards, including the recursive **
# pattern.
testpaths = ["tests"]
[tool.ruff]
# Line length to use when enforcing long-lines violations (like `E501`).
line-length = 120
# Enable application of unsafe fixes.
unsafe-fixes = true
[tool.ruff.lint]
# List of rule codes that are unsupported by Ruff, but should be preserved when
# (e.g.) validating # noqa directives. Useful for retaining # noqa directives
# that cover plugins not yet implemented by Ruff.
ignore = [
"ANN", # Don't care to enforce typing
"BLE001", # Don't care to enforce blind exception catching
"COM812", # Trailing comma with black leads to wasting lines
"D100", # D100, D101, D102, D103, D104, D105, D106, D107: don't always need docstrings
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
"D203", # Keep docstring next to the class definition (covered by D211)
"D212", # Summary should be on second line (opposite of D213)
"D402", # It's nice to reuse the method name
"D406", # Google style requires ":" at end
"D407", # We aren't using numpy style
"D413", # Blank line after last section. -> No blank line
"DTZ", # Don't care to have timezone safety
"EM", # Overly pedantic
"ERA001", # Don't care to prevent commented code
"FBT001", # FBT001, FBT002: overly pedantic
"FBT002",
"FIX", # Don't care to prevent TODO, FIXME, etc.
"FLY002", # Can be less readable
"G004", # f-strings are convenient
"INP001", # Can use namespace packages
"N803", # Want to use 'N', or 'L',
"N806", # Want to use 'N', or 'L',
"PLR0913",
"PTH", # Overly pedantic
"S311", # Ok to use python random
"SLF001", # Overly pedantic
"T201", # Overly pedantic
"TCH001", # TCH001, TCH002, TCH003: don't care to enforce type checking blocks
"TCH002",
"TCH003",
"TD002", # Don't care for TODO author
"TD003", # Don't care for TODO links
"TID252", # Allow relative imports for packaging
"TRY003", # Overly pedantic
]
select = ["ALL"]
unfixable = [
"B007", # While debugging, unused loop variables can be useful
"ERA001", # While debugging, temporarily commenting code can be useful
"F401", # While debugging, unused imports can be useful
"F841", # While debugging, unused locals can be useful
]
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"PLR2004", # Tests can have magic values
"S101", # Tests can have assertions
]
[tool.ruff.lint.pycodestyle]
# The maximum line length to allow for line-length violations within
# documentation (W505), including standalone comments.
max-doc-length = 120 # Match line-length
[tool.ruff.lint.pydocstyle]
# Whether to use Google-style or NumPy-style conventions or the PEP257
# defaults when analyzing docstring sections.
convention = "google"
[tool.setuptools.dynamic.optional-dependencies.dev]
file = ["dev-requirements.txt"]
[tool.setuptools.packages.find]
include = ["paperqa*"]
[tool.tomlsort]
all = true
in_place = true
spaces_before_inline_comment = 2 # Match Python PEP 8
spaces_indent_inline_array = 4 # Match Python PEP 8
trailing_comma_inline_array = true