-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
181 lines (166 loc) · 5.27 KB
/
pyproject.toml
File metadata and controls
181 lines (166 loc) · 5.27 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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "famedly-control-synapse"
description = ''
readme = "README.md"
requires-python = ">=3.10"
license = "AGPL-3.0-only"
keywords = []
authors = [
{ name = "Nicolas Werner", email = "n.werner@famedly.com" },
{ name = "Jason Little", email = "j.little@famedly.com" },
{ name = "Soyoung Kim", email = "s.kim@famedly.com" },
{ name = "Thomast Traineau", email = "t.traineau@famedly.com" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"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 = [
"pydantic>=2.0.0",
]
version = "0.0.2"
[project.urls]
Documentation = "https://github.com/famedly/famedly-control-synapse#famedly-control-synapse"
Issues = "https://github.com/famedly/famedly-control-synapse/-/issues"
Source = "https://github.com/famedly/famedly-control-synapse/"
[tool.hatch.envs.default]
# Add all the dependencies that a dev environment will need/use
dependencies = [
"black",
"pytest",
"pytest-cov",
"mock",
"mypy",
"mypy-zope",
"parameterized",
"psycopg2",
"pydantic",
"types-PyYAML",
"types-bleach",
"types-cachetools",
"types-requests",
"types-pyOpenSSL",
# we don't depend on synapse directly to prevent pip from pulling the wrong synapse,
# when we just want to install the module
"matrix-synapse @ git+https://github.com/famedly/synapse.git@master"
]
[tool.hatch.envs.hatch-static-analysis]
dependencies = [
"black",
"isort",
"ruff",
"mypy",
"mypy-zope",
"pydantic",
"types-PyYAML",
"types-bleach",
"types-cachetools",
"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.ruff.lint]
ignore = [
"FBT001",
"FBT002",
"TRY002",
"TRY003",
"PLW0603",
"N802",
"N815"
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["S101", "S105", "PLR2004", "N803", "SLF001", "UP035", "PT019"]
[tool.coverage.run]
branch = true
parallel = true
omit = ["tests/*"]
[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
[tool.mypy]
python_version = "3.10"
ignore_missing_imports = true
install_types = true
plugins = [
"pydantic.mypy",
"mypy_zope:plugin"
]
files = ["famedly_control_synapse", "tests"]
check_untyped_defs = true
[tool.isort]
profile = "black"
src_paths = ["famedly_control_synapse", "tests"]
[tool.hatch.envs.hatch-test]
# The Hatch test environment includes the default pytest, mock and coverage
# dependencies. If you should need additional, use the 'extra-dependencies' section
# below.
extra-dependencies = [
"parameterized",
"psycopg2",
"pytest-cov",
# we don't depend on synapse directly to prevent pip from pulling the wrong synapse,
# when we just want to install the module
"matrix-synapse @ git+https://github.com/famedly/synapse.git@master"
]
# 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=famedly_control_synapse 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=famedly_control_synapse --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 = ""