-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
executable file
·240 lines (201 loc) · 6.17 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
[tool.poetry]
name = "mylearn"
version = "0.0.3"
description = "mylearn: my Machine Learning framework"
license = "MIT"
authors = [
"Michael Karpe <[email protected]>"
]
readme = "README.md"
repository = "https://github.com/MichaelKarpe/mylearn"
homepage = "https://github.com/MichaelKarpe/mylearn"
keywords = ["airflow", "mlflow"]
classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
]
[tool.poetry.dependencies]
python = "^3.9,<3.12" # Compatible python versions must be declared here
apache-airflow = {version = "^2.8.0", extras = ["postgres"]}
llvmlite = "^0.41.1"
numba = "^0.58.1"
mlflow = {version = "^2.9.2", extras = ["pipelines"]}
pandas = "^2.1.4"
# patito = "^0.5.1"
polars = "^0.20.1"
psycopg2-binary = "^2.9.9"
[tool.poetry.group.clustering.dependencies]
k-means-constrained = "^0.7.2"
[tool.poetry.group.compvis.dependencies]
opencv-python = "^4.7.0.72"
# scikit-image = "^0.20.0"
[tool.poetry.group.dl.dependencies]
# torch = "^2.0.0"
accelerate = "^0.25.0"
bitsandbytes = "^0.41.3"
transformers = "^4.36.2"
[tool.poetry.group.geo.dependencies]
geopandas = "^0.14.1"
[tool.poetry.group.gbms.dependencies]
lightgbm = "^4.1.0"
xgboost = "^2.0.3"
[tool.poetry.group.linux.dependencies]
nmcli = "^1.3.0"
[tool.poetry.group.misc.dependencies]
youtube-transcript-api = "^0.6.1"
[tool.poetry.group.ml.dependencies]
hyperopt = "^0.2.7"
mapie = "^0.7.0"
optuna = "^3.5.0"
scikit-learn = "^1.3.2"
[tool.poetry.group.nlp.dependencies]
spacy = "^3.7.2"
sentencepiece = "^0.1.99"
[tool.poetry.group.plotting.dependencies]
matplotlib = "^3.8.2"
plotly = "^5.18.0"
seaborn = "^0.13.0"
[tool.poetry.group.sci.dependencies]
scipy = "^1.11.4"
fastcluster = "^1.2.6"
[tool.poetry.group.scraping.dependencies]
beautifulsoup4 = "^4.11.1"
requests = "^2.28.1"
scrapy = "^2.8.0"
[tool.poetry.group.stats.dependencies]
# statsmodels = "^0.13.5"
statsforecast = "^1.5.0"
[tool.poetry.group.timeseries.dependencies]
arch = "^5.3.1"
# neuralprophet = "^0.5.4"
prophet = "^1.1.2"
# sktime = "^0.16.1"
[tool.poetry.group.qfinance.dependencies]
alphalens-reloaded = "^0.4.3"
empyrical-reloaded = "^0.5.9"
pyfolio-reloaded = "^0.9.5"
pyod = "^1.0.9"
quantstats = "^0.0.59"
[tool.poetry.group.qscraping.dependencies]
yfinance = "^0.1.79"
[tool.poetry.dev-dependencies]
black = {version = "^23.12.0", extras = ["jupyter"]}
flake8 = "^5.0.4"
ipython-autotime = "^0.3.1"
isort = "^5.10.1"
jupyterlab = "^3.4.5"
mypy = "^1.1.1"
pandas-stubs = "^1.5.3.230304"
pip = "^23.0.1"
poethepoet = "^0.16.0"
pre-commit = "^2.20.0"
pylint = "^2.15"
pytest = "^7.1.2"
pytest-cov = "^3.0"
types-requests = "^2.28.11.1"
tox = "^4.11.4"
tox-gh-actions = "^3.1.3"
[tool.poe.env]
AIRFLOW_HOME = "${PWD}/mlairflow"
AIRFLOW__CORE__LOAD_EXAMPLES = "false"
AIRFLOW__CORE__DEFAULT_TIMEZONE = "Europe/Amsterdam"
AIRFLOW__CORE__EXECUTOR = "LocalExecutor"
AIRFLOW__CORE__MAX_ACTIVE_RUNS_PER_DAG = "1"
AIRFLOW__CORE__MAX_ACTIVE_TASKS_PER_DAG = "1"
AIRFLOW__CORE__MAX_MAP_LENGTH = "65536"
AIRFLOW__CORE__PARALLELISM = "1"
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN = "postgresql+psycopg2://airflow:airflow@localhost:5432/airflow"
AIRFLOW__SCHEDULER__CATCHUP_BY_DEFAULT = "False"
AIRFLOW__SCHEDULER__PARSING_PROCESSES = "1"
AIRFLOW__SCHEDULER__PRINT_STATS_INTERVAL = "0"
AIRFLOW__SCHEDULER__SCHEDULER_HEARTBEAT_SEC = "1"
CODE_FOLDERS = "mlairflow/dags mylearn" # mlflow tests
MLFLOW_RECIPES_PROFILE = "local"
[tool.poe.tasks.airflow-clean]
sequence = [
{shell = "rm -r mlairflow/logs"},
{shell = "rm mlairflow/airflow.cfg"},
{shell = "rm mlairflow/airflow.db"}, # comment this line if Airflow LocalExecutor and database are uncommented above
{shell = "rm mlairflow/webserver_config.py"},
]
[tool.poe.tasks.airflow-init]
sequence = [
{cmd = "airflow db init"},
{cmd = """
airflow users create --role Admin --username admin --email admin --firstname admin --lastname admin --password admin
"""},
]
[tool.poe.tasks.airflow-scheduler]
cmd = "airflow scheduler"
[tool.poe.tasks.airflow-webserver]
cmd = "airflow webserver --port 8080"
[tool.poe.tasks.mlflow-run]
shell = """
cd mlairflow
mlflow recipes run --step ingest --profile $MLFLOW_RECIPES_PROFILE
mlflow recipes run --step split --profile $MLFLOW_RECIPES_PROFILE
mlflow recipes run --step transform --profile $MLFLOW_RECIPES_PROFILE
mlflow recipes run --step train --profile $MLFLOW_RECIPES_PROFILE
mlflow recipes run --step evaluate --profile $MLFLOW_RECIPES_PROFILE
mlflow recipes run --step register --profile $MLFLOW_RECIPES_PROFILE
"""
[tool.poe.tasks.mlflow-ui]
cmd = """
mlflow ui \
--backend-store-uri sqlite:///metadata/mlflow/mlruns.db \
--default-artifact-root ./metadata/mlflow/mlartifacts \
--host localhost
--port 5000
"""
[tool.poe.tasks.black]
cmd = "black ${CODE_FOLDERS} -l 120"
[tool.poe.tasks.export-requirements]
cmd = "poetry export -f requirements.txt --output requirements.txt --without-hashes"
[tool.poe.tasks.flake8]
cmd = "flake8 --config=config/flake8.ini ${CODE_FOLDERS}"
[tool.poe.tasks.isort]
cmd = "isort ${CODE_FOLDERS}"
[tool.poe.tasks.mypy]
cmd = "mypy ${CODE_FOLDERS} --ignore-missing-imports"
[tool.poe.tasks.reinstall]
sequence = [
{cmd = "poetry lock"},
{cmd = "poetry install"},
{cmd = "poe export-requirements"},
]
[tool.poe.tasks.test]
cmd = "pytest tests"
[tool.poe.tasks.checks]
sequence = [
{cmd = "poe black"},
{cmd = "poe isort"},
{cmd = "poe mypy"},
# {cmd = "poe test"}
]
[tool.black]
line-length = 120
[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{39,310,311}-{linux,macos,windows}
isolated_build = true
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
windows-latest: windows
[testenv]
skip_install = true
allowlist_externals = poetry
commands_pre = poetry install
commands = poetry run pytest tests
"""
[build-system]
requires = ["poetry-core>=1.5.2"]
build-backend = "poetry.core.masonry.api"