-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
165 lines (152 loc) · 5.01 KB
/
pyproject.toml
File metadata and controls
165 lines (152 loc) · 5.01 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
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "synapse-token-authenticator"
description = 'Synapse authentication module which allows for authenticating and registering using JWTs'
readme = "README.md"
requires-python = ">=3.11"
license = "AGPL-3.0-only"
keywords = []
authors = [
{ name = "Sorunome", email = "mail@sorunome.de" },
{ name = "Amanda Graven", email = "amanda@graven.dev" },
{ name = "Jan Christian Grünhage", email = "jan.christian@gruenhage.xyz" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"jwcrypto",
"twisted",
]
version = "0.13.1"
[project.urls]
Documentation = "https://github.com/famedly/synapse-token-authenticator"
Issues = "https://github.com/famedly/synapse-token-authenticator/issues"
Source = "https://github.com/famedly/synapse-token-authenticator"
[tool.hatch.envs.default]
dependencies = [
"black",
"pytest",
"pytest-cov",
"mock",
"matrix-synapse",
"ruff",
"mypy",
"mypy-zope",
"types-PyYAML",
"types-bleach",
"types-cachetools",
"types-requests",
"types-pyOpenSSL"
]
[tool.coverage.run]
branch = true
parallel = true
omit = []
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.hatch.envs.hatch-static-analysis]
dependencies = [
"black",
"isort",
"ruff",
"mypy",
"mypy-zope",
"types-PyYAML",
"types-bleach",
"types-cachetools",
"types-jwcrypto",
"types-requests",
"types-pyOpenSSL"
]
[tool.hatch.envs.hatch-static-analysis.scripts]
format-check = [
"isort . --check --diff",
"black . --check --diff"
]
format-fix = [
"isort .",
"black ."
]
lint-check = [
"mypy",
"ruff check"
]
lint-fix = [
"mypy",
"ruff check --fix"
]
[tool.ruff]
target-version = "py310"
line-length = 88
[tool.mypy]
python_version = "3.10"
ignore_missing_imports = true
install_types = true
plugins = [
"mypy_zope:plugin"
]
files = ["synapse_token_authenticator", "tests"]
[tool.isort]
profile = "black"
src_paths = ["synapse_token_authenticator", "tests"]
[tool.hatch.envs.hatch-test]
# These below are installed by default. This list is to help not reinstall something.
# Updating hatch will change the version numbers, so ignore the pinned versions.
#dependencies = [
# "coverage-enable-subprocess==1.0",
# "coverage[toml]~=7.11",
# "pytest~=9.0",
# "pytest-mock~=3.12",
# "pytest-randomly~=3.15",
# "pytest-rerunfailures~=14.0",
# "pytest-xdist[psutil]~=3.5",
#]
extra-dependencies = [
"pytest-cov",
"matrix-synapse",
]
extra-args = [
# use the loadscope dist method when running tests parallel. This keeps grouped tests
# together instead of splitting them up, which tends to get "stuck" and not finish
# the testing(have to use ^C to exit). Has no effect when tests are not parallelized.
"--dist=loadscope"
]
# The 'hatch test ...' command has the built-in scripts that define its invocation.
# Override these scripts so coverage works as expected.
#
# In particular, the 'coverage run -m pytest ...' command does not work correctly.
# In CI, it was not producing the subprocess-enabled coverage files, even though it
# worked locally (there should have been 4 files, but only 1 was produced, and it had
# no data). Using the pytest-cov plugin does seem to produce these files, and the
# missing-lines display format is also correct. Since it handles the internal
# combine/report commands, set those scripts below to do nothing (or CI will report
# fake errors).
[tool.hatch.envs.hatch-test.scripts]
# The HATCH_TEST_ARGS environment variable is how the `test` command's flags are
# translated and internally populated without affecting the user's arguments. This is
# also the way that "extra arguments" are passed. Leave it there
run = "pytest{env:HATCH_TEST_ARGS:} {args}"
# The original 'run-cov' is below; this is overridden to produce coverage properly.
#run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}"
# Notes for this command line: using --cov=synapse_token_authenticator instead of having
# that directory in the 'coverage.run' config above actually produces the correct
# coverage files (the ones that were missing, as mentioned above). The 'cov-report'
# options both produce useful output (one for the codecov file and the other displays
# the missing coverage lines).
run-cov = "pytest{env:HATCH_TEST_ARGS:} --cov=synapse_token_authenticator --cov-report=lcov:lcov.info --cov-report=term-missing --cov-config=pyproject.toml {args}"
# As mentioned above, the defaults for these scripts are commented out as they will
# produce fake errors in CI. They attempt to run but the result of those commands
# already exists. This raises error codes and fails the test.
#cov-combine = "coverage combine"
#cov-report = "coverage report"
cov-combine = ""
cov-report = ""