-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpyproject.toml
214 lines (189 loc) · 6.41 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "cs_tools"
dynamic = ["version"]
description = "Scale your ThoughtSpot adoption with tools created by the ThoughtSpot Solutions Consulting organization."
readme = "README.md"
requires-python = ">= 3.9.2"
license = {file = "LICENSE"}
authors = [
{name = "boonhapus", email="[email protected]"},
{name = "billdback-ts", email="[email protected]"},
{name = "devinmcpherson-ts", email="[email protected]"},
{name = "mishathoughtspot", email="[email protected]"},
]
maintainers = [
{name = "boonhapus", email="[email protected]"},
]
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"Operating System :: OS Independent",
"License :: Other/Proprietary License",
"Programming Language :: Python :: 3 :: Only",
"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",
]
dependencies = [
# dependencies here are listed for cs_tools the library (ie. import cs_tools)
"aiosqlite",
"thoughtspot-tml",
"awesomeversion",
"httpx >= 0.27.0",
"pydantic >= 2.6.4",
"pydantic-settings",
"email-validator",
"rich >= 13.7.1",
"sqlmodel >= 0.0.16",
"tenacity",
"toml",
"packaging",
# TODO: https://github.com/thoughtspot/thoughtspot_tml/issues/24
"betterproto[compiler] == 2.0.0b6",
# OS-specific
"tzdata; platform_system == 'Windows'",
# version specific
"typing_extensions; python_version < '3.10.0'",
"exceptiongroup; python_version < '3.11.0'",
"strenum; python_version < '3.11.0'",
"taskgroup; python_version < '3.11.0'",
]
[project.urls]
homepage = "https://thoughtspot.github.io/cs_tools/"
repository = "https://github.com/thoughtspot/cs_tools"
bug_tracker = "https://github.com/thoughtspot/cs_tools/issues"
documentation = "https://thoughtspot.github.io/cs_tools/"
[project.scripts]
cs_tools = "cs_tools.cli.commands.main:run"
cstools = "cs_tools.cli.commands.main:run"
[project.optional-dependencies]
cli = [
# PIN THESE DEPENDENCIES EXPLICITLY SO WE CAN ENSURE THEY WORK ACROSS ENVIRONMENTS
# CLI
"prompt_toolkit == 3.0.47",
"typer == 0.12.0",
"uv == 0.5.13",
# TUI & WEB
"textual[syntax] == 1.0.0",
"textual-serve == 1.1.1",
]
dev = [
# CS Tools CLI
"cs_tools[cli]",
# DEVELOPMENT
"textual-dev >= 1.7.0",
# CODE QUALITY
"hatch",
"pre-commit",
"mypy",
"ruff",
# Testing
"coverage[toml]",
"pytest",
]
docs = [
# CS Tools CLI
"cs_tools[cli]",
# USED FOR GENERATING SAFE FILENAMES
"python-slugify[unidecode]",
# MARKDOWN TO STATIC SITE GENERATOR
"mkdocs-material",
# PLUGINS FOR MKDOCS
"mkdocs-redirects",
"mkdocs-open-in-new-tab",
]
[tool.hatch.envs.default.scripts]
# https://hatch.pypa.io/latest/how-to/environment/select-installer/#enabling-uv
installer = "uv"
[tool.hatch.version]
path = "cs_tools/__project__.py"
[tool.hatch.envs.dev.scripts]
setup = [
"pre-commit install",
"mypy --install-types --non-interactive",
"uv run python {root:}/cs_tools/updater/_bootstrapper.py --dev --reinstall"
]
test = [
"pytest"
]
lint = [
"ruff check --config pyproject.toml",
"ruff format --config pyproject.toml",
]
[tool.hatch.envs.docs.scripts]
serve = "mkdocs serve"
[tool.mypy]
plugins = ["pydantic.mypy"]
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
check_untyped_defs = true
strict_equality = true
strict_concatenate = true
[tool.ruff]
target-version = "py39"
line-length = 120
src = ["cs_tools", "tests"]
exclude = [
"__pycache__", # ignore compiled bytecode
".venv*", # ignore virtual environments
# project specific ignores
"__init__.py", # ignore __init__.py
"__project__.py", # ignore project metadata
"_compat.py", # ignore compatibles
"_version.py", # ignore _version.py
"_bootstrapper.py", # ignore bootstrapper
"const.py", # ignore const.py
]
[tool.ruff.lint]
select = [
"A", # flake8-builtins: https://pypi.org/project/flake8-builtins/
"ARG", # flake8-unused-arguments: https://pypi.org/project/flake8-unused-arguments/
"B", # flake8-bugbear: https://pypi.org/project/flake8-bugbear/
"C4", # flake8-comprehensions: https://pypi.org/project/flake8-comprehensions/
"COM", # flake8-commas: https://pypi.org/project/flake8-commas/
"DTZ", # flake8-datetimez: https://pypi.org/project/flake8-datetimez/
"E", # pycodestyle: https://pypi.org/project/pycodestyle/
"F", # pyflakes: https://pypi.org/project/pyflakes/
"FA", # flake8-future-annotations: https://pypi.org/project/flake8-future-annotations/
"I", # isort: https://pypi.org/project/isort/
"Q", # flake8-quotes: https://pypi.org/project/flake8-quotes/
"RUF", # ruff-specific: https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf
"T20", # flake8-print: https://pypi.org/project/flake8-print/
"TCH", # flake8-type-checking: https://pypi.org/project/flake8-type-checking/
]
ignore = [
"A002", # Function argument `<variable>` is shadowing a Python builtin
"B008", # Checks for function calls in default function arguments.
"COM812", # Checks for the absence of trailing commas.
"TC001", # Moves imports into the TYPE_CHECKING block, hurting Pydantic, SQLModel
"TC002", # Moves imports into the TYPE_CHECKING block, hurting Pydantic, SQLModel
"TC003", # Moves imports into the TYPE_CHECKING block, hurting Pydantic, SQLModel
]
[tool.ruff.lint.flake8-import-conventions.aliases]
datetime = "dt"
sqlalchemy = "sa"
sqlmodel = "sm"
# [tool.ruff.lint.flake8-type-checking]
# runtime-evaluated-base-classes = [
# "cs_tools.datastructures._GlobalModel",
# "cs_tools.datastructures._GlobalSettings",
# "cs_tools.datastructures.ValidatedSQLModel",
# "typer.params.Option",
# "typer.params.Argument",
# "pydantic.BaseModel",
# "pydantic_settings.BaseSettings",
# "sqlalchemy.orm.DeclarativeBase",
# "sqlmodel.SQLModel",
# ]
[tool.ruff.lint.isort]
combine-as-imports = true
force-wrap-aliases = true
from-first = true
required-imports = ["from __future__ import annotations"]