1 Star 3 Fork 1

openvinotoolkit-prc/nncf_pytorch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
pyproject.toml 5.45 KB
一键复制 编辑 原始数据 按行查看 历史
Alexander Dokuchaev 提交于 2025-04-24 18:01 +08:00 . Enable ruff UP006 rule (#3452)
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "nncf"
description = "Neural Networks Compression Framework"
readme="docs/PyPiPublishing.md"
license = { text = "Apache-2.0" }
authors = [{ name = "Intel" }, { email = "maksim.proshin@intel.com" }]
requires-python = ">=3.9"
dynamic = ["version"]
keywords = [
"bert",
"classification",
"compression",
"hawq",
"mixed-precision-training",
"mmdetection",
"nas",
"nlp",
"object-detection",
"pruning",
"quantization",
"quantization-aware-training",
"semantic-segmentation",
"sparsity",
"transformers",
]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]
dependencies = [
"jsonschema>=3.2.0",
"natsort>=7.1.0",
"networkx>=2.6, <3.5.0",
"ninja>=1.10.0.post2, <1.12",
"numpy>=1.24.0, <2.3.0",
"openvino-telemetry>=2023.2.0",
"packaging>=20.0",
"pandas>=1.1.5,<2.3",
"psutil",
"pydot>=1.4.1, <=3.0.4",
"pymoo>=0.6.0.1",
"rich>=13.5.2",
"safetensors>=0.4.1",
"scikit-learn>=0.24.0",
"scipy>=1.3.2",
"tabulate>=0.9.0",
]
[project.optional-dependencies]
plots = [
"kaleido>=0.2.1",
"matplotlib>=3.3.4",
"pillow>=9.0.0",
"plotly-express>=0.4.1",
]
[project.urls]
Homepage = "https://github.com/openvinotoolkit/nncf"
[tool.setuptools.dynamic]
version = { attr = "custom_version.version" }
[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests", "tests.*", "examples", "examples.*", "tools", "tools.*"]
namespaces = false
[tool.md_dead_link_check]
exclude_files = ["ReleaseNotes.md"]
[tool.mypy]
follow_imports = "silent"
strict = true
# should be removed later
# mypy recommends the following tool as an autofix:
# https://github.com/hauntsaninja/no_implicit_optional
implicit_optional = true
files = [
"nncf/api",
"nncf/data",
"nncf/common",
"nncf/config",
"nncf/torch/function_hook",
"nncf/quantization/*py",
"nncf/telemetry/",
"nncf/tensor/",
"nncf/*py",
]
disable_error_code = ["import-untyped"]
[[tool.mypy.overrides]]
module = "nncf.tensor.functions.*"
disable_error_code = ["empty-body", "no-any-return"]
[tool.ruff]
line-length = 120
exclude = [
"nncf/tensorflow/__init__.py",
"nncf/torch/function_hook/handle_inner_functions.py"
]
[tool.ruff.lint]
preview = true
ignore = [
"E201", # whitespace-after-open-bracket
"E203", # whitespace-before-punctuation
"E231", # missing-whitespace
"E251", # unexpected-spaces-around-keyword-parameter-equals
"E731", # lambda-assignment
"SIM108", # if-else-block-instead-of-if-exp
"SIM110", # reimplemented-builtin
"SIM117", # multiple-with-statements
"SIM103", # needless-bool
"NPY002", # numpy-legacy-random
"UP007", # non-pep604-annotation-union
"UP035", # deprecated-import
"UP038", # non-pep604-isinstance
"UP045", # non-pep604-annotation-optional
"D100", # undocumented-public-module
"D101", # undocumented-public-class
"D102", # undocumented-public-method
"D103", # undocumented-public-function
"D104", # undocumented-public-package
"D105", # undocumented-magic-method
"D106", # undocumented-public-nested-class
"D107", # undocumented-public-init
"D200", # unnecessary-multiline-docstring
"D203", # incorrect-blank-line-before-class
"D205", # missing-blank-line-after-summary
"D212", # multi-line-summary-first-line
"D400", # missing-trailing-period
"D401", # non-imperative-mood
"D402", # signature-in-docstring
"D404", # docstring-starts-with-this
"D413", # missing-blank-line-after-last-section
"D415", # missing-terminal-punctuation
"D417", # undocumented-param
"PERF203", # try-except-in-loop
"PERF401", # manual-list-comprehension
"PERF403", # manual-dict-comprehension
]
select = [
"CPY001", # copyright check
"D", # pydocstyle
"E", # pycodestyle rules
"EM", # flake8-errmsg
"F", # pyflakes rules
"I", # isort
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
"NPY", # numpy rules
"UP", # pyupgrade
"PERF", # perflint
]
extend-select = [
"SIM", # https://pypi.org/project/flake8-simplify
]
[tool.ruff.lint.per-file-ignores]
"nncf/experimental/torch/nas/bootstrapNAS/__init__.py" = ["F401"]
"nncf/torch/__init__.py" = ["F401", "E402"]
"tests/**/*.py" = ["F403"]
"tests/**/__init__.py" = ["F401"]
"examples/**/*.py" = ["F403"]
"!nncf/**.py" = ["INP", "D"]
[tool.ruff.lint.flake8-copyright]
notice-rgx = """\
# Copyright \\(c\\) (202[5,6]) Intel Corporation
# Licensed under the Apache License, Version 2.0 \\(the "License"\\);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
[tool.ruff.lint.isort]
force-single-line = true
known-third-party = ["datasets"]
single-line-exclusions = ["typing"]
[tool.pytest.ini_options]
pythonpath = "."
[tool.bandit]
exclude_dirs = ["tools", "tests", "**/venv*", "build"]
skips = [
"B101", # assert_used
"B404" , # import_subprocess
]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/openvinotoolkit-prc/nncf_pytorch.git
git@gitee.com:openvinotoolkit-prc/nncf_pytorch.git
openvinotoolkit-prc
nncf_pytorch
nncf_pytorch
develop

搜索帮助