forked from posit-dev/querychat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
210 lines (192 loc) · 8.17 KB
/
pyproject.toml
File metadata and controls
210 lines (192 loc) · 8.17 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "querychat"
version = "0.2.2"
description = "Chat with your data using natural language"
readme = "pkg-py/README.md"
requires-python = ">=3.9"
license = { file = "pkg-py/LICENSE" }
authors = [
{ name = "Joe Cheng", email = "joe@posit.co" },
{ name = "Garrick Aden-Buie", email = "garrick@posit.co" },
{ name = "Dan Chen", email = "daniel.chen@posit.co" },
{ name = "Barret Schloerke", email = "barret@posit.co" }
]
maintainers = [
{ name = "Garrick Aden-Buie", email = "garrick@posit.co" }
]
dependencies = [
"duckdb",
"pandas",
"shiny",
"shinywidgets",
"htmltools",
"chatlas>=0.12.0",
"narwhals",
"chevron",
"sqlalchemy>=2.0.0", # Using 2.0+ for improved type hints and API
"shinychat>=0.2.8"
]
classifiers = [
"Programming Language :: Python",
"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",
"Programming Language :: Python :: 3.13",
]
[project.urls]
Homepage = "https://github.com/posit-dev/querychat" # TODO update when we have docs
Repository = "https://github.com/posit-dev/querychat"
Issues = "https://github.com/posit-dev/querychat/issues"
Source = "https://github.com/posit-dev/querychat/tree/main/pkg-py"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["pkg-py/src/querychat"]
[tool.hatch.build.targets.sdist]
include = ["pkg-py/src/querychat", "pkg-py/LICENSE", "pkg-py/README.md"]
[dependency-groups]
dev = ["ruff>=0.6.5", "pyright>=1.1.401", "tox-uv>=1.11.4", "pytest>=8.4.0"]
docs = ["quartodoc>=0.11.1"]
examples = [
"openai",
"palmerpenguins>=0.1.4",
"seaborn",
]
[tool.ruff]
src = ["pkg-py/src/querychat"]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"app-*.py", # ignore example apps for now
"app.py",
"examples", # ignore example apps for now
]
line-length = 88
indent-width = 4
target-version = "py39"
[tool.ruff.lint]
extend-ignore = [
"A002", # Shadowing a built-in
"ARG001", # Unused argument
"D200", # One-line docstring should fit on one line with quotes
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
"E501", # Line too long
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"PLR0913", # Too many arguments in function definition
"PLR0915", # Too many statements in function
"RET504", # Unnecessary assignment to `{name}` before `return` statement
"RET505", # Unnecessary branch after `return` statement
"UP007", # Use `X | Y` for type annotations (or Optional[X])
# This package trusts the user
"S608", # Possible SQL injection vector through string-based query construction
# TODO: Remove in the future, when we have docstrings.
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D104", # Missing docstring in public package
"D107", # Missing docstring in __init__
"D205", # 1 blank line required between summary line and description
"UP045", # Use `X | NULL` for type annotations, not `Optional[X]`
"TD003", # TODO doesn't need to have an issue link
"COM812", # conflicts with formatter
]
extend-select = [
# "C90", # C90; mccabe: https://docs.astral.sh/ruff/rules/complex-structure/
"ASYNC", # ASYNC; flake8-async: https://docs.astral.sh/ruff/rules/#flake8-async-async
"S", # S; flake8-bandit: https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"FBT", # FBT; flake8-boolean-trap: https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"B", # B; flake8-bugbear: https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"A", # A; flake8-builtins: https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"COM", # COM; Commas: https://docs.astral.sh/ruff/rules/#flake8-commas-com
"C4", # C4; flake8-comprehensions: https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"DTZ", # DTZ; flake8-datetimez: https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"T10", # T10; flake8-dbugger: https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"FA", # FA; flake8-future-annotations: https://docs.astral.sh/ruff/rules/#flake8-future-annotations-fa
"ISC", # ISC; flake8-implicit-str-concat: https://docs.astral.sh/ruff/rules/#flake8-implicit-str-concat-isc
"ICN", # ICN; flake8-import-conventions: https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"PIE", # PIE; flake8-pie: https://docs.astral.sh/ruff/rules/#flake8-pie-pie
"PYI", # PYI; flake8-pyi : https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PT", # PT; flake8-pytest-style: https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
"Q", # Q; flake8-quotes: https://docs.astral.sh/ruff/rules/#flake8-quotes-q
"RET", # RET; flake8-return: https://docs.astral.sh/ruff/rules/#flake8-return-ret
"SIM", # SIM; flake8-simplify: https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"TID253", # banned-module-level-imports: https://docs.astral.sh/ruff/rules/banned-module-level-imports/#banned-module-level-imports-tid253
"TC", # TC; flake8-type-checking: https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"TD", # TD; flake8-todos: https://docs.astral.sh/ruff/rules/#flake8-todosimports-td
"ARG", # ARG; flake8-argparse: https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"PTH", # PTH; flake8-use-pathlib: https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"I", # I; isort: https://docs.astral.sh/ruff/rules/#isort-i
"NPY", # NPY; NumPy-specific rules: https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
"PD", # PD; pandas-vet: https://docs.astral.sh/ruff/rules/#pandas-vet-pd
"N", # N; pep8-naming: https://docs.astral.sh/ruff/rules/#pep8-naming-n
"PERF", # PERF; flake8-performance: https://docs.astral.sh/ruff/rules/#flake8-performance-perf
"E", # E; pycodestyle: https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"W", # W; pycodestyle: https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
"D", # D; pydocstyle: https://docs.astral.sh/ruff/rules/#pydocstyle-d
"F", # F; Pyflakes: https://docs.astral.sh/ruff/rules/#pyflakes-f
"PGH", # PGH; pygrep-hooks: https://docs.astral.sh/ruff/rules/#pygrep-hooks-pgh
"PL", # PL; pylint: https://docs.astral.sh/ruff/rules/#pylint-pl
"UP", # UP; pyupgrade: https://docs.astral.sh/ruff/rules/#pyupgrade-up
"FURB", # FURB; refurb: https://docs.astral.sh/ruff/rules/#refurb-furb
"RUF", # RUF; Ruff specific rules: https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# disable S101 (flagging asserts) for tests
[tool.ruff.lint.per-file-ignores]
"pkg-py/tests/*.py" = ["S101"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = "dynamic"
[tool.pyright]
include = ["pkg-py/src/querychat"]
# For more tox testing usage (in addition to typing), see:
# https://github.com/posit-dev/chatlas/blob/b91c020a555917c1be5ae2462496de25d82c529d/pyproject.toml#L122-L139
[tool.tox]
legacy_tox_ini = """
[tox]
env_list = py3{9,10,11,12}
isolated_build = True
[testenv]
package = wheel
wheel_build_env = .pkg
commands = pyright
"""