-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
205 lines (167 loc) · 7.2 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
[tool.poetry]
name = "bp2022-ap1"
version = "0.1.0"
description = ""
authors = [
"Antony Kamp <[email protected]>",
"Max Lietze <[email protected]>",
"Luke Ortlam <[email protected]>",
"Anton Persitzky <[email protected]>",
"Christian Raue <[email protected]>",
"Lucas Reisener <[email protected]>"
]
readme = "README.md"
packages = [{include = "src"}]
[tool.poetry.dependencies]
python = "^3.10"
traci = "^1.16.0"
sumolib = "^1.16.0"
peewee = "^3.16.0"
peewee-migrate = "^1.6.6"
marshmallow = "^3.19.0"
psycopg2 = "^2.9.5"
interlocking = { git = "https://github.com/bp2022-ap1/interlocking.git", branch = "add-Poetry-support" }
flask = "^2.2.3"
webargs = "^8.2.0"
freezegun = "^1.2.2"
yaramo = { git = "https://github.com/bp2022-ap1/yaramo", branch = "refactor/replace-connected-nodes-with-edges" }
orm-importer = { git = "https://github.com/bp2022-ap1/orm-importer", branch = "refactor/replace-connected-nodes-edges" }
planpro-exporter = { git = "https://github.com/bp2022-ap1/planpro-exporter", branch = "refactor/replace-connected-nodes-edges" }
planpro-importer = { git = "https://github.com/bp2022-ap1/planpro-importer", branch = "refactor/replace-connected-nodes-edges" }
railway-route-generator = { git = "https://github.com/bp2022-ap1/railway-route-generator", branch = "refactor/replace-connected-nodes-edges" }
sumoexporter = { git = "https://github.com/bp2022-ap1/sumo-exporter", branch = "refactor/replace-connected-nodes-edges" }
track-signal-generator = { git = "https://github.com/bp2022-ap1/track-signal-generator.git", branch = "refactor/replace-connected-nodes-edges" }
pandas = "^2.0.0"
grafana-pandas-datasource = { git = "https://github.com/BP2022-AP1/grafana-pandas-datasource.git" }
matplotlib = "^3.7.1"
scipy = "1.9.2"
requests = "^2.31.0"
celery = "^5.2.7"
pytest-profiling = "^1.7.0"
pytest-split = "^0.8.1"
human-readable-ids = "^0.1.3"
[tool.poetry.group.dev.dependencies]
pytest = "^7.2.2"
black = "^23.1.0"
isort = "^5.12.0"
pylint = "^2.17.0"
poethepoet = "^0.19.0"
pytest-cov = "^4.0.0"
python-dotenv = "^1.0.0"
redis = "^4.4.4"
waitress = "^2.1.2"
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
sphinx = "6.2.0"
sphinx-book-theme = "1.0.1"
sphinxcontrib-openapi = "0.8.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poe.tasks]
sleep = "sleep 5"
[tool.poe.tasks.format-isort]
help = "Run isort on the code base"
cmd = "isort ."
[tool.poe.tasks.format-black]
help = "Run black on the code base"
cmd = "black ."
[tool.poe.tasks.format]
help = "Run formating tools on the code base"
sequence = ["format-isort", "format-black"]
[tool.poe.tasks.lint-src]
help = "Run lint in /src directory"
cmd = "pylint src --rcfile ./.github/workflows/.pylintrcsrc"
[tool.poe.tasks.lint-tests]
help = "Run lint in /tests directory"
cmd = "pylint tests --rcfile ./.github/workflows/.pylintrctests"
[tool.poe.tasks.lint]
help = "Run lint in /src and /tests directory"
sequence = ["lint-src", "lint-tests"]
[tool.poe.tasks.db-test]
help = "Call DB utilities for test database"
cmd = "python3 db/local/db.py"
envfile = ".env.test"
[tool.poe.tasks.db]
help = "Call DB utilities for dev and prod database"
cmd = "python3 db/local/db.py"
envfile = [".env.shared", ".env.secret"]
[tool.poe.tasks.test]
help = "Run DB and test with pytest"
sequence = ["test-deps", "test-pytest"]
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.test-lf]
help = "Run DB and test with pytest (only tests that failed last time)"
sequence = ["test-deps", "test-pytest --lf"]
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.test-ff]
help = "Run DB and test with pytest (tests that failed last time first)"
sequence = ["test-deps", "test-pytest --ff"]
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.test-nf]
help = "Run DB and test with pytest (new tests first)"
sequence = ["test-deps", "test-pytest --nf"]
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.test-ci]
help = "Run DB and test with pytest"
sequence = ["sleep", "db-test recreate", "test-pytest-ci"]
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.test-deps]
help = "Initializes needed components for tests"
sequence = ["test-docker-deps", "db-test recreate"]
[tool.poe.tasks.test-docker-deps]
help = "Initializes needed docker containers for tests"
cmd = "docker compose -f docker-compose.yaml -f docker-compose.test.yaml up -d grafana redis postgresql --wait"
[tool.poe.tasks.test-pytest]
help = "Run test with pytest"
cmd = "pytest --cov=src --cov-config=.coveragerc --cov-report xml --cov-append --durations=100 tests"
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.test-pytest-ci]
help = "Run test with pytest"
cmd = "pytest --cov=src --cov-config=.coveragerc --cov-report xml --cov-append --durations=100 --splits $CI_TOTAL --group $CI_INDEX --splitting-algorithm least_duration tests"
envfile = [".env.shared", ".env.test"]
[tool.poe.tasks.ci]
help = "Run formatting, linting and testing in preparation for CI"
sequence = ["format", "lint", "test"]
[tool.poe.tasks.dev]
help = "Run flask app in development mode and run db"
cmd = "docker compose -f docker-compose.yaml -f docker-compose.dev.yaml up dev"
[tool.poe.tasks.prod]
help = "Run flask app in development mode and run db"
cmd = "docker compose -f docker-compose.yaml -f docker-compose.prod.yaml up prod"
[tool.poe.tasks.gui]
help = "Run flask app in development mode with gui"
sequence = ["gui-deps", "sleep", "gui-flask"]
envfile = [".env.shared", ".env.dev", ".env.gui"]
[tool.poe.tasks.gui-deps]
help = "Run database and grafana for gui"
cmd = "docker compose -f docker-compose.yaml -f docker-compose.dev.yaml up -d postgresql grafana"
[tool.poe.tasks.gui-flask]
help = "Run flask app in development mode with gui"
cmd = "flask -A src run --debug"
env = { "DISABLE_CELERY" = "true" }
[tool.poe.tasks.dev-without-celery]
help = "Run flask app in development mode without celery"
cmd = "docker compose -f docker-compose.yaml -f docker-compose.dev-without-celery.yaml up sumo-flask"
[tool.poe.tasks.insert-config]
help = "Inserts the configs into the database"
cmd = "python scripts/insert_demonstration_simulation.py"
envfile = [".env.shared", ".env.secret"]
[tool.poe.tasks.cov]
help = "Run coverage report"
cmd = "pytest --co --cov=src --cov-config=.coveragerc"
[tool.poe.tasks.cov-xml]
help = "Run coverage report and write to XML file"
cmd = "pytest --co --cov=src --cov-config=.coveragerc --cov-report xml"
[tool.poe.tasks.docs-build]
help = "Build the documentation with sphinx"
cmd = "sphinx-build -b html docs/source/ docs/build/html"
[tool.poe.tasks.docs-open]
help = "Open the built documentation"
cmd = "open docs/build/html/index.html"
[tool.poe.tasks.docs]
help = "Build and open the documentation of the REST API"
sequence = ["docs-build", "docs-open"]
[tool.isort]
profile = "black"