Newer
Older
# Works around a setuptools 50 issue
# AK, 2020-12-11
# taken from https://github.com/AnalogJ/lexicon/pull/629/files
requires = [
"setuptools!=50",
"poetry>=0.12",
]
build-backend = "poetry.masonry.api"
[tool.poetry]
name = "relate-courseware"
description = "RELATE courseware"
readme = "README.rst"
repository = "https://github.com/inducer/relate"
documentation = "https://documen.tician.de/relate/"
authors = ["Andreas Kloeckner <inform@tiker.net>"]
license = "MIT"
packages = [
{ include = "course" },
{ include = "accounts" },
{ include = "relate" },
[tool.poetry.scripts]
relate = "relate.bin.relate:main"
# Automatically renders Django forms in a pretty, Bootstrap-compatible way.
# 0.6 has broken checkbox rendering
# https://github.com/django-crispy-forms/crispy-bootstrap5/commit/8bccd516aa9ce336a1069b6c9346e0c4c9e8270f
crispy-bootstrap5 = "^0.7"
# Page data, answer data, ... all represented in JSON. This makes that editable in the Django admin.
jsonfield = ">=1.4.0"
# /!\ Upstream is dead, using branch for Django 3.0 support
django-yamlfield = {git = "https://github.com/bakatrouble/django-yamlfield.git", rev = "c92d0373d12a02d1e52fb09b44010f156111d7ea"}
# For easy content formatting:
markdown = "^2.6.3"
# For math/symbolic questions
pymbolic = "*"
sympy = "*"
# Course content is stored in YAML.
pyyaml = "*"
# Dulwich git integration
dulwich = "^0.20.3"
paramiko = "*"
# https://github.com/poezio/slixmpp/commit/53dc9847e2a4110be85ad16af9b427f9a280aaee#commitcomment-69121492
# To manage web dependencies
django-npm = "^1.0.0"
# For comfortable code entry
django-codemirror-widget = ">=0.5"
# For code isolation in code questions
docker-py = "^1.10.6"
# For code highlighting, required via the CodeHilite extension to Python-Markdown
pygments = "^2.6.1"
# For grade export
unicodecsv = "^0.14.1"
# To support network matching for facility recognition
ipaddress = "^1.0.23"
Andreas Klöckner
committed
Andreas Klöckner
committed
pysaml2 = "^7.4.2"
djangosaml2 = "^v1.7.0"
Andreas Klöckner
committed
# }}}
# Try to avoid https://github.com/Julian/jsonschema/issues/449
attrs = ">=19"
python-memcached = "^1.59"
# {{{ celery and related
# Avoid 2.3.0 because of https://github.com/celery/django-celery-results/issues/293
django-celery-results = "^2.4.0"
django_select2 = "^7.4.2"
# To sanitize HTML generated by user code
# bleach is based on html5lib, but they vendor it. I don't think we should fish the
# vendored bits out of bleach, so we'll introduce our own dependency for data-URI
# sanitization.
html5lib = "^1.1"
# https://github.com/jupyter/nbconvert/issues/1725
ipython_genutils = "^0.2.0"
# not a direct dependency
# version constraint is here because of CVE-2020-25659
cryptography = ">=3.2.1"
social-auth-app-django = "^5.4.1"
psycopg2 = { version = "^2.9.3", optional = true }
pylibmc = { version = "^1.6.0", optional = true }
# urllib3 2.x seems incompatible with dulwich?
# "urllib3.exceptions.LocationValueError: No host specified."
[tool.poetry.dev-dependencies]
factory_boy = "^2.12.0"
pytest = "^7"
pytest-django = "^4.5.2"
pytest-factoryboy = "^2.6.0"
pytest-cov = "^4.1.0"
safety = "^2.2.0"
sphinx = "^7.2.6"
furo = "^2023.9.10"
sphinx-copybutton = "^0.5.2"
Andreas Klöckner
committed
types-pytz = "^0.1.0"
types-bleach = "^0.1.2"
types-Jinja2 = "^0.1.3"
types-paramiko = "^0.1.3"
types-Markdown = "^0.1.2"
types-PyYAML = "^0.1.5"
# tests for code questions use question code that has numpy
# enable with "-E postgres"
[tool.poetry.extras]
postgres = ["psycopg2"]
[tool.isort]
profile = "django"
line_length = 85
lines_after_imports = 2
src_paths = ["relate", "course", "accounts", "test"]
[tool.ruff]
preview = true
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C", # flake8-comprehensions
"E", # pycodestyle
"F", # pyflakes
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
"N", # pep8-naming
"NPY", # numpy
# "Q", # flake8-quotes
"W", # pycodestyle
# "RUF",
# "UP",
# "DJ",
]
extend-ignore = [
"C90", # McCabe complexity
"E221", # multiple spaces before operator
"E226", # missing whitespace around arithmetic operator
"E241", # multiple spaces after comma
"E242", # tab after comma
"E402", # module level import not at the top of file
"N818", # error suffix in exception names
# TODO
"B904", # raise in except needs from
"E265",
"B028", # stacklevel
"E251"
]
allowed-confusables = ["‐", "–"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
inline-quotes = "double"
multiline-quotes = "double"
[tool.ruff.lint.per-file-ignores]
"course/mdx_mathjax.py" = ["N802"]
# copy-pasted from elsewhere, not our problem
"saml-config/attribute-maps/*.py" = ["Q", "E231", "W292", "W291", "E501"]
# mostly generated
"course/migrations/*.py" = ["Q", "E501", "RUF012", "F401"]
"accounts/migrations/*.py" = [
"Q", "E501", "RUF012", "F401", "E303", "B023", "E731", "N806", "F841"]
# TODO
"tests/**/*.py" = ["F841"]
[tool.ruff.lint.isort]
combine-as-imports = true
lines-after-imports = 2
[tool.mypy]
strict_optional = true
ignore_missing_imports = true
disallow_untyped_calls = "true"
# wishful thinking :)
# disallow_untyped_defs= "true"
show_error_codes = true
untyped_calls_exclude = [
"dulwich",
]
[[tool.mypy.overrides]]
module = [
"course.migrations.*",
]
ignore_errors = true
Andreas Klöckner
committed
# vim: foldmethod=marker