Skip to content

Commit 43c3c6e

Browse files
Release v2.15.0 of NNCF to master
1 parent 5bfbed5 commit 43c3c6e

File tree

1,541 files changed

+73478
-39295
lines changed

Some content is hidden

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

1,541 files changed

+73478
-39295
lines changed

.git-blame-ignore-revs

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Happy New 2025 Copyright Year!
2+
6a05971d9352e381c7e0719bbf7d95f3cae714fe
3+
4+
# Happy New 2024 Copyright Year!
5+
4c01098ef72c82026207cdbefd8b4b2c412bcd2c
6+
17
# pre-commit autoformatting (isort, black)
28
de18dbe23246135d3604a8116c3484e98a8ed0cc
39

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright (c) 2025 Intel Corporation
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
import re
13+
import sys
14+
from pathlib import Path
15+
16+
CONSTRAINTS_FILE = "constraints.txt"
17+
18+
19+
def main():
20+
arg = sys.argv[1]
21+
overrided_requirements = [r.strip() for r in arg.split(",")]
22+
23+
print("overrided_requirements: ", arg)
24+
25+
file = Path(CONSTRAINTS_FILE)
26+
content = file.read_text()
27+
28+
for new_requirement in overrided_requirements:
29+
new_requirement = new_requirement.strip()
30+
package_name = new_requirement.split("==")[0]
31+
content = re.sub(f"^{package_name}\s*[=><].*", "", content, flags=re.MULTILINE)
32+
content += f"\n{new_requirement}"
33+
34+
print("New constraints:")
35+
print(content)
36+
37+
file.write_text(content)
38+
39+
40+
if __name__ == "__main__":
41+
main()

.github/scripts/pytest_md_summary.py

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Copyright (c) 2025 Intel Corporation
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
import sys
13+
14+
from defusedxml import ElementTree as ET
15+
16+
17+
def parse_xml_report(xml_file) -> None:
18+
"""
19+
Parse the XML report generated by pytest.
20+
21+
:param xml_file: Path to the XML report file
22+
:return: None
23+
"""
24+
try:
25+
tree = ET.parse(xml_file)
26+
except FileNotFoundError:
27+
sys.exit(1)
28+
29+
root = tree.getroot()
30+
31+
# Build the summary table in Markdown format
32+
table_lines = []
33+
table_lines.append("| Test Name | Status | Time | Message |")
34+
table_lines.append("|:----------|:------:|-----:|:--------|")
35+
36+
# Iterate over test cases
37+
for testcase in root.findall(".//testcase"):
38+
test_name = testcase.get("name")
39+
time_duration = float(testcase.get("time", "0"))
40+
message = ""
41+
if testcase.find("failure") is not None:
42+
status = "$${\color{red}Failed}$$"
43+
message = testcase.find("failure").get("message", "")
44+
elif testcase.find("error") is not None:
45+
status = "$${\color{red}Error}$$"
46+
elif testcase.find("skipped") is not None:
47+
if "xfail" in testcase.find("skipped").get("type", ""):
48+
status = "$${\color{orange}xfail}$$"
49+
message = testcase.find("skipped").get("message", "")
50+
else:
51+
status = "$${\color{yellow}Skipped}$$"
52+
message = testcase.find("skipped").get("message", "")
53+
else:
54+
status = "$${\color{green}Ok}$$"
55+
56+
# Append each row to the table
57+
if message:
58+
message = message.splitlines()[0][:60]
59+
table_lines.append(f"| {test_name} | {status} | {time_duration:.0f} | {message} |")
60+
61+
if len(table_lines) > 2:
62+
# Print the summary table only if there are test cases
63+
print("\n".join(table_lines))
64+
65+
66+
if __name__ == "__main__":
67+
"""
68+
This script generates a summary table in Markdown format from an XML report generated by pytest.
69+
70+
Usage in GitHub workflow:
71+
- name: Test Summary
72+
if: ${{ !cancelled() }}
73+
run: |
74+
python .github/scripts/generate_examples_summary.py pytest-results.xml >> $GITHUB_STEP_SUMMARY
75+
"""
76+
try:
77+
parse_xml_report(sys.argv[1])
78+
except Exception as e:
79+
print(f"Error: {e}")

