-
Notifications
You must be signed in to change notification settings - Fork 4
/
pyproject.toml
123 lines (107 loc) · 3.64 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
[project]
name = "swh.web"
authors = [
{ name = "Software Heritage developers", email = "[email protected]" },
]
description = "Software Heritage web UI"
readme = { file = "README.rst", content-type = "text/x-rst" }
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
]
dynamic = ["version", "dependencies", "optional-dependencies"]
[tool.setuptools.packages.find]
include = ["swh.*"]
[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt", "requirements-swh.txt"] }
[tool.setuptools.dynamic.optional-dependencies]
testing = { file = ["requirements-test.txt"] }
[project.urls]
"Homepage" = "https://gitlab.softwareheritage.org/swh/devel/swh-web"
"Bug Reports" = "https://gitlab.softwareheritage.org/swh/devel/swh-web/-/issues"
"Funding" = "https://www.softwareheritage.org/donate"
"Documentation" = "https://docs.softwareheritage.org/devel/swh-web/"
"Source" = "https://gitlab.softwareheritage.org/swh/devel/swh-web.git"
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
fallback_version = "0.0.1"
[tool.black]
target-version = ['py310', 'py311', 'py312']
exclude = 'swh/web/tests/resources/contents'
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
force_sort_within_sections = true
known_first_party = ['swh']
known_django = 'django,rest_framework'
sections = 'FUTURE,STDLIB,THIRDPARTY,DJANGO,FIRSTPARTY,LOCALFOLDER'
[tool.djlint]
# https://www.djlint.com/docs/linter/#rules
ignore = "H006,H020,H021,H023,H029,H030,H031"
indent = 2
blank_line_after_tag = "endcomment,extends,load,endblock"
max_line_length = 100
[tool.pytest.ini_options]
addopts = """
-p no:flask
-p no:pytest_swh_storage
-p swh.web.tests.pytest_plugin
--ignore-glob=*random_fixtures_test.py
--ignore-glob=*create_test_*.py
--strict-markers
"""
norecursedirs = "build docs node_modules resources .tox"
DJANGO_SETTINGS_MODULE = "swh.web.settings.tests"
filterwarnings = """
ignore:.*Plural value must be an integer, got float
ignore:.*Using or importing the ABCs from 'collections'
ignore:.*uses the.*fixture, which is reset between function calls
ignore:.*'U' mode is deprecated
ignore:.*FORMS_URLFIELD_ASSUME_HTTPS transitional setting is deprecated.
"""
consider_namespace_packages = true
markers = """
inbound_message: used to pass a message parameter to the inbound_message fixture
"""
[tool.django-stubs]
django_settings_module = "swh.web.settings.development"
[tool.mypy]
namespace_packages = true
warn_unused_ignores = true
explicit_package_bases = true
# ^ Needed for mypy to detect py.typed from swh packages installed
# in editable mode
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main"
]
[[tool.mypy.overrides]]
module = [
"django_js_reverse.*",
"django_ratelimit.*",
"msgpack",
"pymemcache.*",
"htmlmin",
]
ignore_missing_imports = true
[tool.flake8]
select = ["C", "E", "F", "W", "B950"]
ignore = [
"E203", # whitespaces before ':' <https://github.com/psf/black/issues/315>
"E231", # missing whitespace after ','
"E501", # line too long, use B950 warning from flake8-bugbear instead
"E704", # multiple statements on one line
"W503" # line break before binary operator <https://github.com/psf/black/issues/52>
]
max-line-length = 88