-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
192 lines (158 loc) · 5.3 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
[tool.poetry]
name = "gapminder-ai-automation-ai"
version = "0.1.0"
description = "Secured API endpoints that enables AI automation workflows"
authors = ["Gapminder Foundation <info@gapminder.org>"]
readme = "README.md"
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
]
packages = [{ include = "lib" }]
[tool.poetry.dependencies]
python = ">=3.11,<3.12"
pandas = "^2.0.3"
mypy = "^1.9.0"
unidecode = "^1.3.6"
polars = "^0.19.12"
# for data frames schemas / types validation
pydantic = "^2.1.1"
pandera = {extras = ["mypy"], version = "^0.17.0"}
# to simplify development and deployment of cloud functions
functions-framework = "^3.0.0"
python-dotenv = "^0.20.0"
# for gsheets import/export
gspread = "^5.1.1"
gspread-dataframe = {git = "https://github.com/robin900/gspread-dataframe.git", rev="master"}
# for gdrive API consumption
google-auth = "^2.6.6"
google-api-python-client = "^2.45.0"
# typehints
types-requests = "^2.28.11.6"
# for logging that supports {variables} in brace format
bracelogger = "^1.1.0"
# for access to AI models
litellm = "^1.35"
# litellm = {git = "https://github.com/Gapminder/litellm", rev="gemini-provider-safety-settings"}
langchain = "^0.0.275"
# for hugging face
huggingface_hub = "^0.15.1"
# for google PaLM
google-generativeai = "^0.3.2"
# for iflytek
websocket-client = "^1.6.1"
# for alibaba
dashscope = "^1.6.0"
# yival
yival = {git = "https://github.com/Gapminder/YiVal.git", rev="gapminder-ai"}
redis = "^5.0.1"
# gemini
google-cloud-aiplatform = "^1.39.0"
# unsorted (new deps gets listed here)
langdetect = "^1.0.9"
duckdb = "^0.10.2"
duckdb-engine = "^0.12.0"
jupysql = "^0.10.10"
anthropic = {extras = ["vertex"], version = "^0.25.9"}
fireworks-ai = "^0.15.1"
[tool.poetry.dev-dependencies]
coverage = "^6.3.2"
freezegun = "^1.2.1"
poethepoet = "^0.13.1"
pre-commit = "^2.18.1"
pytest = "^7.2.0"
pytest-cov = "^4.0.0"
jupyter = "^1.0.0"
ipykernel = "^6.6.0"
jupytext = "^1.14.4"
pytest-mock = "^3.6.1"
[[tool.poetry.source]]
name = "pytorch_cpu"
url = "https://download.pytorch.org/whl/cpu"
priority = "explicit"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poe.tasks]
test = ["pytest", "lint"]
pytest = "pytest --cov=lib --verbose tests/"
lint = { shell = "find . -type d -name '.venv*' -prune -o -type f -name '*.py' -print0 | xargs -0 pre-commit run --files" }
install_kernel = "python -m ipykernel install --user --name gapminder-ai-automation-api"
set_jupytext_as_default_viewer = "jupytext-config set-default-viewer"
jupyter = 'jupyter-notebook'
notebooks = ["install_kernel", "set_jupytext_as_default_viewer", "jupyter"]
fetch_questions = "python yival_experiments/scripts/fetch_questions.py"
generate_result = "python yival_experiments/scripts/generate_result.py"
start_redis = "docker run --rm -p 26379:6379 --name local-redis redis redis-server --save 60 1 --loglevel warning"
[tool.poe.tasks.run_experiment]
shell = "cd yival_experiments && yival run --output ./output/$experiment ./experiment_configurations/$experiment.yaml"
help = "Run a yival experiment with a given name."
[[tool.poe.tasks.run_experiment.args]]
name = "experiment"
help = "Name of the experiment to run"
options = ["-e", "--experiment"]
[tool.poe.tasks.generate_experiment_config]
shell = "python yival_experiments/scripts/generate_experiment_config.py --evaluator $evaluator"
help = "generate experiment config, and set evaluator"
[[tool.poe.tasks.generate_experiment_config.args]]
name = "evaluator"
help = "Name of the evaluator"
options = ["-e", "--evaluator"]
default = "gpt4"
[tool.poe]
envfile = ".env"
[tool.ruff]
force-exclude = true
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"N", # pep8-naming
]
ignore = [
"E501", # line too long, handled by black
"N801", # FIXME: Incorrect pep8-naming conventions
"N802", # FIXME: Incorrect pep8-naming conventions
"N803", # FIXME: Incorrect pep8-naming conventions
"N806", # FIXME: Incorrect pep8-naming conventions
"N812", # FIXME: Incorrect pep8-naming conventions
"N815", # FIXME: Incorrect pep8-naming conventions
"N818", # FIXME: Incorrect pep8-naming conventions
"N999", # FIXME: Incorrect pep8-naming conventions
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
unfixable = []
# 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",
"*snapshots/",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.9.
target-version = "py39"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10