Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
136 lines (124 loc) · 3.7 KB
/
Copy pathpyproject.toml
File metadata and controls
136 lines (124 loc) · 3.7 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
131
132
133
134
135
136
[build-system]
requires = [
# Avoid `poetry-core==2.5` as it has a regression where it produces generic Linux
# builds (instead of `manylinux`) that we can't upload to PyPI, see
# https://github.com/python-poetry/poetry/issues/11265
"poetry-core>=2,<2.5",
"wheel",
"setuptools-rust",
]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 88
target-version = "py311"
[tool.ruff.lint]
# See https://beta.ruff.rs/docs/rules/#error-e
# for error codes. The ones we ignore are:
# E501: line too long (we don't normally run this check in other projects such as Synapse)
# E731: do not assign a lambda expression, use a def
#
# flake8-bugbear compatible checks. Its error codes are described at
# https://beta.ruff.rs/docs/rules/#flake8-bugbear-b
# B023: Functions defined inside a loop must not use variables redefined in the loop
ignore = ["B023", "E501", "E731"]
select = [
# pycodestyle
"E",
"W",
# pyflakes
"F",
# isort
"I001",
# flake8-bugbear
"B0",
# flake8-comprehensions
"C4",
# flake8-2020
"YTT",
# flake8-slots
"SLOT",
# flake8-debugger
"T10",
# flake8-pie
"PIE",
# flake8-executable
"EXE",
]
[tool.ruff.lint.isort]
combine-as-imports = true
section-order = [
"future",
"standard-library",
"third-party",
"twisted",
"first-party",
"testing",
"local-folder",
]
known-first-party = ["matrix_content_scanner"]
[tool.ruff.lint.isort.sections]
twisted = ["twisted", "OpenSSL"]
testing = ["tests"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.maturin]
manifest-path = "rust/Cargo.toml"
module-name = "matrix_content_scanner.mcs_rust"
[tool.poetry]
name = "matrix_content_scanner"
version = "1.6.0"
description = "A web service for scanning media hosted by a Matrix media repository"
authors = ["Element Backend Team <team-backend-synapse@element.io>"]
readme = "README.md"
license = "AGPL-3.0-only OR LicenseRef-Element-Commercial"
# Python version and licence classifiers are set automatically by Poetry
classifiers = []
include = [
{ path = "mypy.ini", format = "sdist" },
{ path = "scripts-dev", format = "sdist" },
{ path = "tests", format = "sdist" },
{ path = "Cargo.toml", format = "sdist" },
{ path = "Cargo.lock", format = "sdist" },
{ path = "rust/Cargo.toml", format = "sdist" },
{ path = "rust/build.rs", format = "sdist" },
{ path = "rust/src/**", format = "sdist" },
]
exclude = [{ path = "src/*.so", format = "sdist" }]
[tool.poetry.dependencies]
python = "^3.11.0"
attrs = ">=19.2.0"
aiohttp = ">=3.8.0"
jsonschema = ">=4.23.0"
pyyaml = ">=5.1.1"
# Required for decrypting files"
python-magic = ">=0.4.15,<0.5"
# Required for maintaining the result cache.
cachetools = ">=5.4.0"
# Required for processing user-defined values such as durations or sizes.
humanfriendly = ">=10.0"
# Required for calculating cache keys deterministically. Type annotations aren't
# discoverable in versions older than 1.6.3.
canonicaljson = ">=1.6.3"
[tool.poetry.dev-dependencies]
# for linting and formatting
ruff = "^0.17.5"
# for type checking
mypy = "*"
types-jsonschema = ">=4.26.0.20260518"
types-PyYAML = ">=6.0.12.20261103"
types-cachetools = "*"
types-humanfriendly = "*"
# for releasing
twine = "*"
[tool.poetry.build]
script = "build_rust.py"
generate-setup-file = true
[tool.poetry.urls]
homepage = "https://github.com/element-hq/matrix-content-scanner"
documentation = "https://github.com/element-hq/matrix-content-scanner/blob/main/README.md"
repository = "https://github.com/element-hq/matrix-content-scanner.git"
[tool.poetry.scripts]
matrix-content-scanner = "matrix_content_scanner.mcs:main"