Skip to content

Commit 2e98294

Browse files
src layout (#3560)
### Changes Updated structure of project to src layout ### Reason for changes https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/ ### Tests
1 parent b4006f8 commit 2e98294

File tree

686 files changed

+32
-33
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

686 files changed

+32
-33
lines changed

MANIFEST.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
graft nncf/torch/extensions
2-
graft nncf/common/hardware/configs
1+
graft src/nncf/torch/extensions
2+
graft src/nncf/common/hardware/configs
33
include LICENSE
44
include licensing/third-party-programs.txt
55
include docs/PyPiPublishing.md
6-
include custom_version.py
6+
include src/custom_version.py

README.md

Lines changed: 2 additions & 2 deletions

docs/ConfigFile.md

Lines changed: 1 addition & 1 deletion

docs/PyPiPublishing.md

Lines changed: 2 additions & 2 deletions

docs/api/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# using :type: syntax.
3636
autodoc_typehints = "description"
3737

38-
autoapi_dirs = ["../../../nncf"]
38+
autoapi_dirs = ["../../../src/nncf"]
3939
autoapi_options = ["members", "show-inheritance", "show-module-summary", "special-members", "imported-members"]
4040

4141
autoapi_template_dir = "_autoapi_templates"
@@ -190,7 +190,7 @@ def skip_non_api(app, what, name, obj, skip, options):
190190
def linkcode_resolve(domain, info):
191191
# sphinx.ext.linkcode interface; will link to Github here.
192192
target_ref = "develop"
193-
base_url = f"https://github.com/openvinotoolkit/nncf/blob/{target_ref}/"
193+
base_url = f"https://github.com/openvinotoolkit/nncf/blob/{target_ref}/src/"
194194
if not info["module"]:
195195
return None
196196
fullname = info["module"] + "." + info["fullname"]

docs/usage/training_time_compression/other_algorithms/LegacyQuantization.md

Lines changed: 1 addition & 1 deletion

pyproject.toml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ Homepage = "https://github.com/openvinotoolkit/nncf"
6565
version = { attr = "custom_version.version" }
6666

6767
[tool.setuptools.packages.find]
68-
where = ["."]
69-
exclude = ["tests", "tests.*", "examples", "examples.*", "tools", "tools.*"]
68+
where = ["src"]
7069
namespaces = false
7170

7271
[tool.md_dead_link_check]
@@ -80,15 +79,15 @@ strict = true
8079
# https://github.com/hauntsaninja/no_implicit_optional
8180
implicit_optional = true
8281
files = [
83-
"nncf/api",
84-
"nncf/data",
85-
"nncf/common",
86-
"nncf/config",
87-
"nncf/torch/function_hook",
88-
"nncf/quantization/*py",
89-
"nncf/telemetry/",
90-
"nncf/tensor/",
91-
"nncf/*py",
82+
"src/nncf/api",
83+
"src/nncf/data",
84+
"src/nncf/common",
85+
"src/nncf/config",
86+
"src/nncf/torch/function_hook",
87+
"src/nncf/quantization/*py",
88+
"src/nncf/telemetry/",
89+
"src/nncf/tensor/",
90+
"src/nncf/*py",
9291
]
9392
disable_error_code = ["import-untyped"]
9493

@@ -100,8 +99,8 @@ disable_error_code = ["empty-body", "no-any-return"]
10099
[tool.ruff]
101100
line-length = 120
102101
exclude = [
103-
"nncf/tensorflow/__init__.py",
104-
"nncf/torch/function_hook/handle_inner_functions.py"
102+
"src/nncf/tensorflow/__init__.py",
103+
"src/nncf/torch/function_hook/handle_inner_functions.py"
105104
]
106105

107106
[tool.ruff.lint]
@@ -162,12 +161,12 @@ extend-select = [
162161
]
163162

164163
[tool.ruff.lint.per-file-ignores]
165-
"nncf/experimental/torch/nas/bootstrapNAS/__init__.py" = ["F401"]
166-
"nncf/torch/__init__.py" = ["F401", "E402"]
164+
"src/nncf/experimental/torch/nas/bootstrapNAS/__init__.py" = ["F401"]
165+
"src/nncf/torch/__init__.py" = ["F401", "E402"]
167166
"tests/**/*.py" = ["F403"]
168167
"tests/**/__init__.py" = ["F401"]
169168
"examples/**/*.py" = ["F403"]
170-
"!nncf/**.py" = ["INP", "D"]
169+
"!src/nncf/**.py" = ["INP", "D"]
171170

172171
[tool.ruff.lint.flake8-copyright]
173172
notice-rgx = """\

custom_version.py renamed to src/custom_version.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
1. **NNCF_RELEASE_BUILD**:
2424
- Set this environment variable to generate a release package using `python -m build` without including
2525
the commit hash in the version.
26-
- If this variable is not set, the file `nncf/version.py` will be overridden with a custom version
26+
- If this variable is not set, the file `src/nncf/version.py` will be overridden with a custom version
2727
that includes the commit hash. Example usage:
2828
2929
NNCF_RELEASE_BUILD=1 python -m build
@@ -35,12 +35,12 @@
3535
3636
Post-Build Recommendation:
3737
---------------------------
38-
After generating the package, it is recommended to revert any changes to `nncf/version.py` to avoid potential conflicts.
38+
After generating the package, revert changes to src/nncf/version.py to prevent possible conflicts.
3939
This can be done using the following command:
4040
41-
git checkout nncf/version.py
41+
git checkout src/nncf/version.py
4242
43-
This ensures that `nncf/version.py` remains in its original state after the dynamic versioning process.
43+
This ensures that `src/nncf/version.py` remains in its original state after the dynamic versioning process.
4444
"""
4545

4646
from __future__ import annotations
@@ -51,7 +51,7 @@
5151
import subprocess
5252
from pathlib import Path
5353

54-
NNCF_VERSION_FILE = "nncf/version.py"
54+
NNCF_VERSION_FILE = "src/nncf/version.py"
5555

5656

5757
def get_custom_version() -> str:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)