[build-system] # 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" version = "2024.1" description = "RELATE courseware" readme = "README.rst" repository = "https://github.com/inducer/relate" documentation = "https://documen.tician.de/relate/" authors = ["Andreas Kloeckner "] license = "MIT" packages = [ { include = "course" }, { include = "accounts" }, { include = "relate" }, # { include = "bin" }, ] [tool.poetry.scripts] relate = "relate.bin.relate:main" [tool.poetry.dependencies] # keep consistent with ruff target version below python = ">=3.10,<4" django = "^5.1.4" # Automatically renders Django forms in a pretty, Bootstrap-compatible way. django-crispy-forms = ">=1.13.0" # 0.6 has broken checkbox rendering # https://github.com/django-crispy-forms/crispy-bootstrap5/commit/8bccd516aa9ce336a1069b6c9346e0c4c9e8270f crispy-bootstrap5 = "^2024.10" # 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 = "^3.7" minijinja= "^2.5.0" # For math/symbolic questions pymbolic = "*" sympy = "*" # Course content is stored in YAML. pyyaml = "*" # Dulwich git integration dulwich = "^0.22.6" paramiko = "*" # https://github.com/poezio/slixmpp/commit/53dc9847e2a4110be85ad16af9b427f9a280aaee#commitcomment-69121492 slixmpp = "^1.8.3" # For code isolation in code questions # 7.1 bumps the minimum API version to 1.24, which is unsupported by podman docker = "^7.1.0" # For code highlighting, required via the CodeHilite extension to Python-Markdown pygments = "^2.6.1" # For grade export unicodecsv = "^0.14.1" # {{{ For interoperation with SAML2/Shibboleth pysaml2 = "^7.4.2" djangosaml2 = "^v1.7.0" # }}} # Try to avoid https://github.com/Julian/jsonschema/issues/449 attrs = ">=19" python-memcached = "^1.59" # {{{ celery and related # A task queue, used to execute long-running tasks celery = "^5.2.2" kombu = "*" # Avoid 2.3.0 because of https://github.com/celery/django-celery-results/issues/293 django-celery-results = "^2.4.0" # }}} # For searchable select widgets django_select2 = "^8.2.1" # To sanitize HTML generated by user code bleach = "^6.2" # 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" # For query lexing pytools = ">=2024.1.8" # For relate script colorama = "*" # 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.10", optional = true } pylibmc = { version = "^1.6.0", optional = true } # urllib3 2.x seems incompatible with dulwich? # "urllib3.exceptions.LocationValueError: No host specified." urllib3 = "^2.3.0" [tool.poetry.dev-dependencies] factory_boy = "^3.3.1" ruff = "^0.8" django-stubs = { version ="5.1.*", extras = ["compatible-mypy"] } pytest = "^8" pytest-django = "^4.5.2" pytest-factoryboy = "^2.6.0" pytest-pudb = "^0.7" safety = "^3.2.11" sphinx = "^8.1.3" furo = "^2024.8.6" sphinx-copybutton = "^0.5.2" django-upgrade = "^1.22.1" pyright = "^1" types-bleach = "^6.2.0" types-paramiko = "^3.5.0" types-Markdown = "^3.7" types-PyYAML = "^6.0.12" # tests for code questions use question code that has numpy numpy = "^2.1" yamllint = "^1.32.0" # enable with "-E postgres" [tool.poetry.extras] postgres = ["psycopg2"] memcache = ["pylibmc"] [tool.ruff] preview = true target-version = "py310" exclude = ["contrib/jupyterlite"] [tool.ruff.lint] extend-select = [ "B", # flake8-bugbear "C", # flake8-comprehensions "E", # pycodestyle "F", # pyflakes "I", # flake8-isort "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 "B028", # stacklevel "RUF012", # mutable class atttributes "UP031", # %-format ] 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"] # config file, no type annotations, avoid scaring users "local_settings_example.py" = ["I002"] # copy-pasted from elsewhere, not our problem "saml-config/attribute-maps/*.py" = ["Q", "E231", "W292", "W291", "E501", "I002"] # mostly generated "*/migrations/*.py" = ["Q", "E501", "RUF012", "F401", "I002", "UP"] # TODO "tests/**/*.py" = ["F841", "RUF012"] [tool.ruff.lint.isort] combine-as-imports = true lines-after-imports = 2 required-imports = ["from __future__ import annotations"] [tool.mypy] plugins = ["mypy_django_plugin.main"] 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.django-stubs] django_settings_module = "relate.settings" strict_settings = false [[tool.mypy.overrides]] module = [ "course.migrations.*", ] ignore_errors = true [tool.pytest.ini_options] DJANGO_SETTINGS_MODULE = "relate.settings" python_files = [ "tests.py", "test_*.py", "*_tests.py", ] markers = [ "slow: marks tests as slow (run with '--slow')", "postgres: mark test as postgres specific", ] [tool.typos.default] extend-ignore-re = [ "(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line" ] [tool.typos.default.extend-words] # opps as in 'grading opportunities' opps = "opps" # fre, short for flow rule exception fre = "fre" # short for 'stipulation' stip = "stip" # as in documen.tician.de documen = "documen" # like sur_name in SAML sur = "sur" [tool.typos.files] extend-exclude = [ "locale/**/*.po", # migrations reflect the past, don't attempt to alter them. "*/migrations/**/*.py", # not ours "saml-config/**/*.py", "contrib/jupyterlite/mamba-root", ] # vim: foldmethod=marker