diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba74c00..06c6f36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,37 @@ on: 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 runs-on: ubuntu-latest + needs: build_install steps: - name: Clone uses: actions/checkout@v3 @@ -23,6 +45,10 @@ jobs: - 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 diff --git a/ledgerblue/hexLoader.py b/ledgerblue/hexLoader.py index 206bcd9..4265a65 100644 --- a/ledgerblue/hexLoader.py +++ b/ledgerblue/hexLoader.py @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 3b8bd44..66d8b7b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=45", + "setuptools>=75", "setuptools_scm[toml]>=6.2", "wheel" ] @@ -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",