-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
169 lines (155 loc) · 4.73 KB
/
pyproject.toml
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
# # FIXME: Translate some of these fields to poetry
# [project]
# name = "contentrepo"
# version = "1.1.1-dev.0"
# authors = [
# { name="Praekelt.org", email="dev@praekelt.org" },
# ]
# description = "A CMS for messaging systems"
# readme = "README.md"
# requires-python = ">=3.10"
# dynamic = ["dependencies", "optional-dependencies"]
# [project.urls]
# "Homepage" = "https://github.com/praekeltfoundation/contentrepo"
# "Bug Tracker" = "https://github.com/praekeltfoundation/contentrepo/issues"
# [tool.setuptools]
# packages = ["contentrepo", "home", "menu", "search"]
# [tool.setuptools.dynamic]
# dependencies = {file = ["requirements.txt"]}
# optional-dependencies.dev = {file = ["requirements-dev.txt"]}
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "contentrepo"
version = "1.4.1-dev.0"
description = "A CMS for messaging systems"
authors = ["Praekelt.org <dev@praekelt.org>"]
readme = "README.md"
homepage ="https://github.com/praekeltfoundation/contentrepo"
repository ="https://github.com/praekeltfoundation/contentrepo"
packages = [
{ include = "contentrepo" },
{ include = "home" },
{ include = "menu" },
{ include = "search" },
]
[tool.poetry.dependencies]
python = "^3.10"
wagtail = "~5.2.6" # Latest LTS
django = "~4.2.17" # Latest LTS
dj-database-url = "^2.1.0"
psycopg2-binary = "^2.9.9"
django-environ = "^0.11.2"
wagtail-content-import = "^0.11.0"
wagtailmedia = "^0.15.1"
drf-spectacular = "^0.27.1"
openpyxl = "^3.1.2"
wagtail-modeladmin = "^2.0.0"
# These aren't needed in tests, but are probably used in production:
django-storages = "^1.14.2"
django-redis = "^5.4.0"
sentry-sdk = "^2.8.0"
boto3 = "^1.34.56"
[tool.poetry.group.dev.dependencies]
pytest = "^8.0.2"
pytest-django = "^4.8.0"
pytest-cov = "^4.1.0"
pytest-xdist = "^3.5.0"
mypy = "^1.8.0"
ruff = "^0.3.0"
black = "^24.3.0"
responses = "^0.25.0"
types-openpyxl = "^3.1.0.20240301"
types-requests = "^2.31.0.20240311"
[[tool.poetry.source]]
name = "pytorch-stable-cpu"
url = "https://download.pytorch.org/whl/cpu"
priority = "explicit"
[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| \.ve
| ve
| env
| _build
| buck-out
| build
| dist
| migrations
)/
'''
[tool.mypy]
exclude = [ # Regexes.
'^manage\.py',
'^contentrepo/',
'^menu/',
'^search/',
'^home/(management|migrations)/',
'^home/(admin|apps|api|constants|content_import_export|forms)\.py',
'^home/(mappers|mixins|models|panels|serializers)\.py',
'^home/(views|wagtail_hooks)\.py',
'^home/tests/utils\.py',
'^home/tests/test_(api|deduplicate_slugs_migration|json_import)\.py',
'^home/tests/test_(management|management_related_tag|models)\.py',
'^home/tests/test_(unique_slug_hook|views|wagtail_hooks)\.py',
'^home/tests/test_(whatsapp_template_name_migration)\.py',
'^home/tests/test_(forms)\.py',
]
files = "."
follow_imports = "skip"
disallow_untyped_defs = true
disallow_any_generics = true
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "contentrepo.settings.test"
addopts = "--cov"
filterwarnings = [
# We can't do anything about these warnings until upstream updates.
"ignore::django.utils.deprecation.RemovedInDjango50Warning:home.tests.test_forms:13", # this comes from inside Django itself
"ignore::django.utils.deprecation.RemovedInDjango51Warning:django.db.models.options:210", # taggit.TaggedItem
"ignore::DeprecationWarning:l18n.translation:17",
"ignore::DeprecationWarning:openpyxl",
]
[tool.ruff]
target-version = "py310"
[tool.ruff.lint]
select = [
"E", "F", "W", # pycodestyle + pyflakes == flake8 - mccabe
"I", # isort
"UP", # pyupgrade
"S", # flake8-bandit
"B", # flake8-bugbear
"C4", # flake8-comprehensions
# "DJ", # flake8-django
"PIE", # flake8-pie
# "PT", # flake8-pytest-style
"SIM", # flake8-simplify
"PTH", # flake8-use-pathlib
# "RUF", # ruff-specific rules
]
ignore = [
"E501", # TODO: Something about these long lines.
"S113", # TODO: Request timeouts.
"B904", # TODO: Fix exceptions raised in exception handlers.
"SIM102", # It's often more convenient/readable to use nested conditionals.
]
[tool.ruff.lint.per-file-ignores]
"contentrepo/settings/**" = [
"S105", # TODO: Get rid of default DEFAULT_SECRET_KEY.
"F405", # We import * in settings files.
]
"**/tests/**" = [
"S101", # It's okay to use `assert` in tests.
]
"**/migrations/**" = [
"E501", # Long lines are okay in generated code.
"I001", # We don't care about import sorting in generated code.
"UP", # We don't care about new syntax in generated code.
]