Skip to content
Closed
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
28 changes: 27 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,37 @@
tags:
- '*'
branches:
- master
- mru-toto
pull_request:
branches:
- master

jobs:
build_install:
name: Build and install the Ledgerblue Python package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Clone
uses: actions/checkout@v4

- name: Setup Python version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

- name: Build & install
run: |
pip install -U pip
pip install -U .

package-deploy:
name: Build the Python package, and deploy if needed

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
runs-on: ubuntu-latest
needs: build_install
steps:
- name: Clone
uses: actions/checkout@v3
Expand All @@ -23,6 +45,10 @@

- name: Install dependencies
run: |
# Needed to workaround this bug https://github.com/pypa/setuptools/issues/4759
# To be removed when it's fixed
pip install -U packaging

python -m pip install pip --upgrade
pip install build twine

Expand Down
4 changes: 2 additions & 2 deletions ledgerblue/hexLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,14 @@ def load(self, erase_u8, max_length_per_apdu, hexFile, reverse=False, doCRC=True
if reverse:
chunk = data[offset-chunkLen : offset]
if self.createpackParams:
self.loadPackSegmentChunk(offset-chunkLen, bytes(chunk))
self.loadPackSegmentChunk(startAddress+offset-chunkLen, bytes(chunk))
else:
self.loadSegmentChunk(offset-chunkLen, bytes(chunk))
else:
chunk = data[offset : offset + chunkLen]
sha256.update(chunk)
if self.createpackParams:
self.loadPackSegmentChunk(offset, bytes(chunk))
self.loadPackSegmentChunk(startAddress+offset, bytes(chunk))
else:
self.loadSegmentChunk(offset, bytes(chunk))
if reverse:
Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = [
"setuptools>=45",
"setuptools>=75",
"setuptools_scm[toml]>=6.2",
"wheel"
]
Expand All @@ -21,18 +21,19 @@ classifiers = [
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [ "version" ]
requires-python = ">=3"
requires-python = ">=3.8"
dependencies = [
"pyelftools>=0.29,<1.0",
"hidapi>=0.7.99",
"protobuf >=3.20,<4",
"protobuf >=5",
"pycryptodomex>=3.6.1",
"future",
"ecpy>=0.9.0",
Expand Down