-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpyproject.toml
More file actions
167 lines (147 loc) · 4.06 KB
/
pyproject.toml
File metadata and controls
167 lines (147 loc) · 4.06 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
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
###########
# PROJECT #
###########
[project]
name = "dvsim"
version = "1.32.0"
description = "DV system"
authors = [{name = "lowRISC contributors (OpenTitan project)"}]
readme = "README.md"
license = "Apache-2.0"
license-files = ["LICENSE"]
requires-python = ">=3.10"
dependencies = [
"anybadge>=1.16.0",
# Keep sorted
"click>=8.1.7",
"enlighten>=1.12.4",
"gitpython>=3.1.45",
"hjson>=3.1.0",
"jinja2>=3.1.6",
"psutil>=7.2.2",
"pydantic>=2.9.2",
"pyyaml>=6.0.2",
"tabulate>=0.9.0",
"toml>=0.10.2",
# Needed for Self while supporting Python 3.10
"typing-extensions>=4.15.0",
]
[project.optional-dependencies]
typing = [
"pyright>=1.1.381",
]
linting = [
"ruff>=0.6.7",
]
debug = [
"ipython>=8.18.1",
]
test = [
"pyhamcrest>=2.1.0",
"pytest>=8.3.3",
"pytest-asyncio>=1.3.0",
"pytest-cov>=5.0.0",
"pytest-timeout>=2.4.0",
"pytest-mock>=3.15.1",
"pytest-repeat>=0.9.4",
"pytest-xdist>=3.8.0",
]
release = [
"python-semantic-release>=10.4.1",
]
dev = [
"dvsim[linting,typing,test,debug]"
]
ci = [
"dvsim[linting,typing,test]",
"gitpython",
]
# Dependency set to be installed automatically in the direnv-activated nix devshell
# - Leave out ruff(linting) as it contains a rust binary that needs to be installed by the flake
nix = [
"dvsim[typing,test,debug]",
"gitpython",
]
[project.scripts]
dvsim = "dvsim.cli:main"
dvsim-admin = "dvsim.cli.admin:cli"
################
# BUILD-SYSTEM #
################
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
########
# TOOL #
########
[tool.hatch]
metadata.allow-direct-references = true
[tool.pyright]
include = ["src"]
reportMissingImports = "error"
reportMissingTypeStubs = false
venv = ".venv"
executionEnvironments = [
{ root = "src" },
]
[tool.ruff]
target-version = "py310"
line-length = 100
[tool.ruff.lint]
preview = true
explicit-preview-rules = true
select = ["ALL"]
extend-select = ["W391", "E303"]
allowed-confusables = ["−"]
ignore = [
"D203", # Blank line after class def (we do not use this style)
"D213", # Multi-line summary second line (we do not use this style)
"COM812", # Missing trailing comma (unnecessary with auto format)
"FIX", # FIX related rules
"TD", # TODO related rules
"S603", # Start process without shell
"S607", # Start process with partial path
"TRY003", # Custom exception with vanilla args. This is reasonable if the
# exception is used as a sentinel.
"EM101", # String literals in exception
]
[tool.ruff.lint.per-file-ignores]
# Top-level CLIs should be allowed to print if needed
"src/dvsim/cli/**.py" = ["T201"]
"tests/**.py" = [
# Checks for boolean passed as positional argument which is useful in the
# main codebase for clarity. However it's common to assert against a boolean
# in tests and having to use kwargs in all cases will clutter the tests.
"FBT003",
# Configurable helper functions are common in test files and it is overbearing
# to restrict the number of arguments per function definition.
"PLR0913",
]
[tool.pytest.ini_options]
addopts = "--cov=dvsim --cov-report term-missing"
norecursedirs = ["*.egg", ".*", "_darcs", "build", "dist", "venv", "scratch", "doc"]
[tool.coverage.run]
parallel = true
concurrency = ["multiprocessing"]
[tool.coverage.report]
show_missing = true
[tool.semantic_release]
commit_parser = "conventional"
version_toml = ["pyproject.toml:project.version"]
commit_author = "semantic-release <actions@github.com>"
commit_message = "Bump version to v{version}"
[tool.semantic_release.commit_parser_options]
minor_tags = ["feat"]
patch_tags = ["fix", "perf", "refactor"]
parse_squash_commits = true
ignore_merge_commits = true
[tool.semantic_release.branches.main]
match = "master"
prerelease_token = "rc"
prerelease = false
[tool.semantic_release.remote]
name = "origin"
ignore_token_for_push = true