.github/workflows/api_changes_check.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,20 @@ jobs:
1919
with:
2020
ref: "refs/pull/${{ github.event.number }}/merge"
2121
compare-api-doc-with-develop:
22+
timeout-minutes: 30
2223
needs: call-build-api-doc
2324
runs-on: ubuntu-20.04
2425
permissions:
2526
issues: write
2627
steps:
2728
- name: Download built HTML doc as artifact from previous step
28-
uses: alehechka/download-tartifact@1195216b256562056097b175df17b167557f8681 # v2
29+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
2930
with:
3031
name: html_doc_artifact
32+
- run: |
33+
tar -xvf artifact.tar
34+
rm artifact.tar
35+
shell: 'bash'
3136
- name: Checkout latest doc_pages branch tip
3237
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
3338
with:
@@ -58,7 +63,7 @@ jobs:
5863
echo '{"pr_number": "${{ github.event.pull_request.number }}", "action": "none"}' > api_status.json
5964
6065
- name: Upload artifact
61-
uses: actions/upload-artifact@v4
66+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b #v4.5.0
6267
with:
6368
name: api_status
6469
path: api_status.json

.github/workflows/build_and_publish_doc.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,29 @@ jobs:
2626
steps:
2727
- name: Checkout main repo # the github-pages-deploy-action seems to require this step
2828
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
29+
2930
- name: Download HTML doc build artifact
30-
uses: alehechka/download-tartifact@1195216b256562056097b175df17b167557f8681 # v2
31+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
3132
with:
3233
name: html_doc_artifact
34+
- name: Extract artifact
35+
shell: 'bash'
36+
run: |
37+
tar -xvf artifact.tar
38+
rm artifact.tar
39+
3340
- name: Download schema doc build artifact
34-
uses: alehechka/download-tartifact@1195216b256562056097b175df17b167557f8681 # v2
41+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
3542
with:
3643
name: schema_doc_artifact
3744
path: html_build/html
45+
- name: Extract artifact
46+
shell: 'bash'
47+
working-directory: html_build/html
48+
run: |
49+
tar -xvf artifact.tar
50+
rm artifact.tar
51+
3852
- name: Publish built docs on Github Pages branch ${{ env.GH_PAGES_BRANCH }}
3953
uses: JamesIves/github-pages-deploy-action@5c6e9e9f3672ce8fd37b9856193d2a537941e66c # v4.6.1
4054
with:

.github/workflows/build_html_doc.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
type: string
1010
jobs:
1111
build-html:
12+
timeout-minutes: 10
1213
runs-on: ubuntu-20.04
1314
steps:
1415
- name: Checkout
@@ -18,16 +19,17 @@ jobs:
1819
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
1920
with:
2021
python-version: 3.10.14
21-
cache: pip
2222
- name: Install NNCF and doc requirements
2323
run: |
2424
pip install .
2525
pip install -r docs/api/requirements.txt
2626
- name: Build API docs
2727
run: |
2828
sphinx-build -M html docs/api/source html_build
29-
- name: Upload built HTMLs as job artifact
30-
uses: alehechka/upload-tartifact@a055d3a102b9ed9cfff1263bc713295047d0197e # v2
29+
- name: Archive built HTMLs
30+
shell: bash
31+
run: tar -czf artifact.tar html_build/html
32+
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b #v4.5.0
3133
with:
3234
name: html_doc_artifact
33-
path: html_build/html
35+
path: artifact.tar

.github/workflows/build_schema_page.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
1515
with:
1616
python-version: 3.10.14
17-
cache: pip
1817

1918
- name: Install and Build
2019
run: |
@@ -27,8 +26,12 @@ jobs:
2726
# the sphinx can generate valid links in the TOC for the JSON schema across all pages.
2827
generate-schema-doc --deprecated-from-description schema.json schema/index.html
2928
29+
- name: Archive built schema
30+
shell: bash
31+
run: tar -czf artifact.tar schema
32+
3033
- name: Upload result as artifact
31-
uses: alehechka/upload-tartifact@a055d3a102b9ed9cfff1263bc713295047d0197e # v2
34+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b #v4.5.0
3235
with:
3336
name: schema_doc_artifact
34-
path: schema
37+
path: artifact.tar

0 commit comments

Comments
 (0)