From 96de78c633216511abb8a3b3272e3e319c9e0ab4 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 23 Sep 2024 00:42:29 +0300 Subject: [PATCH 1/5] pyproject.toml instead of setup.py --- .github/workflows/python-publish.yml | 3 +- MANIFEST.in | 1 + _version_helper.py | 73 +++++++ .../classification/mobilenet_v3_tv_092.py | 2 +- .../nas/bootstrapNAS/training/lr_scheduler.py | 2 +- pyproject.toml | 72 +++++++ setup.py | 178 ------------------ tests/cross_fw/shared/helpers.py | 4 +- .../experimental/test_models/resnet.py | 10 +- 9 files changed, 157 insertions(+), 188 deletions(-) create mode 100644 _version_helper.py create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index b8d9f5c4f70..52a340ba468 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -39,8 +39,9 @@ jobs: env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + NNCF_RELEASE_BUILD: "1" run: | - python -m build -C--global-option=--release + python -m build # Disallow uploading dev packages for file in dist/*; do diff --git a/MANIFEST.in b/MANIFEST.in index e4af5d0cef4..963195909a2 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,3 +3,4 @@ graft nncf/common/hardware/configs include LICENSE include licensing/third-party-programs.txt include docs/PyPiPublishing.md +include _version_helper.py diff --git a/_version_helper.py b/_version_helper.py new file mode 100644 index 00000000000..2fb2f69bba0 --- /dev/null +++ b/_version_helper.py @@ -0,0 +1,73 @@ +# Copyright (c) 2024 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. + + +# NOTE 1: This module generates the dynamic version for the package during the build process. +# It provides the version attribute for setuptools as specified in pyproject.toml: +# [tool.setuptools.dynamic] +# version = { attr = "_version_helper.version" } + +# NOTE 2: To generate a release package without including the commit hash in the version, +# set the NNCF_RELEASE_BUILD environment variable. + +from __future__ import annotations + +import contextlib +import os +import re +from pathlib import Path + +NNCF_VERSION_FILE = "nncf/version.py" + + +def get_custom_version() -> str: + version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", Path(NNCF_VERSION_FILE).read_text(), re.M) + if not version_match: + raise RuntimeError("Unable to find version string.") + version_value = version_match.group(1) + is_building_release = "NNCF_RELEASE_BUILD" in os.environ + + if not is_building_release: + + import subprocess # nosec + + dev_version_id = "unknown_version" + repo_root = os.path.dirname(os.path.realpath(__file__)) + + # Get commit hash + with contextlib.suppress(subprocess.CalledProcessError): + dev_version_id = ( + subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=repo_root) # nosec + .strip() + .decode() + ) + + # Detect modified files + with contextlib.suppress(subprocess.CalledProcessError): + repo_root = os.path.dirname(os.path.realpath(__file__)) + run = subprocess.run(["git", "diff-index", "--quiet", "HEAD"], cwd=repo_root) # nosec + if run.returncode == 1: + dev_version_id += "dirty" + + return version_value + f".dev0+{dev_version_id}" + + return version_value + + +version: str + + +def __getattr__(name: str) -> str: + if name == "version": + global version + version = get_custom_version() + return version + raise AttributeError(name) diff --git a/examples/torch/common/models/classification/mobilenet_v3_tv_092.py b/examples/torch/common/models/classification/mobilenet_v3_tv_092.py index 1ba5f4d5cb3..3cec3ec0bfd 100644 --- a/examples/torch/common/models/classification/mobilenet_v3_tv_092.py +++ b/examples/torch/common/models/classification/mobilenet_v3_tv_092.py @@ -301,7 +301,7 @@ def _mobilenet_v3_model( last_channel: int, pretrained: bool, progress: bool, - **kwargs: Any + **kwargs: Any, ): model = MobileNetV3(inverted_residual_setting, last_channel, **kwargs) if pretrained: diff --git a/nncf/experimental/torch/nas/bootstrapNAS/training/lr_scheduler.py b/nncf/experimental/torch/nas/bootstrapNAS/training/lr_scheduler.py index bdb8127d75b..fe57c0b860b 100644 --- a/nncf/experimental/torch/nas/bootstrapNAS/training/lr_scheduler.py +++ b/nncf/experimental/torch/nas/bootstrapNAS/training/lr_scheduler.py @@ -147,7 +147,7 @@ def __init__( base_lr: float, num_epochs: float, warmup_epochs: float = 0, - warmup_lr: float = 3.4e-4 + warmup_lr: float = 3.4e-4, ): super().__init__(optimizer, num_steps_in_epoch) self._base_lr = base_lr diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..e751c7aa37a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,72 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "nncf" +description = "Neural Networks Compression Framework" +readme = "README.md" +license = { text = "Apache-2.0" } +authors = [{ name = "Intel" }, { email = "alexander.kozlov@intel.com" }] +requires-python = ">=3.8" +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", + "jstyleson>=0.0.2", + "natsort>=7.1.0", + "networkx>=2.6, <=3.3", + "ninja>=1.10.0.post2, <1.12", + "numpy>=1.19.1, <1.27", + "openvino-telemetry>=2023.2.0", + "packaging>=20.0", + "pandas>=1.1.5,<2.3", + "psutil", + "pydot>=1.4.1, <3.0.0", + "pymoo>=0.6.0.1", + "rich>=13.5.2", + "scikit-learn>=0.24.0", + "scipy>=1.3.2", + "tabulate>=0.9.0", + "tqdm>=4.54.1", +] + + +[project.optional-dependencies] +plots = [ + "kaleido>=0.2.1", + "matplotlib>=3.3.4, <3.6", + "pillow>=9.0.0", + "plotly-express>=0.4.1", +] + +[project.urls] +Homepage = "https://github.com/openvinotoolkit/nncf" + +[tool.setuptools.dynamic] +version = { attr = "_version_helper.version" } + +[tool.setuptools.packages.find] +where = ["."] +exclude = ["tests", "tests.*", "examples", "examples.*", "tools", "tools.*"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 8685c9f9982..00000000000 --- a/setup.py +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright (c) 2024 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. - -# *WARNING*: Do not run this file directly by `python setup.py install` -# or with any other parameter - this is an outdated and error-prone way -# to install Python packages and causes particular problems with namespace -# packages such as `protobuf`. -# Refer to the table below for well-known and supported alternatives with -# the same behavior: -# +-------------------------------------+---------------------------------------------+ -# | Old command | New command | -# +-------------------------------------+---------------------------------------------+ -# | python setup.py install | pip install . | -# | python setup.py develop | pip install -e . | -# | python setup.py develop --*arg* | pip install --install-option="*arg*" -e . | -# | python setup.py sdist | python -m build -s | <-- using the "build" package -# | python setup.py bdist_wheel | python -m build -w | <-- pypi.org/project/build/ -# | python setup.py bdist_wheel --*arg* | python -m build -w -C--global-option=--*arg*| -# +-------------------------------------+---------------------------------------------+ -# -# PyPA in general recommends to move away from setup.py and use pyproject.toml -# instead. This doesn't fit us as we currently want to do custom stuff during -# installation such as setting version based on the commit SHA for repo-based -# installs. - - -import codecs -import glob -import os -import re -import stat -import sys -import sysconfig - -import setuptools -from pkg_resources import parse_version -from setuptools import find_packages -from setuptools import setup - -here = os.path.abspath(os.path.dirname(__file__)) -BKC_SETUPTOOLS_VERSION = "59.5.0" - -setuptools_version = parse_version(setuptools.__version__).base_version -if setuptools_version < "43.0.0": - raise RuntimeError( - "To properly install NNCF, please install setuptools>=43.0.0, " - f"while current setuptools version is {setuptools.__version__}. " - f"Recommended version is {BKC_SETUPTOOLS_VERSION}." - ) - -python_version = sys.version_info -if python_version < (3, 8, 0): - print("Only Python >= 3.8.0 is supported") - sys.exit(0) - -version_string = "{}{}".format(sys.version_info[0], sys.version_info[1]) - -is_installing_editable = "develop" in sys.argv -is_building_release = not is_installing_editable and "--release" in sys.argv -if "--release" in sys.argv: - sys.argv.remove("--release") - - -def read(*parts): - with codecs.open(os.path.join(here, *parts), "r") as fp: - return fp.read() - - -def find_version(*file_paths): - version_file = read(*file_paths) - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) - if not version_match: - raise RuntimeError("Unable to find version string.") - version_value = version_match.group(1) - if not is_building_release: - if is_installing_editable: - return version_value + ".dev0+editable" - import subprocess # nosec - - dev_version_id = "unknown_version" - try: - repo_root = os.path.dirname(os.path.realpath(__file__)) - dev_version_id = ( - subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=repo_root) # nosec - .strip() - .decode() - ) - except subprocess.CalledProcessError: - pass - return version_value + f".dev0+{dev_version_id}" - - return version_value - - -INSTALL_REQUIRES = [ - "jsonschema>=3.2.0", - "jstyleson>=0.0.2", - "natsort>=7.1.0", - "networkx>=2.6, <=3.3", - "ninja>=1.10.0.post2, <1.12", - "numpy>=1.19.1, <1.27", - "openvino-telemetry>=2023.2.0", - "packaging>=20.0", - "pandas>=1.1.5,<2.3", - "psutil", - "pydot>=1.4.1, <3.0.0", - "pymoo>=0.6.0.1", - "rich>=13.5.2", - "scikit-learn>=0.24.0", - "scipy>=1.3.2", - "tabulate>=0.9.0", - "tqdm>=4.54.1", -] - -EXTRAS_REQUIRE = { - "plots": [ - "kaleido>=0.2.1", - "matplotlib>=3.3.4, <3.6", - "pillow>=9.0.0", - "plotly-express>=0.4.1", - ], -} - -with open("{}/docs/PyPiPublishing.md".format(here), "r", encoding="utf8") as fh: - long_description = fh.read() - -setup( - name="nncf", - version=find_version(os.path.join(here, "nncf/version.py")), - author="Intel", - author_email="alexander.kozlov@intel.com", - description="Neural Networks Compression Framework", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/openvinotoolkit/nncf", - license="Apache-2.0", - packages=find_packages(exclude=["tests", "tests.*", "examples", "examples.*", "tools", "tools.*"]), - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], - install_requires=INSTALL_REQUIRES, - extras_require=EXTRAS_REQUIRE, - keywords=[ - "compression", - "quantization", - "sparsity", - "mixed-precision-training", - "quantization-aware-training", - "hawq", - "classification", - "pruning", - "object-detection", - "semantic-segmentation", - "nas", - "nlp", - "bert", - "transformers", - "mmdetection", - ], - include_package_data=True, -) - -path_to_ninja = glob.glob(str(sysconfig.get_paths()["purelib"] + "/ninja*/ninja/data/bin/")) -if path_to_ninja: - path_to_ninja = str(path_to_ninja[0] + "ninja") - if not os.access(path_to_ninja, os.X_OK): - st = os.stat(path_to_ninja) - os.chmod(path_to_ninja, st.st_mode | stat.S_IEXEC) diff --git a/tests/cross_fw/shared/helpers.py b/tests/cross_fw/shared/helpers.py index 0211c9f7796..1b9b9ef2d66 100644 --- a/tests/cross_fw/shared/helpers.py +++ b/tests/cross_fw/shared/helpers.py @@ -79,9 +79,9 @@ def create_venv_with_nncf(tmp_path: Path, package_type: str, venv_type: str, bac elif package_type == "pip_git_develop": run_cmd_line = f"{pip_with_venv} install git+{GITHUB_REPO_URL}@develop#egg=nncf" elif package_type == "build_s": - run_cmd_line = f"{python_executable_with_venv} -m build -n -s" + run_cmd_line = f"{python_executable_with_venv} -m build -s" elif package_type == "build_w": - run_cmd_line = f"{python_executable_with_venv} -m build -n -w" + run_cmd_line = f"{python_executable_with_venv} -m build -w" else: raise nncf.ValidationError(f"Invalid package type: {package_type}") diff --git a/tests/tensorflow/experimental/test_models/resnet.py b/tests/tensorflow/experimental/test_models/resnet.py index f3becac3eca..ea7fc252a06 100644 --- a/tests/tensorflow/experimental/test_models/resnet.py +++ b/tests/tensorflow/experimental/test_models/resnet.py @@ -57,7 +57,7 @@ def __init__( activation="relu", gating_activation="sigmoid", round_down_protect=True, - **kwargs + **kwargs, ): """Initializes a squeeze and excitation layer. @@ -288,7 +288,7 @@ def __init__( norm_momentum=0.99, norm_epsilon=0.001, bn_trainable=True, - **kwargs + **kwargs, ): """Initializes a residual block with BN after convolutions. @@ -487,7 +487,7 @@ def __init__( norm_momentum=0.99, norm_epsilon=0.001, bn_trainable=True, - **kwargs + **kwargs, ): """Initializes a standard bottleneck block with BN after convolutions. @@ -795,7 +795,7 @@ def __init__( kernel_regularizer: Optional[tf.keras.regularizers.Regularizer] = None, bias_regularizer: Optional[tf.keras.regularizers.Regularizer] = None, bn_trainable: bool = True, - **kwargs + **kwargs, ): """Initializes a ResNet model. @@ -1063,7 +1063,7 @@ def __init__( norm_momentum: float = 0.99, norm_epsilon: float = 0.001, skip_logits_layer: bool = False, - **kwargs + **kwargs, ): """Classification initialization function. From 7488abe44c32c429efe9b29190ed369457c72316 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 23 Sep 2024 01:04:52 +0300 Subject: [PATCH 2/5] tools --- .github/workflows/nightly.yml | 3 +- .github/workflows/pre-commit-linters.yml | 3 +- .isort.cfg | 6 -- .mypy.ini | 9 --- .pre-commit-config.yaml | 1 - md_dead_link_check.toml | 2 - pyproject.toml | 80 +++++++++++++++++++++++- ruff.toml | 49 --------------- 8 files changed, 81 insertions(+), 72 deletions(-) delete mode 100644 .isort.cfg delete mode 100644 .mypy.ini delete mode 100644 md_dead_link_check.toml delete mode 100644 ruff.toml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 068e3fdd0a3..9ecb8082e87 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,5 +12,4 @@ jobs: steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: AlexanderDokuchaev/md-dead-link-check@cc3ed55268899a1a6d5fd7068abbc4591eab1f74 # v0.9 - with: - config: md_dead_link_check.toml + diff --git a/.github/workflows/pre-commit-linters.yml b/.github/workflows/pre-commit-linters.yml index 07c8fef047f..0b1d530f08e 100644 --- a/.github/workflows/pre-commit-linters.yml +++ b/.github/workflows/pre-commit-linters.yml @@ -25,5 +25,4 @@ jobs: steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: AlexanderDokuchaev/md-dead-link-check@cc3ed55268899a1a6d5fd7068abbc4591eab1f74 # v0.9 - with: - config: md_dead_link_check.toml + diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index f9b4e5d5a32..00000000000 --- a/.isort.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[settings] -line_length = 120 -force_single_line = true -profile = black -single_line_exclusions = typing -skip_glob=examples/post_training_quantization/torch/ssd300_vgg16/main.py diff --git a/.mypy.ini b/.mypy.ini deleted file mode 100644 index e5a0e91f44c..00000000000 --- a/.mypy.ini +++ /dev/null @@ -1,9 +0,0 @@ -[mypy] -files = nncf/common/sparsity, nncf/common/graph, nncf/common/accuracy_aware_training/, nncf/common/utils/, nncf/common/tensor_statistics -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 34a33e90ad7..46f56b504fc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,6 @@ repos: hooks: - id: black files: '^.*\.py' - args: ["--line-length", "120"] - repo: https://github.com/pycqa/isort rev: 5.12.0 diff --git a/md_dead_link_check.toml b/md_dead_link_check.toml deleted file mode 100644 index cfe1ac2823c..00000000000 --- a/md_dead_link_check.toml +++ /dev/null @@ -1,2 +0,0 @@ -[tool.md_dead_link_check] -exclude_files = ["ReleaseNotes.md"] diff --git a/pyproject.toml b/pyproject.toml index e751c7aa37a..1662953ba22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,6 @@ dependencies = [ "tqdm>=4.54.1", ] - [project.optional-dependencies] plots = [ "kaleido>=0.2.1", @@ -70,3 +69,82 @@ version = { attr = "_version_helper.version" } [tool.setuptools.packages.find] where = ["."] exclude = ["tests", "tests.*", "examples", "examples.*", "tools", "tools.*"] + +[tool.black] +line-length = 120 + +[tool.md_dead_link_check] +exclude_files = ["ReleaseNotes.md"] + +[tool.isort] +line_length = 120 +force_single_line = true +profile = "black" +single_line_exclusions = "typing" +skip_glob = "examples/post_training_quantization/torch/ssd300_vgg16/main.py" + +[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/common/sparsity", + "nncf/common/graph", + "nncf/common/accuracy_aware_training/", + "nncf/common/utils/", + "nncf/common/tensor_statistics", +] + +[tool.ruff] +line-length = 120 +exclude = ["nncf/tensorflow/__init__.py"] + +[tool.ruff.lint] +preview = true +ignore-init-module-imports = 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 +] +select = [ + "E", # pycodestyle rules + "F", # pyflakes rules + "CPY001", # copyright check + "NPY", # numpy rules + +] +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"] + +[tool.ruff.lint.flake8-copyright] +notice-rgx = """\ +# Copyright \\(c\\) (\\d{4}|\\d{4}-\\d{4}) 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. +""" diff --git a/ruff.toml b/ruff.toml deleted file mode 100644 index 517eed635cc..00000000000 --- a/ruff.toml +++ /dev/null @@ -1,49 +0,0 @@ -line-length = 120 -exclude = ["nncf/tensorflow/__init__.py"] - -[lint] -preview = true -ignore-init-module-imports = 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 -] -select = [ - "E", # pycodestyle rules - "F", # pyflakes rules - "CPY001", # copyright check - "NPY", # numpy rules -] -extend-select = [ - "SIM", # https://pypi.org/project/flake8-simplify -] - -[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"] - - -[lint.flake8-copyright] -notice-rgx = """\ -# Copyright \\(c\\) (\\d{4}|\\d{4}-\\d{4}) 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. -""" From d0a95d99c2e751d0b0848f03bebffb1dea4c57a0 Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Mon, 23 Sep 2024 13:46:18 +0300 Subject: [PATCH 3/5] mypy --- .github/workflows/mypy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 62643c02592..644c433287a 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -21,4 +21,4 @@ jobs: - name: Install mypy run: pip install mypy==1.8.0 - name: Run mypy - run: mypy --install-types --config-file=.mypy.ini --non-interactive + run: mypy --install-types --non-interactive From 4a940957b8deeafe9a43d5f615b5e791506f63ec Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Tue, 24 Sep 2024 00:35:09 +0300 Subject: [PATCH 4/5] namespaces = false --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1662953ba22..0c13d2f3a8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,6 +69,7 @@ version = { attr = "_version_helper.version" } [tool.setuptools.packages.find] where = ["."] exclude = ["tests", "tests.*", "examples", "examples.*", "tools", "tools.*"] +namespaces = false [tool.black] line-length = 120 @@ -122,7 +123,6 @@ select = [ "F", # pyflakes rules "CPY001", # copyright check "NPY", # numpy rules - ] extend-select = [ "SIM", # https://pypi.org/project/flake8-simplify From b8b4c3c984804f918e321b531f19f0f718aff59c Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Tue, 24 Sep 2024 16:11:39 +0300 Subject: [PATCH 5/5] docs/PyPiPublishing.md --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0c13d2f3a8c..c6667d6d2a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "nncf" description = "Neural Networks Compression Framework" -readme = "README.md" +readme="docs/PyPiPublishing.md" license = { text = "Apache-2.0" } authors = [{ name = "Intel" }, { email = "alexander.kozlov@intel.com" }] requires-python = ">=3.8"