|
1 | | -# https://black.readthedocs.io/ |
2 | | -[tool.black] |
| 1 | +[project] |
| 2 | +name = "pythonsd-django" |
| 3 | +version = "0.2.0" |
| 4 | +description = "San Diego Python website - sandiegopython.org" |
| 5 | +requires-python = ">=3.14, <3.15" |
| 6 | +dependencies = [ |
| 7 | + # This is a Django app |
| 8 | + "Django >= 5.2, < 5.3", |
| 9 | + |
| 10 | + # A zero dependency WSGI server |
| 11 | + "gunicorn", |
| 12 | + |
| 13 | + # For connecting to various APIs (eg. Meetup.com, YouTube) |
| 14 | + "requests", |
| 15 | + |
| 16 | + # For serving static assets from the WSGI server |
| 17 | + "whitenoise", |
| 18 | + |
| 19 | + # Redirects requests to other hosts to this one |
| 20 | + "django-enforce-host", |
| 21 | + |
| 22 | + # For parsing YouTube's XML feed |
| 23 | + # DefusedXML is necessary to parse untrusted XML safely |
| 24 | + "defusedxml", |
| 25 | + |
| 26 | + # Used for image field handling |
| 27 | + "pillow", |
| 28 | + |
| 29 | + "dj-database-url", |
| 30 | +] |
| 31 | + |
| 32 | +[project.optional-dependencies] |
| 33 | +# Development dependencies |
| 34 | +dev = [ |
| 35 | + # Used for code formatting and linting |
| 36 | + "pre-commit", |
| 37 | + |
| 38 | + # Used for code coverage |
| 39 | + "coverage", |
| 40 | + "django_coverage_plugin", |
| 41 | + |
| 42 | + # Used in local testing |
| 43 | + "WebTest", |
| 44 | + "beautifulsoup4", |
| 45 | + "WebOb==1.8.9", |
| 46 | + "responses", |
| 47 | + |
| 48 | + # Used to help with Django related debugging |
| 49 | + "django-debug-toolbar", |
| 50 | + |
| 51 | + # Used to run the test suite |
| 52 | + "tox", |
| 53 | +] |
| 54 | + |
| 55 | +# Production dependencies |
| 56 | +production = [ |
| 57 | + # Database server |
| 58 | + # https://www.psycopg.org/docs/install.html#install-from-source |
| 59 | + "psycopg[binary]", |
| 60 | + |
| 61 | + # Email |
| 62 | + "django-anymail", |
| 63 | + |
| 64 | + # Cloud storage for media storage (S3, R2, etc.) |
| 65 | + "django-storages[s3]", |
| 66 | +] |
| 67 | + |
| 68 | + |
| 69 | +# https://docs.astral.sh/ruff/configuration/ |
| 70 | +[tool.ruff] |
| 71 | +exclude = [ |
| 72 | + "manage.py", |
| 73 | + "docs", |
| 74 | +] |
| 75 | + |
| 76 | +# Same as Black. |
3 | 77 | line-length = 88 |
4 | | -target_version = ['py310'] |
5 | | -include = '\.pyi?$' |
6 | | -exclude = ''' |
7 | | -/( |
8 | | - \.git |
9 | | - | \.hg |
10 | | - | \.mypy_cache |
11 | | - | \.tox |
12 | | - | \.venv |
13 | | - | venv |
14 | | - | _build |
15 | | - | buck-out |
16 | | - | build |
17 | | - | dist |
18 | | - | node_modules |
19 | | - | migrations |
20 | | -)/ |
21 | | -''' |
| 78 | +indent-width = 4 |
| 79 | + |
| 80 | +# Assume Python 3.14 |
| 81 | +target-version = "py314" |
| 82 | + |
| 83 | +[tool.ruff.lint] |
| 84 | +# Enable: |
| 85 | +# Pyflakes (`F`) |
| 86 | +# pycodestyle (`E`) error codes. |
| 87 | +# isort (`I`) import sorting |
| 88 | +select = ["E4", "E7", "E9", "F", "I"] |
| 89 | + |
| 90 | +[tool.ruff.lint.isort] |
| 91 | +# https://docs.astral.sh/ruff/settings/#lintisort |
| 92 | +force-single-line = true |
| 93 | +case-sensitive = false |
| 94 | +lines-after-imports = 2 |
| 95 | + |
| 96 | +# Ignore `F405` (import *) in config files |
| 97 | +[tool.ruff.lint.per-file-ignores] |
| 98 | +"config/settings/*" = ["F405"] |
| 99 | + |
| 100 | + |
| 101 | +# Run all tests with `tox` |
| 102 | +[tool.tox] |
| 103 | +# https://tox.wiki/en/latest/config.html#pyproject-toml-native |
| 104 | +env_list = ["coverage", "styles", "migrations"] |
| 105 | +setenv = { DJANGO_SETTINGS_MODULE = "config.settings.test", DJANGO_SETTINGS_SKIP_LOCAL = "True" } |
| 106 | + |
| 107 | +[tool.tox.env_run_base] |
| 108 | +description = "Run the full test suite under {base_python}" |
| 109 | +runner = "uv-venv-lock-runner" |
| 110 | +base_python = ["python3.14"] |
| 111 | +extras = [ |
| 112 | + "dev", |
| 113 | +] |
| 114 | + |
| 115 | +[tool.tox.env.coverage] |
| 116 | +description = "Run full unit test suite with coverage" |
| 117 | +commands = [ |
| 118 | + ["uv", "run", "coverage", "run", "manage.py", "test"], |
| 119 | + ["uv", "run", "coverage", "html"], |
| 120 | + ["uv", "run", "coverage", "report", "--show-missing", "--fail-under=100"], |
| 121 | +] |
| 122 | + |
| 123 | +[tool.tox.env.styles] |
| 124 | +description = "Run type check on code base" |
| 125 | +commands = [["uv", "run", "pre-commit", "run", "--all-files"]] |
| 126 | + |
| 127 | +[tool.tox.env.migrations] |
| 128 | +description = "Check for missing migrations" |
| 129 | +commands = [["uv", "run", "python", "manage.py", "makemigrations", "--check", "--dry-run"]] |
0 commit comments