-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
239 lines (215 loc) · 7 KB
/
pyproject.toml
File metadata and controls
239 lines (215 loc) · 7 KB
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
[project]
name = "learning-credentials"
version = "0.5.0"
description = "A pluggable service for preparing Open edX credentials."
dynamic = ["readme"]
requires-python = ">=3.11"
license = "AGPL-3.0-or-later"
license-files = ["LICENSE.txt"]
authors = [{ name = "OpenCraft", email = "help@opencraft.com" }]
keywords = ["Python", "edx", "credentials", "django"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.2",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"django", # Web application framework
"django-model-utils", # Provides TimeStampedModel abstract base class
"edx-api-doc-tools", # A toolkit for documenting REST APIs that are created with DRF
"edx-django-utils", # Open edX Django utilities (e.g., plugin infrastructure)
"edx-opaque-keys", # Create and introspect Course and XBlock identities
"celery", # Distributed task queue
"django-celery-beat", # Periodic task scheduler
"django_reverse_admin", # Provides reverse inlines in the admin interface
"djangorestframework", # RESTful API framework
"django-object-actions", # Provides actions on objects in the admin interface
# TODO: Extract these to a plugin.
"pypdf", # PDF manipulation library
"reportlab", # PDF generation library
"openedx-completion-aggregator", # Completion aggregation service
"edx_ace", # Messaging library
"learning-paths-plugin>=0.3.4", # Learning Paths support
]
[project.urls]
Homepage = "https://github.com/open-craft/learning-credentials"
Repository = "https://github.com/open-craft/learning-credentials"
Documentation = "https://learning-credentials.readthedocs.io/"
[project.entry-points."lms.djangoapp"]
learning_credentials = "learning_credentials.apps:LearningCredentialsConfig"
[tool.setuptools.packages.find]
include = ["learning_credentials", "learning_credentials.*"]
exclude = ["*tests"]
[tool.setuptools.package-data]
learning_credentials = ["templates/**/*", "conf/locale/**/*"]
[tool.setuptools.dynamic]
readme = { file = ["README.rst", "CHANGELOG.rst"], content-type = "text/x-rst" }
[dependency-groups]
test = [
"pytest-cov",
"django-coverage-plugin",
"pytest-django",
"code-annotations",
"dj-inmemorystorage",
"factory-boy",
]
django42 = ["django>=4.2,<5.0"]
django52 = ["django>=5.2,<6.0"]
ci = ["tox", "tox-uv"]
quality = ["ruff", "yamllint"]
doc = ["Sphinx", "doc8", "sphinx-book-theme", "twine"]
dev = [
{ include-group = "test" },
{ include-group = "ci" },
{ include-group = "quality" },
{ include-group = "doc" },
{ include-group = "django42" },
"diff-cover",
"edx-i18n-tools",
"ty", # Type checker.
"django-types", # Type stubs for Django.
# External dev constraints (DO NOT REMOVE THIS LINE)
"Django<6.0",
]
[tool.uv]
constraint-dependencies = [
# External constraints (DO NOT REMOVE THIS LINE)
"elasticsearch<7.14.0",
]
conflicts = [
[
{ group = "django42" },
{ group = "django52" },
{ group = "dev" },
],
]
[tool.coverage.run]
include = ['learning_credentials/**']
omit = ['*/migrations/*', 'tests/*']
plugins = ['django_coverage_plugin']
[tool.ruff]
line-length = 120
exclude = ['migrations', 'docs', 'manage.py']
[tool.ruff.lint]
select = [
'F', # Pyflakes
'E', # Pycodestyle (errors)
'W', # Pycodestyle (warnings)
'C90', # mccabe
'I', # isort
'N', # pep8-naming
'D', # pydocstyle
'UP', # pyupgrade
'YTT', # flake8-2020
'ANN', # flake8-annotations
'ASYNC',# flake8-async
'S', # flake8-bandit
'BLE', # flake8-blind-except
'FBT', # flake8-boolean-trap
'B', # flake8-bugbear
'A', # flake8-builtins
'COM', # flake8-commas
'C4', # flake8-comprehensions
'DTZ', # flake8-datetimez
'T10', # flake8-debugger
'DJ', # flake8-django
'EM', # flake8-errmsg
'EXE', # flake8-executable
'FA', # flake8-future-annotations
'ISC', # flake8-implicit-str-concat
'ICN', # flake8-import-conventions
'LOG', # flake8-logging
'G', # flake8-logging-format
'INP', # flake8-no-pep420
'PIE', # flake8-pie
'T20', # flake8-print
'PYI', # flake8-pyi
'PT', # flake8-pytest-style
'Q', # flake8-quotes
'RSE', # flake8-raise
'RET', # flake8-return
'SLF', # flake8-self
'SLOT', # flake8-slots
'SIM', # flake8-simplify
'TID', # flake8-tidy-imports
'TC', # flake8-type-checking
'INT', # flake8-gettext
'ARG', # flake8-unused-arguments
'PTH', # flake8-use-pathlib
'TD', # flake8-todos
'ERA', # eradicate
'PD', # pandas-vet
'PGH', # pygrep-hooks
'PL', # Pylint
'TRY', # tryceratops
'FLY', # flynt
'NPY', # NumPy-specific rules
'AIR', # Airflow
'PERF', # Perflint
'FURB', # refurb
# TODO: Enable preview.
# 'DOC', # pydoclint
'RUF', # Ruff-specific rules
]
ignore = [
'ANN002', # missing-type-args
'ANN003', # missing-type-kwargs
'ANN204', # missing-return-type-special-method
'D203', # one-blank-line-before-class
'D212', # multi-line-summary-first-line (incompatible with D213)
'Q000', # bad-quotes-inline-string
'TD002', # missing-t\odo-author
'TD003', # missing-t\odo-link
'TRY003', # raise-vanilla-args
'COM812' # missing-trailing-comma (incompatible with ruff formatter)
]
[tool.ruff.lint.per-file-ignores]
'tests/*' = [
'S101', # assert
'INP001', # implicit-namespace-package
'SLF001', # private-member-access
'RUF018', # assignment-in-assert
'ARG002', # unused-method-argument
'PLR0913', # too-many-arguments
'FBT001', # flake8-boolean-trap
]
[tool.ruff.lint.flake8-annotations]
suppress-none-returning = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
allow-magic-value-types = ['int', 'str']
[tool.ruff.lint.flake8-type-checking]
# Add quotes around type annotations, if doing so would allow
# an import to be moved into a type-checking block.
quote-annotations = true
[tool.ruff.format]
quote-style = "preserve"
[tool.pytest.ini_options]
filterwarnings = [
"ignore:'cgi' is deprecated:DeprecationWarning",
]
DJANGO_SETTINGS_MODULE = "test_settings"
addopts = "--cov learning_credentials --cov tests --cov-report term-missing --cov-report xml"
norecursedirs = ".* docs requirements site-packages"
[tool.ty.rules]
unresolved-attribute = "warn"
[[tool.ty.overrides]]
include = ["learning_credentials/settings/*.py"]
[tool.ty.overrides.rules]
unresolved-attribute = "ignore"
[[tool.ty.overrides]]
include = ["learning_credentials/compat.py"]
[tool.ty.overrides.rules]
unresolved-import = "ignore"
[[tool.ty.overrides]]
include = ["tests/**", "test_utils/**"]
[tool.ty.overrides.rules]
possibly-unbound-attribute = "ignore"
unresolved-attribute = "ignore"