-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathpyproject.toml
More file actions
119 lines (103 loc) · 3.32 KB
/
pyproject.toml
File metadata and controls
119 lines (103 loc) · 3.32 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
# SPDX-License-Identifier: Apache-2.0
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "onnx-script"
dynamic = ["version"]
description = "Authoring ONNX functions in Python"
authors = [{ name = "Microsoft Corporation", email = "onnx@microsoft.com" }]
urls = { "Repository" = "https://github.com/onnx/onnx-script" }
readme = "README.md"
requires-python = ">=3.7"
license = { text = 'Apache License v2.0' }
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License",
]
dependencies = ["numpy>=1.21.5", "protobuf<4", "onnx"]
[project.optional-dependencies]
test = ["flake8", "mypy", "black", "isort[colors]", "pylint"]
[tool.setuptools.dynamic]
version = {attr = "onnxscript.__version__"}
[tool.setuptools.packages.find]
exclude = ["onnxscript.test.*"]
[tool.setuptools.package-data]
onnxscript = ["py.typed"]
onnx = ["py.typed"]
[tool.pytest.ini_options]
filterwarnings = ["ignore::UserWarning", "ignore::DeprecationWarning"]
[tool.mypy]
follow_imports = "silent" # TODO: Remove when we fix all the mypy errors
strict_optional = true
warn_no_return = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_incomplete_stub = true
# TODO disallow_untyped_calls = true
check_untyped_defs = true
disallow_any_generics = true
no_implicit_optional = true
# TODO disallow_incomplete_defs = true
# TODO disallow_subclassing_any = true
disallow_untyped_decorators = true
warn_unused_configs = true
show_error_codes = true
show_column_numbers = true
[[tool.mypy.overrides]]
module = [
"onnx.*",
"onnxruntime.*",
"autopep8.*",
"parameterized.*",
"torchgen.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "tools.*"
disallow_untyped_defs = true
# Ignore errors in test
[[tool.mypy.overrides]]
module = [
"setup",
"onnxscript.test.models.*",
"onnxscript.test.onnx_backend_test_code.*",
]
ignore_errors = true
[tool.black]
target-version = ["py37", "py38", "py39", "py310"]
# Black's extend-exclude needs to be a regex string
extend-exclude = "/onnxscript/test/models|/onnxscript/test/onnx_backend_test_code"
line-length = 95
[tool.isort]
profile = "black"
extend_skip_glob = [
"onnxscript/test/onnx_backend_test_code/*.py",
]
[tool.pylint.messages_control]
# This list is for vscode. Add new disables in pyproject_pylint.toml for lintrunner
# Exclude patterns should be modified in .lintrunner.toml
disable = [
"format",
"import-error",
"invalid-name", # TODO: Add naming guidance and enable this check.
"line-too-long",
"no-name-in-module",
]
[tool.pydocstyle]
convention = "google"
# D1 is for missing docstrings, which is not yet enforced.
# D202 Too strict. "No blank lines allowed after function docstring"
# D205 Too strict. "1 blank line required between summary line and description"
# D415 Not yet enforced. "First line should end with a period, question mark, or exclamation point"
add-ignore = ["D1", "D202", "D205", "D415"]