Debian Codegraph @

pyproject.toml

raw symbols SCIP
1 [build-system]
2 requires = ["setuptools", "wheel"]
3 build-backend = "setuptools.build_meta"
4
5 [tool.towncrier]
6 package = "cocotb"
7 directory = "docs/source/newsfragments"
8 filename = "docs/source/release_notes.rst"
9 issue_format = ":pr:`{issue}`"
10 # The first underline is used for the version/date header,
11 # the second underline for the subcategories (like 'Features')
12 underlines = ["=", "-"]
13 all_bullets = false
14
15 [[tool.towncrier.type]]
16 directory = "feature"
17 name = "Features"
18 showcontent = true
19
20 [[tool.towncrier.type]]
21 directory = "bugfix"
22 name = "Bugfixes"
23 showcontent = true
24
25 [[tool.towncrier.type]]
26 directory = "doc"
27 name = "Improved Documentation"
28 showcontent = true
29
30 [[tool.towncrier.type]]
31 directory = "removal"
32 name = "Deprecations and Removals"
33 showcontent = true
34
35 [[tool.towncrier.type]]
36 directory = "change"
37 name = "Changes"
38 showcontent = true
39
40 [tool.ruff]
41 extend-exclude = [
42 "docs/source/conf.py",
43 "makefiles",
44 "venv",
45 "_vendor",
46 ".nox/",
47 ]
48 target-version = "py37"
49
50 [tool.ruff.format]
51 docstring-code-format = true
52
53 [tool.ruff.lint]
54 extend-select = [
55 "I", # isort
56 "UP", # pyupgrade
57 "PL", # pylint
58 "E", # pycodestyle errors
59 "W", # pycodestyle warnings
60 "F", # pyflakes
61 "C4", # flake8-comprehension
62 "LOG", # flake8-logging
63 "G", # flake8-logging-format
64 "ISC", # implicit string concat
65 "TC", # flake8-typechecking
66 "SIM103", # return the condition directly
67 "SIM300", # yoda conditions
68 "RUF100", # unused noqa
69 "RUF101", # redirected noqa
70 "RUF010", # explicit type conversion in f-string
71 "RUF005", # collection literal concatenation
72 "RUF022", # unsorted __all__
73 "PERF101", # unnecessary list cast
74 "PERF102", # unnecessary dict.items()
75 "B007", # unused loop variable
76 "PYI030", # unnecessary literal union
77 ]
78 ignore = [
79 "E741", # ambiguous variable name (preference)
80 "E501", # line too long (preference)
81 "PLR0912", # Too many branches (>12) (preference)
82 "PLR0913", # Too many arguments to function call (>5) (preference)
83 "PLR0915", # Too many statements (>50) (preference)
84 "PLR2004", # Magic value used in comparison (preference)
85 "PLW0603", # Using the global statement (preference)
86 "PLR0911", # Too many return statements (preference)
87 "PLW1641", # __eq__ without __hash__ (mypy compatibility)
88 "UP021", # subprocess.run() universal_newlines => text (not supported in 3.6)
89 ]
90
91 [tool.ruff.lint.per-file-ignores]
92 # necessary because of how file is included into documentation
93 "examples/doc_examples/quickstart/test_my_design.py" = [
94 "E402",
95 "F811",
96 ]
97
98 [tool.ruff.lint.isort]
99 known-first-party = [
100 "cocotb",
101 "cocotb_tools",
102 "pygpi",
103 ]
104 known-third-party = [
105 "pytest",
106 ]
107
108 [tool.cibuildwheel]
109 # Build for supported platforms only.
110 # Even though we only support 64 bit operating systems, we still support 32 bit
111 # userspace applications (Python and simulators) on Windows and Linux.
112 #
113 # - CPython on Linux i686 and x86_64 with glibc
114 # - CPython on Windows i686 and x86_64
115 # - CPython on macOS x86_64
116 build = "cp*-manylinux_x86_64 cp*-manylinux_i686 cp*-win_amd64 cp*-win32 cp*-macosx_x86_64 cp*-macosx_arm64"
117
118 # Build with optimizations and debugging
119 # -O2 Enables reasonable optimizations. -O3 is unnecessary with the virtual-call-heavy code in the GPI and may bloat binary size.
120 # -g Generate standard debugging info.
121 # -flto Enable LTO which can reduce binary size and improve inlining.
122 environment = {CFLAGS = "-O2 -g -flto", CPPFLAGS = "-O2 -g -flto", LDFLAGS = "-O2 -g -flto"}
123
124 # By default, build on manylinux2014 for compatibility with CentOS/RHEL 7+ (once
125 # the user updates Python) and Ubuntu 20.04+ (with system Python).
126 manylinux-x86_64-image = "manylinux2014"
127 manylinux-i686-image = "manylinux2014"
128
129 # Build with optimizations and debugging (Windows)
130 # /O2 Enables reasonable optimizations.
131 # /Z7 Enables debugging and places info in the binary (/Zi puts debug info in a different file).
132 # /Zo Improves debugging when optimizations are also enabled.
133 # /LTCG Enables LTO which can reduce binary size and improve inlining.
134 [tool.cibuildwheel.windows]
135 environment = {CL = "/O2 /Z7 /Zo /LTCG"}
136
137 [[tool.cibuildwheel.overrides]]
138 # Build CPython 3.6 wheels on manylinux1 to support Ubuntu 18.04, CentOS/RHEL 7
139 # and CentOS/RHEL 8 with their default Python 3.6/pip 9 installation.
140 select = "cp36-*"
141 manylinux-x86_64-image = "manylinux1"
142 manylinux-i686-image = "manylinux1"
143
144 [tool.pytest.ini_options]
145 # Note: Do *not* add files within the cocotb/ tree here. Add them to the
146 # noxfile instead.
147 testpaths = [
148 "tests/pytest",
149 ]
150
151 # Ensure that all markers used in pytests are declared (in here).
152 addopts = "--strict-markers"
153
154 markers = [
155 "simulator_required: mark tests as needing a simulator",
156 "compile: the compile step in runner-based tests",
157 ]
158 # log_cli = true
159 # log_cli_level = DEBUG
160
161 [tool.coverage.paths]
162 source = [
163 "src/cocotb/",
164 ".nox/**/cocotb/",
165 ]
166
167 [tool.coverage.report]
168 omit = [
169 "*/cocotb_tools/*",
170 "*/_vendor/*",
171 ]
172 exclude_lines = [
173 # copy-pasted from coveragepy source
174 # TODO when we can move to a newer version of coverage
175 "#\\s*(pragma|PRAGMA)[:\\s]?\\s*(no|NO)\\s*(cover|COVER)",
176 "^\\s*(((async )?def .*?)?\\)(\\s*->.*?)?:\\s*)?\\.\\.\\.\\s*(#|$)",
177 "if (typing\\.)?TYPE_CHECKING:",
178 ]
179
180 [tool.codespell]
181 ignore-words-list = [
182 "AFE",
183 "Synopsys",
184 "afe",
185 "afile",
186 "alog",
187 "ccompiler",
188 "datas",
189 "implementors",
190 "inout",
191 "nam",
192 "sting",
193 "synopsys",
194 ]
195
196 [tool.mypy]
197 packages = ["cocotb", "pygpi"]
198 modules = ["noxfile"]
199 disallow_untyped_defs = true
200 disallow_any_unimported = true
201 disallow_untyped_calls = true
202 disallow_untyped_decorators = true
203 no_implicit_optional = true
204 warn_redundant_casts = true
205 warn_unused_ignores = true
206 implicit_reexport = false
207 show_error_codes = true
208 pretty = true