Skip to content

Commit

Permalink
Release 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Maria Wisniewska committed Oct 11, 2024
1 parent 40fbe39 commit eafb442
Show file tree
Hide file tree
Showing 1,140 changed files with 95,165 additions and 24,636 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow will install Python dependencies, run tests and other codechecks on SPSDK project

name: Publish To PyPi

on:
push:
tags:
- 'v*' # Create release if a tag with version is pushed

jobs:
package:
name: Build Package
runs-on: ubuntu-latest
permissions: # Required by attest-build-provenance-github.
id-token: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.8.0
with:
attest-build-provenance-github: 'true'

deploy:
name: Upload Release To PyPI
needs: [package]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/spsdk/
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Download Package
uses: actions/download-artifact@v4
with:
name: Packages
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.9.0 # The authentication is provided by OpenID Connect: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,7 @@ logging.yaml

# setuptools_scm version file
spsdk/__version__.py

# coverity stuff
idir
data-coverity
17 changes: 8 additions & 9 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ include LICENSE
include SW_Content_Register_SPSDK.txt
include requirements*
include spsdk/py.typed
recursive-include spsdk/data *
recursive-include spsdk *.pyi
recursive-exclude .idea *
recursive-exclude .github *
recursive-exclude docs *
recursive-exclude examples *
recursive-exclude tests *
recursive-exclude tools *
recursive-exclude pipeline *
prune .idea *
prune .github *
prune docs *
prune examples *
prune tests *
prune tools *
prune pipeline *
graft spsdk/data *
142 changes: 94 additions & 48 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SW_Content_Register_SPSDK.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NXP Software Content Register

Package: NXP SPSDK
Version: 2.2.1
Version: 2.3.0
Outgoing License: BSD-3-Clause
License Files: LICENSE
Type of content: Source code
Expand Down
22 changes: 17 additions & 5 deletions approved_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
"name": "deepmerge",
"package": {
"name": "deepmerge",
"license": "MIT License"
"license": ""
},
"github": {
"project_name": "toumorokoshi/deepmerge",
Expand Down Expand Up @@ -635,7 +635,7 @@
"name": "importlib-metadata",
"package": {
"name": "importlib-metadata",
"license": ""
"license": "Apache Software License"
},
"github": {
"project_name": "python/importlib_metadata",
Expand All @@ -647,7 +647,7 @@
"name": "importlib-resources",
"package": {
"name": "importlib-resources",
"license": ""
"license": "Apache Software License"
},
"github": {
"project_name": "python/importlib_resources",
Expand Down Expand Up @@ -978,6 +978,18 @@
"license": "BSD-3-Clause"
}
},
{
"home_page": "https://github.com/nxp-imx/mfgtools",
"name": "libuuu",
"package": {
"name": "libuuu",
"license": "BSD-3-Clause"
},
"github": {
"project_name": "nxp-imx/mfgtools",
"license": "BSD-3-Clause"
}
},
{
"home_page": "https://palletsprojects.com/p/markupsafe/",
"name": "MarkupSafe",
Expand Down Expand Up @@ -1307,7 +1319,7 @@
"name": "pycparser",
"package": {
"name": "pycparser",
"license": "BSD-3-Clause"
"license": "BSD"
},
"github": {
"project_name": "eliben/pycparser",
Expand Down Expand Up @@ -2023,4 +2035,4 @@
}
}
]
}
}
48 changes: 41 additions & 7 deletions apps.spec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ from libusbsio import LIBUSBSIO
from PyInstaller.building.build_main import BUNDLE, COLLECT, EXE, MERGE, PYZ, Analysis
from PyInstaller.compat import is_darwin
from PyInstaller.config import CONF
from PyInstaller.utils.hooks import copy_metadata


