forked from cocotb/cocotb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
323 lines (292 loc) · 8.88 KB
/
Copy pathpyproject.toml
File metadata and controls
323 lines (292 loc) · 8.88 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
[build-system]
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "cocotb"
description = "Python-based chip (RTL) verification"
readme = "README.md"
license = "BSD-3-Clause"
license-files = [
"LICENSE"
]
authors = [
{name = "Chris Higgs"},
{name = "Stuart Hodgson"},
]
maintainers = [
{name = "Kaleb Barrett"},
{name = "Tomasz Hemperek"},
{name = "Marlon James"},
{name = "Colin Marquardt"},
{name = "Philipp Wagner"},
]
dependencies = [
"find_libpython",
"exceptiongroup; python_version < '3.11'",
]
requires-python = ">= 3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",
"Framework :: cocotb",
]
dynamic = ["version"]
[project.scripts]
cocotb-config = "cocotb_tools.config:main"
[project.urls]
Homepage = "https://www.cocotb.org"
Documentation = "https://docs.cocotb.org"
Repository = "https://github.com/cocotb/cocotb"
Issues = "https://github.com/cocotb/cocotb/issues"
[tool.towncrier]
package = "cocotb"
directory = "docs/source/newsfragments"
filename = "docs/source/release_notes.rst"
issue_format = ":pr:`{issue}`"
# The first underline is used for the version/date header,
# the second underline for the subcategories (like 'Features')
underlines = ["=", "-"]
all_bullets = false
[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true
[[tool.towncrier.type]]
directory = "bugfix"
name = "Bugfixes"
showcontent = true
[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true
[[tool.towncrier.type]]
directory = "removal"
name = "Deprecations and Removals"
showcontent = true
[[tool.towncrier.type]]
directory = "change"
name = "Changes"
showcontent = true
[tool.ruff]
extend-exclude = [
"docs/source/conf.py",
"makefiles",
"venv",
"_vendor",
".nox/",
]
target-version = "py39"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
extend-select = [
"I", # isort
"UP", # pyupgrade
"PL", # pylint
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"C4", # flake8-comprehension
"LOG", # flake8-logging
"G", # flake8-logging-format
"ISC", # implicit string concat
"TC", # flake8-typechecking
"SIM103", # return the condition directly
"SIM300", # yoda conditions
"RUF100", # unused noqa
"RUF101", # redirected noqa
"RUF010", # explicit type conversion in f-string
"RUF005", # collection literal concatenation
"RUF022", # unsorted __all__
"PERF101", # unnecessary list cast
"PERF102", # unnecessary dict.items()
"B007", # unused loop variable
"PYI030", # unnecessary literal union
]
ignore = [
"E741", # ambiguous variable name (preference)
"E501", # line too long (preference)
"PLR0912", # Too many branches (>12) (preference)
"PLR0913", # Too many arguments to function call (>5) (preference)
"PLR0915", # Too many statements (>50) (preference)
"PLR2004", # Magic value used in comparison (preference)
"PLW0603", # Using the global statement (preference)
"PLR0911", # Too many return statements (preference)
"PLW1641", # __eq__ without __hash__ (mypy compatibility)
# The following 3 are ignored because sphinx doesn't set TYPE_CHECKING,
# so it would fail to resolve any names imported in those blocks
"TC001", # typing-only first party import
"TC002", # typing-only third party import
"TC003", # typing-only standard library import
]
[tool.ruff.lint.per-file-ignores]
# necessary because of how file is included into documentation
"examples/doc_examples/quickstart/test_my_design.py" = [
"E402",
"F811",
]
[tool.ruff.lint.isort]
known-first-party = [
"cocotb",
"cocotb_tools",
"pygpi",
]
known-third-party = [
"pytest",
]
required-imports = ["from __future__ import annotations"]
[tool.cibuildwheel]
# Build for supported platforms only.
#
# - CPython on Linux x86_64 with glibc
# - CPython on Windows x86_64
# - CPython on macOS x86_64 and arm64
build = "cp*-manylinux_x86_64 cp*-win_amd64 cp*-macosx_x86_64 cp*-macosx_arm64"
# Build with optimizations and debugging
# -O2 Enables reasonable optimizations. -O3 is unnecessary with the virtual-call-heavy code in the GPI and may bloat binary size.
# -g Generate standard debugging info.
# -flto Enable LTO which can reduce binary size and improve inlining.
environment = {CFLAGS = "-O2 -g -flto", CPPFLAGS = "-O2 -g -flto", LDFLAGS = "-O2 -g -flto"}
# By default, build on manylinux2014 for compatibility with CentOS/RHEL 8+
# and Ubuntu 20.04+ (with system Python).
manylinux-x86_64-image = "manylinux2014"
# Build with optimizations and debugging (Windows)
# /O2 Enables reasonable optimizations.
# /Z7 Enables debugging and places info in the binary (/Zi puts debug info in a different file).
# /Zo Improves debugging when optimizations are also enabled.
# /LTCG Enables LTO which can reduce binary size and improve inlining.
[tool.cibuildwheel.windows]
environment = {CL = "/O2 /Z7 /Zo /LTCG"}
[tool.cibuildwheel.macos]
repair-wheel-command = "delocate-wheel --no-sanitize-rpaths --require-archs {delocate_archs} -w {dest_dir} -v {wheel}"
[tool.pytest.ini_options]
# Note: Do *not* add files within the cocotb/ tree here. Add them to the
# noxfile instead.
testpaths = [
"tests/pytest",
]
# Ensure that all markers used in pytests are declared (in here).
addopts = "--strict-markers"
markers = [
"simulator_required: mark tests as needing a simulator",
"compile: the compile step in runner-based tests",
]
# log_cli = true
# log_cli_level = DEBUG
[tool.coverage.paths]
source = [
"src/cocotb/",
".nox/**/cocotb/",
]
[tool.coverage.report]
omit = [
"*/cocotb_tools/*",
"*/_vendor/*",
]
exclude_lines = [
# copy-pasted from coveragepy source
# TODO when we can move to a newer version of coverage
"#\\s*(pragma|PRAGMA)[:\\s]?\\s*(no|NO)\\s*(cover|COVER)",
"^\\s*(((async )?def .*?)?\\)(\\s*->.*?)?:\\s*)?\\.\\.\\.\\s*(#|$)",
"if (typing\\.)?TYPE_CHECKING:",
]
[tool.codespell]
ignore-words-list = [
"AFE",
"Synopsys",
"afe",
"afile",
"alog",
"ccompiler",
"datas",
"implementors",
"inout",
"nam",
"sting",
"synopsys",
]
skip = ["*.svg"]
[tool.mypy]
packages = ["cocotb", "pygpi", "cocotb_tools.pytest"]
modules = ["noxfile"]
disallow_untyped_defs = true
disallow_any_unimported = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
implicit_reexport = false
show_error_codes = true
pretty = true
# TODO add lower bounds and justifications
[dependency-groups]
dev = [
# required for development
"nox",
"nox-uv",
"prek",
# allows linting the project manually
"clang-format",
"mypy>=1.18", # 1.18 needed for descriptor typing
"ruff",
# allows running tests and doing coverage reporting manually if desired
{include-group = "dev_test"},
{include-group = "coverage_report"},
]
docs = [
"Sphinx ~= 8.2.0",
"breathe",
"sphinx-book-theme == 1.1.3", # pin this to exact version to guard against any CSS changes
"sphinx-design >= 0.6.1",
"sphinxcontrib-svg2pdfconverter[CairoSVG]",
"sphinxcontrib-domaintools @ git+https://github.com/ktbarrett/domaintools.git",
"sphinxcontrib-makedomain",
"sphinxcontrib-spelling >= 5.3.0",
"pyenchant",
"sphinx-issues",
"sphinx-argparse-cli",
"towncrier",
"IPython",
"enum-tools[sphinx]",
"sphinx-codeautolink",
"sphinx-argparse",
"sphinx-autofixture",
"pytest",
]
docs_preview = [
{include-group = "docs"},
"sphinx-autobuild",
]
release_build_wheel = [
"cibuildwheel==3.2.1",
]
release_build_sdist = [
"build",
]
test_common = [
"pytest>=6"
]
dev_test = [
{include-group = "test_common"},
"coverage[toml]>=7.2",
"pytest-cov",
]
coverage_report = [
"coverage[toml]>=7.2",
"gcovr==8.4",
]
release_test = [
{include-group = "test_common"},
# We have to disable the use of the PyPi index when installing cocotb to
# guarantee that the wheels in dist are being used. But without an index
# pip cannot find the dependencies, which need to be installed from PyPi.
# Work around that by explicitly installing the dependencies first from
# PyPi, and then installing cocotb itself from the local dist directory.
"exceptiongroup; python_version<'3.11'",
"find_libpython",
]
[tool.uv.dependency-groups]
# We need Python 3.11 to run Sphinx 8.2 and cibuildwheel 3.2
docs = {requires-python = ">=3.11"}
release_build_wheel = {requires-python = ">=3.11"}