-
Notifications
You must be signed in to change notification settings - Fork 15
/
pyproject.toml
264 lines (245 loc) · 6.87 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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#
# Ralph package
#
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "ralph-malph"
description = "Ralph, the ultimate Learning Record Store (and more!) for your learning analytics."
readme = "README.md"
authors = [
{ "name" = "Open FUN (France Université Numérique)", "email" = "[email protected]" }
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"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"
]
requires-python = ">=3.8"
license = { file = "LICENSE.md" }
keywords = ["LRS", "Analytics", "xAPI", "Open edX"]
dependencies = [
# By default, we only consider core dependencies required to use Ralph as a
# library (mostly models).
"importlib-metadata>=8.5, <8.6",
"langcodes>=3.2.0",
"pydantic[email]>=2.5.3,<3.0",
"pydantic_settings>=2.1.0,<3.0",
"rfc3987>=1.3.0",
]
dynamic = ["version"]
[project.urls]
"Homepage" = "https://openfun.github.io/ralph/"
"Bug Tracker" = "https://github.com/openfun/ralph/issues"
"Changelog" = "https://github.com/openfun/ralph/blob/main/CHANGELOG.md"
"Repository" = "https://github.com/openfun/ralph"
[project.optional-dependencies]
backend-clickhouse = [
"clickhouse-connect[numpy,pandas]<0.8",
"python-dateutil>=2.8.2",
]
backend-es = [
"elasticsearch[async]>=8.0.0",
]
backend-ldp = [
"ovh==1.2.0",
"requests>=2.0.0",
]
backend-lrs = [
"httpx<0.27.3", # pin as `pytest-httpx<0.23.0` requires `httpx==0.24.*`
]
backend-mongo = [
"motor[srv]>=3.3.0",
"pymongo[srv]>=4.0.0",
"python-dateutil>=2.8.2",
]
backend-s3 = [
"boto3>=1.24.70",
"botocore>=1.27.71",
"requests-toolbelt>=1.0.0",
]
backend-swift = [
"python-keystoneclient>=5.0.0",
"python-swiftclient>=4.0.0",
]
backend-ws = [
"websockets>=13.0",
]
backends = [
"ralph-malph[backend-clickhouse,backend-es,backend-ldp,backend-lrs,backend-mongo,backend-s3,backend-swift]",
]
ci = [
"twine==5.1.1",
]
cli = [
"bcrypt>=4.0.0",
"click>=8.1.0",
"click-option-group>=0.5.0",
"sentry-sdk[fastapi]>=1.9.0",
]
dev = [
"anyio==4.4.0",
"black==24.8.0",
"cryptography==43.0.1",
"factory-boy==3.3.1",
"logging-gelf==0.0.32",
"mike==2.1.3",
"mkdocs==1.6.1",
"mkdocs-click==0.8.1",
"mkdocs-material==9.5.34",
"mkdocstrings[python-legacy]==0.26.1",
"moto==5.0.14",
"mypy==1.11.2",
"neoteroi-mkdocs==1.1.0",
"polyfactory==2.16.2",
"pyfakefs==5.6.0",
"pymdown-extensions==10.9",
"pytest<8.0.0", # pin as pytest-httpx<0.23.0 is not compatible with pytest 8.0.0
"pytest-cov==5.0.0",
"pytest-httpx<0.23.0", # pin as Python 3.8 is no longer supported from release 0.23.0
"requests-mock==1.12.1",
"responses==0.25.3",
"ruff==0.6.5",
"types-python-dateutil ==2.9.0.20240906",
"types-python-jose ==3.3.4.20240106",
"types-requests<2.32.0.20240915",
"types-cachetools ==5.5.0.20240820",
]
lrs = [
"bcrypt==4.2.0",
"fastapi==0.114.2",
"cachetools==5.5.0",
"httpx<0.27.3", # pin as `pytest-httpx<0.23.0` requires `httpx==0.24.*`
"sentry_sdk==2.14.0",
"python-jose==3.3.0",
"uvicorn[standard]==0.30.6",
]
full = [
"ralph-malph[backends,cli,lrs]",
]
[project.scripts]
ralph = "ralph.__main__:cli.cli"
[project.entry-points."ralph.backends.data"]
async_es = "ralph.backends.data.async_es:AsyncESDataBackend"
async_lrs = "ralph.backends.data.async_lrs:AsyncLRSDataBackend"
async_mongo = "ralph.backends.data.async_mongo:AsyncMongoDataBackend"
async_ws = "ralph.backends.data.async_ws:AsyncWSDataBackend"
clickhouse = "ralph.backends.data.clickhouse:ClickHouseDataBackend"
es = "ralph.backends.data.es:ESDataBackend"
fs = "ralph.backends.data.fs:FSDataBackend"
ldp = "ralph.backends.data.ldp:LDPDataBackend"
lrs = "ralph.backends.data.lrs:LRSDataBackend"
mongo = "ralph.backends.data.mongo:MongoDataBackend"
s3 = "ralph.backends.data.s3:S3DataBackend"
swift = "ralph.backends.data.swift:SwiftDataBackend"
[project.entry-points."ralph.backends.lrs"]
async_es = "ralph.backends.lrs.async_es:AsyncESLRSBackend"
async_mongo = "ralph.backends.lrs.async_mongo:AsyncMongoLRSBackend"
clickhouse = "ralph.backends.lrs.clickhouse:ClickHouseLRSBackend"
es = "ralph.backends.lrs.es:ESLRSBackend"
fs = "ralph.backends.lrs.fs:FSLRSBackend"
mongo = "ralph.backends.lrs.mongo:MongoLRSBackend"
[tool.setuptools]
packages = { find = { where = ["src"] } }
zip-safe = true
[tool.setuptools.dynamic]
version = { attr = "ralph.__version__" }
[tool.distutils.bdist_wheel]
universal = true
#
# Third-party packages configuration
#
[tool.ruff]
exclude = [
".conda",
".git",
".venv",
"build",
"scripts",
"venv",
"__pycache__",
"node_modules",
"*/migrations/*",
]
line-length = 88
[tool.ruff.lint]
select = [
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # pycodestyle error
"F", # Pyflakes
"FIX", # flake8-fixme
"I", # isort
"PLC", # Pylint Convention
"PLE", # Pylint Error
"PLR", # Pylint Refactor
"PLW", # Pylint Warning
"RUF100", # Ruff unused-noqa
"S", # flake8-bandit
"SLF", # flake8-self
"T20", # flake8-print
"W", # pycodestyle warning
]
ignore = [
"B008", # function-call-in-default-argument
"N806", # non-lowercase-variable-in-function
"N815", # mixed-case-variable-in-class-scope
"N818", # error-suffix-on-exception-name
]
[tool.ruff.lint.isort]
section-order = ["future", "standard-library", "third-party", "ralph", "first-party", "local-folder"]
[tool.ruff.lint.isort.sections]
ralph = ["ralph"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ARG", # flake8-unused-arguments
"D", # pydocstyle
"S", # flake8-bandit
"SLF", # flake8-self
"PLR2004", # Pylint magic-value-comparison
]
"setup.py" = [
"D" # Pydocstyle rules
]
[tool.ruff.lint.pydocstyle]
# Use Google-style docstrings.
convention = "google"
[tool.mypy]
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
files = "src/ralph/**/*.py"
plugins = "pydantic.mypy"
[[tool.mypy.overrides]]
module = [
"rfc3987.*",
"requests_toolbelt.*",
"botocore.*",
"boto3.*",
"clickhouse_connect.*",
"ovh.*",
"swiftclient.service.*",
]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pytest.ini_options]
addopts = "-v --cov-report term-missing --cov-config=.coveragerc --cov=ralph"
python_files = [
"test_*.py",
"tests.py",
]
testpaths = "tests"