forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
92 lines (79 loc) · 2.73 KB
/
pyproject.toml
File metadata and controls
92 lines (79 loc) · 2.73 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
[project]
name = "p4c"
version = "1.2.5.1"
description = ""
authors = [{ name = "The P4 Language Consortium", email = "info@p4.org" }]
requires-python = ">=3.8"
readme = "README.md"
license = "Apache"
# for grpcio, 1.75.1 works fine for us, but on Ubuntu 22 and 24, the dependency
# 'split' needs to use a different version under the hood. Thus we give a range.
dependencies = [
"pyroute2==0.7.3",
"ply==3.11",
"scapy==2.5.0",
"googleapis-common-protos==1.53.0",
"grpcio<=1.75.1,>=1.67.0; python_version > '3.6'",
"grpcio==1.48.2 ; python_version <= '3.6'",
"thrift==0.21.0",
"protobuf==3.20.2 ; python_version > '3.6'",
"protobuf==3.19.2 ; python_version <= '3.6'",
"clang-format==18.1.8",
"black==24.3.0 ; python_version > '3.6'",
"black==22.8.0 ; python_version <= '3.6'",
"isort==5.13.2 ; python_version > '3.6'",
"isort==5.10.1 ; python_version <= '3.6'",
"p4runtime",
"ptf",
]
[flake8]
max-line-length = 100
max-complexity = 10
extend-ignore = "E203"
[tool.uv]
package = false
[tool.uv.sources]
# FIXME: We should figure out a way to synchronize P4Runtime versions across CMake and Python.
# This is the same commit hash as defined in the top-level CMakelists.txt
p4runtime = { git = "https://github.com/p4lang/p4runtime.git", rev = "ec4eb5ef70dbcbcbf2f8357a4b2b8c2f218845a5", subdirectory = "py" }
ptf = { git = "https://github.com/p4lang/ptf.git", rev = "d016cdfe99f2d609cc9c7fd7f8c414b56d5b3c5c"}
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.isort]
profile = 'black'
line_length = 100
[tool.black]
line-length = 100
skip-string-normalization = true
[tool.mypy]
namespace_packages = true
disallow_untyped_defs = true
show_error_codes = true
no_implicit_optional = true
warn_return_any = true
warn_unused_ignores = true
[tool.ruff]
# Same as Black.
line-length = 100
indent-width = 4
[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.pylint.main]
init-hook="from pylint.config import find_default_config_files; import os, sys, pathlib; sys.path.append(next(find_default_config_files()).parent);sys.path.append(f'{pathlib.Path().home()}.local/lib/python{sys.version_info[0]}.{sys.version_info[1]}/site-packages/');"
[tool.pylint.messages_control]
max-line-length = 100
disable = [
"missing-docstring",
"missing-function-docstring",
"too-few-public-methods",
]