Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toolchain: Python 3.12 #16384

Merged
merged 2 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions .github/workflows/west-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@ jobs:
runs-on: ubuntu-latest
name: Run Python checks for west commands on patch series (PR)
steps:
- name: Checkout the code
uses: actions/checkout@v3
with:
path: ncs/nrf
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-doc-pip
- name: Install python dependencies
working-directory: ncs/nrf
run: |
pip3 install -U pip
pip3 install -U setuptools
pip3 install -U wheel
pip3 install -U mypy types-colorama types-editdistance types-PyYAML
grep -E "west" scripts/requirements-fixed.txt | xargs pip3 install -U
pip3 show -f west
- name: Run mypy
working-directory: ncs/nrf/scripts/west_commands
run: |
python3 -m mypy --config-file mypy.ini ncs_west_helpers.py pygit2_helpers.py ncs_commands.py
- name: Checkout the code
uses: actions/checkout@v3
with:
path: ncs/nrf
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: cache-pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-doc-pip
- name: Install python dependencies
working-directory: ncs/nrf
run: |
pip3 install -U pip
pip3 install -U setuptools
pip3 install -U wheel
pip3 install -U mypy types-colorama types-editdistance types-PyYAML
grep -E "west==" scripts/requirements-fixed.txt | cut -f1 -d"#" | xargs pip3 install -U
pip3 show -f west
- name: Run mypy
working-directory: ncs/nrf/scripts/west_commands
run: |
python3 -m mypy --config-file mypy.ini ncs_west_helpers.py pygit2_helpers.py ncs_commands.py
2 changes: 1 addition & 1 deletion scripts/requirements-extra.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pygit2<=1.10
pygit2>=1.15.0
Pillow>=10.3.0 # https://github.com/advisories/GHSA-44wm-f244-xhp3
editdistance>=0.5.0
PyGithub
Expand Down
28 changes: 13 additions & 15 deletions scripts/requirements-fixed.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --annotation-style=line --output-file=nrf/scripts/requirements-fixed.txt --strip-extras bootloader/mcuboot/scripts/requirements.txt nrf/scripts/requirements-ci.txt nrf/scripts/requirements-extra.txt nrf/scripts/requirements.txt zephyr/scripts/requirements.txt
Expand All @@ -17,7 +17,7 @@ capstone==4.0.2 # via pyocd
cbor==1.0.0 # via -r zephyr/scripts/requirements-run-test.txt
cbor2==5.4.6 # via -r bootloader/mcuboot/scripts/requirements.txt, -r nrf/scripts/requirements-build.txt, imgtool, zcbor
certifi==2024.7.4 # via -r nrf/scripts/requirements-base.txt, requests
cffi==1.15.1 # via cmsis-pack-manager, cryptography, milksnake, pygit2, pynacl
cffi==1.16.0 # via cmsis-pack-manager, cryptography, milksnake, pygit2, pynacl
chardet==5.2.0 # via -r nrf/scripts/requirements-ci.txt
charset-normalizer==3.2.0 # via requests
clang-format==17.0.1 # via -r nrf/scripts/requirements-build.txt, -r zephyr/scripts/requirements-extras.txt
Expand All @@ -31,22 +31,21 @@ devicetree==0.0.2 # via nrf-regtool
dill==0.3.7 # via pylint
docopt==0.6.2 # via pykwalify
ecdsa==0.18.0 # via -r nrf/scripts/requirements-build.txt
editdistance==0.6.2 # via -r nrf/scripts/requirements-extra.txt
exceptiongroup==1.1.3 # via pytest
editdistance==0.8.1 # via -r nrf/scripts/requirements-extra.txt
future==0.18.3 # via junitparser
gcovr==6.0 # via -r zephyr/scripts/requirements-build-test.txt
gitdb==4.0.10 # via gitpython
gitlint==0.18.0 # via -r nrf/scripts/requirements-ci.txt, -r zephyr/scripts/requirements-extras.txt
gitlint-core==0.18.0 # via gitlint
gitpython==3.1.41 # via -r nrf/scripts/requirements-ci.txt
graphviz==0.20.1 # via -r zephyr/scripts/requirements-extras.txt
grpcio==1.58.0 # via grpcio-tools
grpcio-tools==1.58.0 # via -r zephyr/scripts/requirements-extras.txt
grpcio==1.64.1 # via grpcio-tools
grpcio-tools==1.64.1 # via -r zephyr/scripts/requirements-extras.txt
idna==3.7 # via -r nrf/scripts/requirements-extra.txt, requests
imagesize==1.4.1 # via -r nrf/scripts/requirements-build.txt
imgtool==2.0.0 # via -r zephyr/scripts/requirements-extras.txt
importlib-metadata==6.8.0 # via pyocd
importlib-resources==6.1.0 # via libusb-package, pyocd
importlib-resources==6.1.0 # via pyocd
iniconfig==2.0.0 # via pytest
intelhex==2.3.0 # via -r bootloader/mcuboot/scripts/requirements.txt, -r nrf/scripts/requirements-build.txt, -r zephyr/scripts/requirements-base.txt, imgtool, lpc-checksum, nrf-regtool, pyocd
intervaltree==3.1.0 # via pyocd
Expand All @@ -58,7 +57,7 @@ junit2html==30.1.3 # via -r zephyr/scripts/requirements-extras.txt
junitparser==3.1.0 # via -r zephyr/scripts/requirements-compliance.txt
lark==1.1.7 # via pyocd
libusb==1.0.27 # via -r nrf/scripts/requirements-extra.txt
libusb-package==1.0.26.2 # via pyocd
libusb-package==1.0.26.1 # via pyocd
lpc-checksum==2.2.0 # via -r zephyr/scripts/requirements-extras.txt
lxml==4.9.3 # via -r zephyr/scripts/requirements-compliance.txt, gcovr, svada
markupsafe==2.1.3 # via jinja2
Expand All @@ -82,12 +81,12 @@ pluggy==1.3.0 # via pytest
ply==3.11 # via -r zephyr/scripts/requirements-build-test.txt
prettytable==3.9.0 # via pyocd
progress==1.6 # via -r zephyr/scripts/requirements-base.txt
protobuf==4.24.3 # via -r zephyr/scripts/requirements-extras.txt, grpcio-tools
protobuf==5.27.1 # via -r zephyr/scripts/requirements-extras.txt, grpcio-tools
psutil==5.9.5 # via -r zephyr/scripts/requirements-base.txt, -r zephyr/scripts/requirements-run-test.txt, pylink-square
py==1.11.0 # via -r nrf/scripts/requirements-ci.txt
pycparser==2.21 # via cffi
pyelftools==0.30 # via -r zephyr/scripts/requirements-base.txt, pyocd
pygit2==1.10.0 # via -r nrf/scripts/requirements-extra.txt
pygit2==1.15.0 # via -r nrf/scripts/requirements-extra.txt
pygithub==1.59.1 # via -r nrf/scripts/requirements-extra.txt, -r zephyr/scripts/requirements-extras.txt
pygments==2.16.1 # via gcovr
pyjwt==2.8.0 # via pygithub
Expand All @@ -113,7 +112,6 @@ regex==2023.8.8 # via zcbor
requests==2.32.0 # via -r zephyr/scripts/requirements-base.txt, pygithub
rpds-py==0.10.3 # via jsonschema, referencing
ruamel-yaml==0.17.32 # via pykwalify
ruamel-yaml-clib==0.2.7 # via ruamel-yaml
setuptools-scm==8.0.4 # via svada
sh==1.14.2 # via gitlint-core
six==1.16.0 # via anytree, ecdsa, pylink-square, pyocd, python-dateutil
Expand All @@ -123,18 +121,18 @@ stringcase==1.2.0 # via -r nrf/scripts/requirements-ci.txt
svada==2.0.2 # via nrf-regtool
tabulate==0.9.0 # via -r zephyr/scripts/requirements-run-test.txt
toml==0.10.2 # via -r nrf/scripts/requirements-ci.txt
tomli==2.0.1 # via mypy, nrf-regtool, pkg-about, pylint, pytest, setuptools-scm
tomli==2.0.1 # via nrf-regtool
tomlkit==0.12.1 # via pylint
typed-ast==1.5.5 # via -r nrf/scripts/requirements-ci.txt
typing-extensions==4.8.0 # via astroid, mypy, pylint, pyocd, python-can, qrcode, setuptools-scm, svada
typing-extensions==4.8.0 # via mypy, pyocd, python-can, qrcode, setuptools-scm, svada
urllib3==2.2.2 # via requests
wcwidth==0.2.6 # via prettytable
west==1.2.0 # via -r nrf/scripts/requirements-base.txt, -r zephyr/scripts/requirements-base.txt
wget==3.2 # via -r nrf/scripts/requirements-ci.txt
wrapt==1.15.0 # via deprecated, python-can
yamllint==1.32.0 # via -r zephyr/scripts/requirements-compliance.txt
zcbor==0.8.1 # via -r nrf/scripts/requirements-build.txt, -r nrf/scripts/requirements-extra.txt, -r zephyr/scripts/requirements-extras.txt
zipp==3.17.0 # via importlib-metadata, importlib-resources
zipp==3.17.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
setuptools==68.2.2 # via grpcio-tools, libusb, pkg-about, python-can, setuptools-scm, west
setuptools==70.1.0 # via grpcio-tools, libusb, pkg-about, python-can, setuptools-scm, west
2 changes: 1 addition & 1 deletion scripts/tools-versions-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
python:
version: 3.9.18
version: 3.12.4
git:
version: 2.37.3
cmake:
Expand Down
22 changes: 11 additions & 11 deletions scripts/west_commands/ncs_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ def print_likely_merged(downstream_repo: nwh.Repository,
'(revert these if appropriate):', color=log.WRN_COLOR)
for downstream_commit, upstream_commits in likely_merged.items():
if len(upstream_commits) == 1:
log.inf(f'- {downstream_commit.oid} {commit_title(downstream_commit)}')
log.inf(f'- {downstream_commit.id} {commit_title(downstream_commit)}')
log.inf(f' Similar upstream title:\n'
f' {upstream_commits[0].oid} {commit_title(upstream_commits[0])}')
f' {upstream_commits[0].id} {commit_title(upstream_commits[0])}')
else:
log.inf(f'- {downstream_commit.oid} {commit_title(downstream_commit)}\n'
log.inf(f'- {downstream_commit.id} {commit_title(downstream_commit)}\n'
' Similar upstream titles:')
for i, upstream_commit in enumerate(upstream_commits, start=1):
log.inf(f' {i}. {upstream_commit.oid} {commit_title(upstream_commit)}')
log.inf(f' {i}. {upstream_commit.id} {commit_title(upstream_commit)}')
else:
log.dbg('no downstream patches seem to have been merged upstream')

Expand Down Expand Up @@ -382,11 +382,11 @@ def print_loot(self,
for index, commit in enumerate(loot):
if self.args.files and not commit_affects_files(commit,
self.args.files):
log.dbg(f"skipping {commit.oid}; it doesn't affect file filter",
log.dbg(f"skipping {commit.id}; it doesn't affect file filter",
level=log.VERBOSE_VERY)
continue

sha = str(commit.oid)
sha = str(commit.id)
title = commit_title(commit)
if self.args.sha_only:
log.inf(sha)
Expand Down Expand Up @@ -705,15 +705,15 @@ def upmerge(self, name: str, project: Project, z_project: Project) -> None:

for dc, ucs in reversed(analyzer.likely_merged.items()):
if len(ucs) == 1:
log.inf(f'- Reverting: {dc.oid} {commit_title(dc)}')
log.inf(f'- Reverting: {dc.id} {commit_title(dc)}')
log.inf(f' Similar upstream title:\n'
f' {ucs[0].oid} {commit_title(ucs[0])}')
f' {ucs[0].id} {commit_title(ucs[0])}')
else:
log.inf(f'- Reverting: {dc.oid} {commit_title(dc)}\n'
log.inf(f'- Reverting: {dc.id} {commit_title(dc)}\n'
' Similar upstream titles:')
for i, uc in enumerate(ucs, start=1):
log.inf(f' {i}. {uc.oid} {commit_title(uc)}')
project.git('revert --signoff --no-edit ' + str(dc.oid))
log.inf(f' {i}. {uc.id} {commit_title(uc)}')
project.git('revert --signoff --no-edit ' + str(dc.id))
log.inf(f'Merging: {z_rev} to project: {project.name}')
msg = f"[nrf mergeup] Merge upstream automatically up to commit {z_sha}\n\nThis auto-upmerge was performed with ncs-upmerger script."
project.git('merge --no-edit --no-ff --signoff -m "' + msg + '" ' + str(self.zephyr_rev))
Expand Down
2 changes: 1 addition & 1 deletion scripts/west_commands/ncs_west_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Open Source Foundries, Limited

Check warning on line 1 in scripts/west_commands/ncs_west_helpers.py

View workflow job for this annotation

GitHub Actions / call-workflow / Run license checks on patch series (PR)

License Problem

Any license is allowed for this file, but it is recommended to use a more suitable one.
# Copyright 2018 Foundries.io, Limited
# Copyright (c) 2019 Nordic Semiconductor ASA
#
Expand Down Expand Up @@ -206,7 +206,7 @@
# complete list of OOT patches.
downstream_out: dict[str, pygit2.Commit] = {}
for c in all_downstream_oot:
sha, sl = str(c.oid), commit_title(c)
sha, sl = str(c.id), commit_title(c)
is_revert = title_is_revert(sl) # this is just a heuristic

if len(c.parents) > 1:
Expand Down
Loading