-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
160 lines (135 loc) · 3.75 KB
/
pyproject.toml
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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["redhdl"]
include-package-data = true
[project]
name = "redhdl"
version = "0.1.0"
description = "SystemVerilog to redstone compiler."
readme = "README.md"
dependencies = [
"antlr4-python3-runtime==4.9.3",
"frozendict",
"graphviz",
"grandalf",
"matplotlib",
"nbtlib",
"tqdm",
]
[project.optional-dependencies]
test = [
"ruff",
"mypy",
"pytest",
"pytest-cov",
"pytest-custom_exit_code",
"types-frozendict",
]
[project.scripts]
# Top level commands: Compile and visualize schematics
sv_to_schem = "scripts.sv_to_schem:main"
display_schem = "scripts.display_schem:main"
# Visualize vHDL ASTs for development.
display_vhdl = "redhdl.parser.vhdl:display_example_program"
# Visualize busses and debug bussing logic.
visualize_bussing = "scripts.visualize_bussing:main"
debug_bussing = "scripts.debug_bussing:main"
[tool.black]
extend-exclude = '''
^.*/(ascii_dag|autogen|vhdlLexer.py|vhdlListener.py|vhdlVisitor.py|vhdlParser.py|vhdlParserVisitor.py|vhdlParserListener.py)$
'''
[tool.isort]
profile = "black"
atomic = true
force_sort_within_sections = true
multi_line_output = 3
known_first_party = [
"redhdl",
]
skip = [
"redhdl/ascii_dag.py",
"redhdl/vhdl/autogen",
"redhdl/vhdl/vhdlLexer.py",
"redhdl/vhdl/vhdlListener.py",
"redhdl/vhdl/vhdlParser.py",
"redhdl/vhdl/vhdlVisitor.py",
"redhdl/vhdl/vhdlParserVisitor.py",
"redhdl/vhdl/vhdlParserListener.py",
]
[tool.mypy]
ignore_missing_imports = true
exclude = [
"redhdl/misc/ascii_dag.py",
"vhdlLexer.py",
"vhdlListener.py",
"vhdlParser.py",
"vhdlParserListener.py",
"vhdlParserVisitor.py",
"vhdlVisitor.py",
"autogen",
]
[[tool.mypy.overrides]]
module = [
"redhdl.vhdl.vhdlParser",
"redhdl.vhdl.vhdlLexer",
"redhdl.vhdl.vhdlListener",
"redhdl.vhdl.vhdlVisitor",
"redhdl.vhdl.autogen",
]
follow_imports = "skip"
[tool.pytest.ini_options]
addopts = "--doctest-modules --ignore=redhdl/vhdl/autogen --ignore=redhdl/vhdl/vhdlLexer.py --ignore=redhdl/vhdl/vhdlParser.py --ignore=redhdl/vhdl/vhdlParserVisitor.py"
doctest_optionflags = "ELLIPSIS"
filterwarnings = "ignore::DeprecationWarning"
[tool.pydocstyle]
match-dir = "(?!parser)(?!\\.).*"
match = "(?!test_)(?!ascii_dag).*\\.py"
[tool.ruff]
line-length = 88
exclude = [
"redhdl/misc/ascii_dag.py",
"redhdl/vhdl/autogen",
"redhdl/vhdl/vhdlParser.py",
"redhdl/vhdl/vhdlLexer.py",
"redhdl/vhdl/vhdlListener.py",
"redhdl/vhdl/vhdlVisitor.py",
"redhdl/vhdl/vhdlParserVisitor.py",
"redhdl/vhdl/vhdlParserListener.py",
]
[tool.ruff.lint]
# Add the `line-too-long` rule to the enforced rule set. By default, Ruff omits rules that
# overlap with the use of a formatter, like Black, but we can override this behavior by
# explicitly adding the rule.
select = [
"B", # flake8-bugbear
"C", # ?!
"E", # pycodestyle
"F", # pyflakes
"W", # ?!?
"I", # isort
"SIM", # flake8-simplify
"UP", # pyupgrade
]
extend-select = ["E501"]
ignore = [
"E203",
"E266",
"E501",
"F841",
# if/else blocks are useful for separating the context for handling different scenarios.
# Cramming everything into a ternary operator neither adds clarity nor simplifies anything.
# Having seen many of the "corrected" examples, I feel rather strongly about this.
"SIM108",
# Being explicit when iterating over dict.keys() honestly seems clearer to me, though
# not a hill I'm willing to die on.
"SIM118",
]
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 100
[tool.ruff.lint.isort]
force-sort-within-sections = true
# multi-line-output = 3
known-first-party = ["redhdl"]