def create_resource_symlinks(app_dir: str, symlink_list: List[Tuple[str, str, str]]) -> None:
Expand All @@ -42,6 +43,9 @@ def create_resource_symlinks(app_dir: str, symlink_list: List[Tuple[str, str, st
USE_BLOCK_CIPHER = None
datas = []

# setuptools_scm checks the version of setuptools and if not satisfied, it complains in console
datas.extend(copy_metadata("setuptools", recursive=False))

# exclude imports and make them available outside of the executable
# smartcard is LGPL so make it external outside of the executable so it can be replaced
excluded_imports = ["smartcard"]
Expand Down Expand Up @@ -74,7 +78,6 @@ def create_runtime_hook_entry_points(
import importlib
from importlib_metadata import entry_points


for ep_package in ep_packages:
for entry_point in importlib.metadata.entry_points(group=ep_package):
if ep_package in hook_ep_packages:
Expand Down Expand Up @@ -109,7 +112,9 @@ for k, v in entries.items():

# add library for cmsis_pack_manager
cmsis_mod_dir = os.path.dirname(cmsis_pack_manager.__file__)
shared_binaries = [(cmsis_mod_dir + "/cmsis_pack_manager/*.so", "cmsis_pack_manager/cmsis_pack_manager/")]
shared_binaries = [
(cmsis_mod_dir + "/cmsis_pack_manager/*.so", "cmsis_pack_manager/cmsis_pack_manager/")
]

# add library for libusbsio
usblib = LIBUSBSIO()
Expand All @@ -119,16 +124,34 @@ shared_binaries.append(
(usblib._dllpath, os.path.dirname(usblib._dllpath[usblib._dllpath.find("libusbsio") :]))
)

# optionally add libraries for PQC
try:
import spsdk_pqc

spsdk_pqc_dir = os.path.dirname(spsdk_pqc.__file__)
shared_binaries.append((spsdk_pqc_dir + "/*.so", "spsdk_pqc"))

except ImportError:
pass

# add libuuu libraries
try:
import libuuu
uuudll = libuuu.LibUUU().DLL
shared_binaries.append((uuudll, "libuuu/lib"))
except OSError:
pass

datas.extend([("spsdk/data", "spsdk/data")])


# Additional PyOCD resources
SEQUENCE_LARK = 'sequences.lark'
SEQUENCE_LARK = "sequences.lark"

with importlib.resources.files("pyocd.debug.sequences") as package_path:
resource_path = package_path / SEQUENCE_LARK

datas.extend([(resource_path, 'pyocd/debug/sequences')])
datas.extend([(resource_path, "pyocd/debug/sequences")])


def analyze(sources: List[str]) -> Analysis:
Expand Down Expand Up @@ -195,7 +218,8 @@ a_nxpmemcfg = analyze(["spsdk/apps/nxpmemcfg.py"])
a_nxpwpc = analyze(["spsdk/apps/nxpwpc.py"])
a_el2go = analyze(["spsdk/apps/el2go.py"])
a_dk6prog = analyze(["spsdk/apps/dk6prog.py"])

a_lpcprog = analyze(["spsdk/apps/lpcprog.py"])
a_nxpdice = analyze(["spsdk/apps/nxpdice.py"])

# merge the dependencies together so the (first) blhost contains all required dependencies from all tools
MERGE(
Expand All @@ -214,8 +238,10 @@ MERGE(
(a_nxpcrypto, "nxpcrypto", "nxpcrypto"),
(a_nxpmemcfg, "nxpmemcfg", "nxpmemcfg"),
(a_nxpwpc, "nxpwpc", "nxpwpc"),
(a_el2go, "el2go", "el2go"),
(a_el2go, "el2go-host", "el2go-host"),
(a_dk6prog, "dk6prog", "dk6prog"),
(a_lpcprog, "lpcprog", "lpcprog"),
(a_nxpdice, "lnxpdice", "lnxpdice"),
)


Expand All @@ -239,8 +265,10 @@ exe_ifr = executable(a_ifr, "ifr", "tools/pyinstaller/ifr_version_info.txt")
exe_nxpcrypto = executable(a_nxpcrypto, "nxpcrypto", "tools/pyinstaller/nxpcrypto_version_info.txt")
exe_nxpmemcfg = executable(a_nxpmemcfg, "nxpmemcfg", "tools/pyinstaller/nxpmemcfg_version_info.txt")
exe_nxpwpc = executable(a_nxpwpc, "nxpwpc", "tools/pyinstaller/nxpwpc_version_info.txt")
exe_el2go = executable(a_el2go, "el2go", "tools/pyinstaller/el2go_version_info.txt")
exe_el2go = executable(a_el2go, "el2go-host", "tools/pyinstaller/el2go_version_info.txt")
exe_dk6prog = executable(a_dk6prog, "dk6prog", "tools/pyinstaller/dk6prog_version_info.txt")
exe_lpcprog = executable(a_lpcprog, "lpcprog", "tools/pyinstaller/lpcprog_version_info.txt")
exe_nxpdice = executable(a_nxpdice, "nxpdice", "tools/pyinstaller/nxpdice_version_info.txt")

# collect all bundles together
coll_apps = COLLECT(
Expand Down Expand Up @@ -312,6 +340,12 @@ coll_apps = COLLECT(
a_dk6prog.binaries,
a_dk6prog.zipfiles,
a_dk6prog.datas,
a_lpcprog.binaries,
a_lpcprog.zipfiles,
a_lpcprog.datas,
a_lpcprog.binaries,
a_lpcprog.zipfiles,
a_lpcprog.datas,
strip=False,
upx=True,
upx_exclude=[],
Expand Down
30 changes: 30 additions & 0 deletions coverity.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2019-2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause

capture:
languages:
include: [python]
files:
include-regex: "spsdk|examples"
exclude-regex: "venv|tests|docs"

analyze:
aggressiveness-level: high

commit:
connect:
url: https://coverity2.nxp.com:8443
stream: spsdk_base
on-new-cert: distrust

##############################################################
# This section is not a part of regular Coverity configuration
# Because of that, Coverity will show some warnings
reports:
project-name: "SPSDK"
coverity-name: "SPSDK"
types: [syn-integrity, cov-integrity, cov-security]
19 changes: 19 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2024 NXP
#
# SPDX-License-Identifier: BSD-3-Clause
---
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: "0.2"
dictionaryDefinitions:
- name: project-words
path: "./project-words.txt"
addWords: true
dictionaries:
- project-words
ignorePaths:
- "venv**"
- "__pycache__**"
- "_build**"
- "/project-words.txt"
- "approved_packages.json"
- "reports/**"
Binary file modified docs/_static/images/spsdk-architecture-apis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/spsdk-architecture-apps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/images/spsdk-architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions docs/api/lpcprog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
lpcprog
====================================

This module contains support for programming LPC devices.

Module representing communication interface
----------------------------------------------------------
.. automodule:: spsdk.lpcprog.interface
:members:
:undoc-members:
:show-inheritance:

Module representing communication protocol
----------------------------------------------------------
.. automodule:: spsdk.lpcprog.protocol
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/api/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ USB Filter
:show-inheritance:


Registers descriptions with support for XML files
Registers descriptions
--------------------------------------------------

.. automodule:: spsdk.utils.registers
Expand Down
7 changes: 7 additions & 0 deletions docs/apps/blhost.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,3 +462,10 @@ After the reset the device boots from flash and user image is programmed success
.. click:: spsdk.apps.blhost:ele_message
:prog: blhost ele-message
:nested: full


-------------
Error Codes
-------------

.. include:: ../_prebuild/mboot_error_codes.inc
Loading

0 comments on commit eafb442

Please sign in to comment.