[dependency-groups] main = [ "aiohttp==3.14.4", "arabic-reshaper==3.0.1", "bleach==6.4.0", "boto3==1.34.74", "bw-file-resubmit==0.6.0rc2", "celery[redis]==5.6.2", "colorthief==0.2.1", "Django==5.2.17", "django-celery-beat==2.8.1", "django-compressor==4.6", "django-csp==3.8", "django-imagekit==6.0.0", "django-model-utils==4.4.0", "django-oauth-toolkit==3.2.0", "django-pgtrigger==4.17.0", "django-sass-processor==1.4.2", "django-storages[azure,s3]==1.14.6", "environs==14.5.0", "flower==2.0.1", "gunicorn==25.0.3", "hiredis==2.3.2", "libsass==0.23.0", "mistune==3.3.3", "opentelemetry-api==1.45.1", "opentelemetry-exporter-otlp-proto-grpc==1.45.1", "opentelemetry-instrumentation-celery==0.66b1", "opentelemetry-instrumentation-django==0.66b1", "opentelemetry-instrumentation-psycopg==0.66b1", "opentelemetry-sdk==1.45.1", "Pillow==13.0.0", "pilkit>=3.0", # dependency of django-imagekit, 2.0 is incompatible with Pillow>=10 "psycopg[binary]==3.2.9", "pycryptodome==3.20.0", "pyotp==2.9.0", "python-bidi==0.6.10", "python-dateutil==2.9.0.post0", "qrcode==7.4.2", "redis==5.0.3", "requests==2.33.0", "responses==0.25.0", "s3-tar==0.1.13", "sqlparse==0.6.0", "ua-parser[regex]==1.0.1", # Indirect dependencies with version constraints for security fixes "grpcio>=1.57.0", "setuptools>=65.5.1", "tornado>=6.3.3", ] dev = [ "celery-types==0.22.0", "django-stubs[compatible-mypy]==4.2.7", "fakeredis==2.37.0", "mypy==1.7.1", "ruff==0.14.7", "pytest==9.0.3", "pytest-cov==5.0.0", "pytest-django==4.8.0", "pytest-env==1.1.3", "pytest-xdist==3.5.0", "pytidylib==0.3.2", "types-bleach==6.1.0.20240331", "types-dataclasses==0.6.6", "types-Pillow==10.2.0.20240331", "types-python-dateutil==2.9.0.20240316", "types-requests==2.31.0.20240311", ] [tool.coverage.run] omit = ["*/test*", "celerywyrm*", "bookwyrm/migrations/*"] [tool.pytest.ini_options] markers = [ "integration: marks tests as requiring external resources (deselect with '-m \"not integration\"')", ] DJANGO_SETTINGS_MODULE = "bookwyrm.settings" python_files = ["tests.py", "test_*.py"] addopts = "--cov=bookwyrm" testpaths = ["bookwyrm/tests"] env = [ "LANGUAGE_CODE = en-US", "SECRET_KEY = beepbeep", "DEBUG = true", "DOMAIN = localhost", "PORT = 4242", "ALLOWED_HOSTS = your.domain.here", "BOOKWYRM_DATABASE_BACKEND = postgres", "MEDIA_ROOT = images/", "CELERY_BROKER_URL = memory://", "CELERY_RESULT_BACKEND = cache+memory://", "USE_DUMMY_CACHE = true", "FLOWER_PORT = 8888", "EMAIL_HOST = smtp.mailgun.org", "EMAIL_PORT = 587", "EMAIL_HOST_USER =", "EMAIL_HOST_PASSWORD =", "EMAIL_USE_TLS = true", "ENABLE_PREVIEW_IMAGES = false", ] [tool.mypy] namespace_packages = true strict = true plugins = ["mypy_django_plugin.main"] [tool.django-stubs] django_settings_module = "bookwyrm.settings" [[tool.mypy.overrides]] ignore_errors = true implicit_reexport = true module = "bookwyrm.*" [[tool.mypy.overrides]] ignore_errors = false module = [ "bookwyrm.connectors.*", "bookwyrm.utils.*", "bookwyrm.importers.*", "bookwyrm.isbn.*", "celerywyrm.*", ] [tool.ruff] exclude = ["migrations", "**/__init__.py"] line-length = 88 target-version = "py311" [tool.ruff.lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings "F", # pyflakes (critical errors only) ] ignore = [ "E501", # line too long "E722", # bare except "E731", # lambda assignment "F405", # `env` may be undefined, or defined from star imports ] [tool.ruff.format] quote-style = "double" indent-style = "space" skip-magic-trailing-comma = false line-ending = "auto" docstring-code-format = false docstring-code-line-length = "dynamic"