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