forked from pypi/warehouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
130 lines (119 loc) · 4.9 KB
/
Copy pathpyproject.toml
File metadata and controls
130 lines (119 loc) · 4.9 KB
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
[tool.coverage.run]
branch = true
dynamic_context = "test_function"
source = ["warehouse", "tests"]
omit = [
# We don't want to get coverage information for our migrations.
"warehouse/migrations/*",
# We don't want to actually cover our __main__.py file because it is hard
# to cover and it really just acts as a tiny shim to a function.
"warehouse/__main__.py",
# Again, tiny shim code that we don't actually need to test and trying to
# do so would just get in the way.
"warehouse/wsgi.py",
# And again, tiny shim code.
"warehouse/celery.py",
]
# We run multiple processes in parallel, so we need to make sure that we don't
# write to the same file at the same time.
parallel = true
[tool.coverage.report]
exclude_also = [
"class \\w+\\(Interface\\):",
"if (typing\\.)?TYPE_CHECKING:",
"pytest.fail\\(", # Use for test branches that should never be reached.
# Remove once resolved: https://github.com/nedbat/coveragepy/issues/1563
"case _:\\n\\s*pytest\\.fail\\(",
]
[tool.djlint]
# https://www.djlint.com/docs/configuration/
indent = 2
profile = "jinja"
use_gitignore = true
# The Simple API templates have structures that are relied upon.
extend_exclude = "warehouse/templates/api/simple/*"
# TODO: Evaluate which `img` tags can get height/width attributes and remove H006.
# H006: <img> tag should have `height` and `width` attributes.
# TODO: Convert single quotes to double quotes and remove T002 from ignore.
# T002: Double quotes should be used in tags. Ex {% extends "this.html" %}
# TODO: Add endblock names everywhere and remove T003 from ignore.
# T003: Endblock should have name. Ex: {% endblock body %}.
# T028: Handled by warehouse config. See: https://github.com/pypi/warehouse/pull/14709
ignore = "H006,T002,T003,T028"
[tool.isort]
profile = 'black'
lines_between_types = 1
combine_as_imports = true
known_first_party = ['warehouse', 'tests']
[tool.mypy]
python_version = "3.14"
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
plugins = ["mypy_zope:plugin"]
exclude = ["warehouse/locale/.*", "warehouse/migrations/versions.*"]
cache_dir = "dev/.mypy_cache"
[[tool.mypy.overrides]]
# These modules do not yet have types available.
module = [
"bpython.*", # https://github.com/bpython/bpython/issues/892
"b2sdk.*", # https://github.com/Backblaze/b2-sdk-python/issues/148
"celery.app.backends.*", # https://github.com/celery/celery/issues/7394
"celery.backends.redis.*", # https://github.com/celery/celery/issues/7394
"cgi.*", # legacy stdlib module for webob, installed via `legacy_cgi` package
"google.cloud.storage.*", # https://github.com/googleapis/python-storage/issues/393
"forcediphttpsadapter.*",
"IPython.*", # has types, but only installed in dev
"packaging_legacy.*", # https://github.com/di/packaging_legacy/pull/5
"paginate.*",
"paginate_sqlalchemy.*",
"premailer.*",
"pymacaroons.*", # https://github.com/ecordell/pymacaroons/issues/41
"pyramid.*", # https://github.com/Pylons/pyramid/issues/2638
"pyramid_jinja2.*",
"pyramid_mailer.*",
"pyramid_retry.*",
"pyramid_rpc.*",
"pyqrcode.*",
"requests_aws4auth.*", # https://github.com/tedder/requests-aws4auth/issues/53
"rfc3986.*", # https://github.com/python-hyper/rfc3986/issues/122
"transaction.*",
"venusian.*",
"whitenoise.*", # https://github.com/evansd/whitenoise/pull/410
"zope.sqlalchemy.*",
]
ignore_missing_imports = true
[tool.pytest.ini_options]
addopts = [
"--disable-socket",
"--allow-hosts=localhost,::1,stripe,redis",
"--durations=20",
"--numprocesses=auto",
# Disable ddtrace for tests
"-p no:ddtrace",
"-p no:ddtrace.pytest_bdd",
"-p no:ddtrace.pytest_benchmark",
]
cache_dir = "dev/.pytest_cache"
testpaths = ["tests/"]
markers = [
'unit: Quick running unit tests which test small units of functionality.',
'functional: Slower running tests which test the entire system is functioning.',
]
filterwarnings = [
'ignore::warehouse.utils.exceptions.DevelopmentModeWarning',
'error:SELECT statement has a cartesian product:sqlalchemy.exc.SAWarning',
# Noise reduction for warnings that are waiting for an upstream fix.
# https://github.com/Pylons/pyramid/issues/3731
'ignore:pkg_resources is deprecated as an API.*:UserWarning:pyramid.asset',
# https://github.com/Pylons/webob/issues/473
'ignore:datetime\.datetime\.utcnow\(\) is deprecated.*:DeprecationWarning:webob.*',
# https://github.com/pypi/warehouse/issues/15454#issuecomment-2599321232
'ignore:Accessing argon2.__version__ is deprecated.*:DeprecationWarning:passlib.handlers.argon2',
# https://github.com/zopefoundation/meta/issues/194
'''ignore:Deprecated call to `pkg_resources.declare_namespace\('(paste|repoze)'\).*:DeprecationWarning:pkg_resources''',
]
[tool.pip-tools.compile]
# TODO: This can be removed once it becomes the default.
# See: https://github.com/jazzband/pip-tools/issues/989
allow-unsafe = true