-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpyproject.toml
More file actions
131 lines (117 loc) · 4.4 KB
/
pyproject.toml
File metadata and controls
131 lines (117 loc) · 4.4 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
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["assembler_tools", "p-isa_tools", "heracles"]
[tool.setuptools.package-dir]
"" = "."
"heracles" = "p-isa_tools/data_formats/python/heracles"
[project]
name = "encrypted-computing-sdk"
version = "0.1.0"
description = "Encrypted Computing SDK"
requires-python = ">=3.10"
dependencies = [
"protobuf>=4.25.8",
"regex-spm",
"numpy>=2.2.6",
]
[project.optional-dependencies]
dev = [
"grpcio-tools==1.76.0", # needed for compiling protos from python directly
"pytest>=7.4.0",
"pre-commit>=4.3.0",
# pre-commit installs its own version of the tools below,
# but it is convenient to have them locally, too
"ruff>=0.14.2",
"mypy==1.18.2",
"cpplint>=1.6.0",
"pydantic>=2.12.4",
# Enables "doxygen" for python
"doxypypy>=0.8.8.7",
# For requirements generation
"pip-tools>=7.5.1",
# Dependabot
"virtualenv>=20.35.3",
]
[tool.ruff]
target-version = "py310"
line-length = 140
[tool.ruff.lint]
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
# Add other rule sets as needed: https://docs.astral.sh/ruff/rules/
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A", # flake8-builtins
"YTT", # flake8-2020
"S", # bandit
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"C90", # mccabe
"T", # flake8-todos
"FIX", # flake8-fixme
]
ignore = [
"S101", # Use of assert detected (common in tests)
"S108", # Probable insecure usage of temporary file or directory (allow use of `/tmp`)
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default arg in function definition
"FBT003", # Boolean positional value in function call
"A003", # Class attribute shadows built-in
"N801", # Class name should use CapWords convention (allow lowercase class names)
"N802", # Function name should be lowercase (allow camelCase function names)
"N806", # Variable in function should be lowercase (allows iN, logN style)
"N812", # Lowercase imported as non-lowercase (allow cinst imported as ISACInst)
"N815", # Variable in class scope should not be mixedCase (allow camelCase class variables)
"T201", # print() statements allowed
"FIX002", # TODO comments allowed (equivalent to pylint W0511)
"TD002", # Missing author in TODO
"TD003", # Missing issue link in TODO
"B028", # No explicit stacklevel keyword argument found
"UP038", # Prefer Union Type in isinstance (deprecated, and breaks some of our mocking)
]
# Exclude certain assembler files
exclude = [
"assembler_tools/hec-assembler-tools/assembler/common/run_config.py",
"assembler_tools/hec-assembler-tools/assembler/instructions/**",
"assembler_tools/hec-assembler-tools/assembler/memory_model/**",
"assembler_tools/hec-assembler-tools/assembler/stages/asm_scheduler.py",
"assembler_tools/hec-assembler-tools/assembler/stages/scheduler.py",
"assembler_tools/hec-assembler-tools/debug_tools/main.py",
"assembler_tools/hec-assembler-tools/debug_tools/xinst_timing_check/**",
"assembler_tools/hec-assembler-tools/he_as.py",
"assembler_tools/hec-assembler-tools/assembler/spec_config/isa_spec.py"
]
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint.per-file-ignores]
"assembler_tools/hec-assembler-tools/assembler/common/constants.py" = ["N805", "N802"] # do not force first arg to be called `self` here, allow camelCase function names
[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["iN", "logN"]
[tool.ruff.format]
# Use double quotes (matches your existing style)
quote-style = "double"
# Indent with spaces, rather than tabs
indent-style = "space"
# Respect magic trailing commas
skip-magic-trailing-comma = false
# Automatically detect the appropriate line ending
line-ending = "auto"
[tool.pytest.ini_options]
pythonpath = ["p-isa_tools/kerngen", "assembler_tools/hec-assembler-tools", "p-isa_tools/data_formats/python"]
[tool.mypy]
python_version = "3.10"
namespace_packages = true
show_error_codes = true
pretty = true
files = ["p-isa_tools/"]
exclude = [
"p-isa_tools/data_formats/python/heracles/proto/.*_pb2\\.py$",
]