1+ [project ]
2+ name = " onnxoptimizer"
3+ description = " ONNX Optimizer"
4+ license = ' Apache-2.0'
5+ license-files = [
6+ " LICENSE"
7+ ]
8+ version = " 0.3.19"
9+ authors = [
10+ {
name =
' ONNX Optimizer Authors' ,
email =
" [email protected] " },
11+ ]
12+ readme = " README.md"
13+ keywords = [
14+ " deep-learning" ,
15+ " ONNX" ,
16+ ]
17+ dependencies = [
18+ " onnx" ,
19+ ]
20+
21+ [project .optional-dependencies ]
22+ mypy = [' mypy==0.600' ]
23+
24+ [project .urls ]
25+ Homepage = ' https://github.com/onnx/optimizer'
26+
27+ [console_scripts ]
28+ onnxoptimizer = " onnxoptimizer:main"
29+
130[build-system ]
231requires = [
332 " setuptools>=68" ,
@@ -6,3 +35,79 @@ requires = [
635 " protobuf>=4.25.1"
736]
837build-backend = " setuptools.build_meta"
38+
39+ [tool .pytest .ini_options ]
40+ # addopts = --nbval --current-env
41+ addopts = " -n auto"
42+ testpaths = [
43+ " onnxoptimizer/test/"
44+ ]
45+
46+ [[tool .mypy ]]
47+ # follow-imports = silent # TODO remove this
48+ mypy_path = " stubs:third_party/onnx/third_party/pybind11"
49+ strict_optional = true
50+ warn_return_any = true
51+ warn_no_return = true
52+ # TODO warn_unused_ignores = true
53+ warn_redundant_casts = true
54+ warn_incomplete_stub = true
55+ # TODO disallow_untyped_calls = true
56+ check_untyped_defs = true
57+ disallow_any_generics = true
58+ no_implicit_optional = true
59+ # TODO disallow_incomplete_defs = true
60+ # TODO disallow_subclassing_any = true
61+ disallow_untyped_decorators = true
62+ warn_unused_configs = true
63+
64+ [[tool .mypy .overrides ]]
65+ module = " onnxoptimizer.*"
66+ disallow_untyped_defs = true
67+
68+ [[tool .mypy .overrides ]]
69+ module = " onnx_opt_cpp2py_export"
70+ ignore_missing_imports = true
71+
72+ [[tool .mypy .overrides ]]
73+ module = " onnx.*"
74+ disallow_untyped_defs = true
75+ ignore_missing_imports = true
76+
77+ [[tool .mypy .overrides ]]
78+ module = " tools.*"
79+ disallow_untyped_defs = true
80+
81+ # Ignore errors in setup.py
82+ [[tool .mypy .overrides ]]
83+ module = " setup"
84+ ignore_errors = true
85+
86+ [tool .flake8 ]
87+ select = [" B" ," C" ," E" ," F" ," P" ," T4" ," W" ," B9" ]
88+ max-line-length = 80
89+ # ## DEFAULT IGNORES FOR 4-space INDENTED PROJECTS ###
90+ # E127, E128 are hard to silence in certain nested formatting situations.
91+ # E265, E266 talk about comment formatting which is too opinionated.
92+ # E402 warns on imports coming after statements. There are important use cases
93+ # like demandimport (https://fburl.com/demandimport) that require statements
94+ # before imports.
95+ # E501 is not flexible enough, we're using B950 instead.
96+ # E722 is a duplicate of B001.
97+ # F405 is hard to silence since we indeed do star import
98+ # P207 is a duplicate of B003.
99+ # P208 is a duplicate of C403.
100+ # W503 talks about operator formatting which is too opinionated.
101+ # F401 clashes with PEP484 requiring us to import types that are only used in
102+ # type comments.
103+ ignore = [" E127" , " E128" , " E265" , " E266" , " E402" , " E501" , " E722" , " F405" , " P207" , " P208" , " W503" , " F401" ]
104+ exclude = [
105+ " .git" ,
106+ " __pycache__" ,
107+ " build/*" ,
108+ " third_party/*" ,
109+ " *_pb2.py" ,
110+ " .cache/*" ,
111+ " .eggs" ,
112+ " .setuptools-cmake-build*/*" ,
113+ ]
0 commit comments