Skip to content

Commit 8dbaa88

Browse files
authored
Support python >=3.10 to <4 (#1662)
1 parent d18a671 commit 8dbaa88

File tree

11 files changed

+81
-72
lines changed

11 files changed

+81
-72
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ body:
4040
id: python-version
4141
attributes:
4242
label: Python version
43-
description: What version of Python are you using? Note that the currently supported Python version is 3.9.
43+
description: What version of Python are you using? Note that the lowest currently supported Python version is 3.10.
4444
validations:
4545
required: true
4646

.github/workflows/checks.yml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ jobs:
3737
python -m pip install --upgrade pip
3838
pip install poetry
3939
40-
- name: Set up Python 3.12
40+
- name: Set up Python 3.14
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: "3.12"
43+
python-version: "3.14"
4444
cache: 'poetry'
4545

46+
- name: Install dependencies needed for HIDAPI and Pillow
47+
run: |
48+
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev
49+
4650
- name: Install dependencies
4751
run: |
4852
poetry install -E ledger
@@ -72,7 +76,7 @@ jobs:
7276
runs-on: ubuntu-latest
7377
strategy:
7478
matrix:
75-
python-version: [ "3.12" ]
79+
python-version: [ "3.14" ]
7680
steps:
7781

7882
# ====================== SETUP ====================== #
@@ -81,7 +85,7 @@ jobs:
8185
- uses: asdf-vm/actions/setup@v3
8286
- uses: actions/setup-python@v5
8387
with:
84-
python-version: "3.12"
88+
python-version: "3.14"
8589
cache: 'pip'
8690

8791
- name: Install poetry
@@ -143,7 +147,7 @@ jobs:
143147
strategy:
144148
fail-fast: false
145149
matrix:
146-
python-version: [ "3.9", "3.12" ]
150+
python-version: [ "3.10", "3.14" ]
147151
env:
148152
LEDGER_PROXY_ADDRESS: 127.0.0.1
149153
LEDGER_PROXY_PORT: 9999
@@ -159,7 +163,7 @@ jobs:
159163

160164
- uses: actions/setup-python@v5
161165
with:
162-
python-version: "3.12"
166+
python-version: "3.14"
163167
cache: 'pip'
164168

165169
# ====================== SETUP PYTHON ====================== #
@@ -175,6 +179,10 @@ jobs:
175179
python-version: ${{ matrix.python-version }}
176180
cache: 'poetry'
177181

182+
- name: Install dependencies needed for HIDAPI and Pillow
183+
run: |
184+
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev
185+
178186
- name: Install dependencies
179187
run: |
180188
poetry install -E ledger
@@ -285,7 +293,7 @@ jobs:
285293

286294
- uses: actions/setup-python@v5
287295
with:
288-
python-version: "3.12"
296+
python-version: "3.14"
289297
cache: 'pip'
290298

291299
# ====================== SETUP PYTHON ====================== #
@@ -295,12 +303,16 @@ jobs:
295303
python -m pip install --upgrade pip
296304
pip install poetry
297305
298-
- name: Set up Python 3.12
306+
- name: Set up Python 3.14
299307
uses: actions/setup-python@v5
300308
with:
301-
python-version: "3.12"
309+
python-version: "3.14"
302310
cache: 'poetry'
303311

312+
- name: Install dependencies needed for HIDAPI and Pillow
313+
run: |
314+
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev libjpeg-dev
315+
304316
- name: Install dependencies
305317
run: |
306318
poetry install -E ledger
@@ -344,7 +356,7 @@ jobs:
344356
strategy:
345357
fail-fast: false
346358
matrix:
347-
python-version: [ "3.9", "3.12" ]
359+
python-version: [ "3.10", "3.14" ]
348360
env:
349361
SEPOLIA_RPC_URL: ${{ secrets.SEPOLIA_RPC_URL }}
350362
steps:
@@ -361,7 +373,7 @@ jobs:
361373

362374
- uses: actions/setup-python@v5
363375
with:
364-
python-version: "3.12"
376+
python-version: "3.14"
365377
cache: 'pip'
366378

367379
# ====================== SETUP DEVNET ====================== #
@@ -394,7 +406,7 @@ jobs:
394406

395407
- name: Install dependencies
396408
run: |
397-
poetry install -E ledger
409+
poetry install
398410
399411
# ====================== RUN TESTS ====================== #
400412

@@ -425,7 +437,7 @@ jobs:
425437
strategy:
426438
fail-fast: false
427439
matrix:
428-
python-version: [ "3.9", "3.12" ]
440+
python-version: [ "3.10", "3.14" ]
429441
steps:
430442
- uses: actions/checkout@v4
431443

@@ -437,7 +449,7 @@ jobs:
437449

438450
- uses: actions/setup-python@v5
439451
with:
440-
python-version: "3.12"
452+
python-version: "3.14"
441453
cache: 'pip'
442454

443455
# ====================== SETUP PYTHON ====================== #
@@ -496,7 +508,7 @@ jobs:
496508
strategy:
497509
fail-fast: false
498510
matrix:
499-
python-version: [ "3.9", "3.12" ]
511+
python-version: [ "3.10", "3.14" ]
500512
steps:
501513
- uses: actions/checkout@v4
502514
- uses: dtolnay/rust-toolchain@dc6353516c68da0f06325f42ad880f76a5e77ec9
@@ -511,7 +523,7 @@ jobs:
511523

512524
- uses: actions/setup-python@v5
513525
with:
514-
python-version: "3.12"
526+
python-version: "3.14"
515527
cache: 'pip'
516528

517529
# ====================== SETUP PYTHON ====================== #

.github/workflows/package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-python@v5
1616
with:
17-
python-version: '3.9'
17+
python-version: '3.10'
1818

1919
- name: Install poetry
2020
run: python -X utf8 -m pip install poetry

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ persistent=yes
5252

5353
# Minimum Python version to use for version dependent checks. Will default to
5454
# the version used to run pylint.
55-
py-version=3.9
55+
py-version=3.10
5656

5757
# When enabled, pylint would attempt to guess common misconfiguration and emit
5858
# user-friendly hints instead of false-positive error messages.

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.12
1+
3.10

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build:
55
apt_packages:
66
- libgmp3-dev
77
tools:
8-
python: "3.9"
8+
python: "3.10"
99
jobs:
1010
pre_install:
1111
- pip install poetry

docs/api/signer.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,20 @@ KeyPair
3636
LedgerSigner
3737
------------
3838

39-
To use LedgerSigner, you need to install starknetpy with `ledger` extra like this:
39+
To use LedgerSigner, you need to install starknetpy with ``ledger`` extra like this:
4040

4141
.. code-block:: bash
4242
4343
poetry add starknet_py[ledger]
4444
45+
Under a Debian or Ubuntu based system, you will need to install additional packages:
46+
47+
.. code-block:: bash
48+
49+
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
50+
51+
They are needed for compiling HIDAPI. Read official `ledgerctl installation guide <https://github.com/LedgerHQ/ledgerctl?tab=readme-ov-file#quick-install)>`_ for more details.
52+
4553
.. py:module:: starknet_py.net.signer.ledger_signer
4654
4755
.. autoclass:: LedgerSigner

docs/migration_guide.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
Migration guide
22
===============
33

4+
****************************
5+
<unreleased> Migration guide
6+
****************************
7+
8+
Version <unreleased> changes the supported Python version.
9+
The **lowest** supported version Python is now 3.10.
10+
11+
<unreleased> Dependency changes
12+
-------------------------------
13+
14+
.. py:currentmodule:: starknet_py.net.signer.ledger_signer
15+
16+
1. When installing extra dependencies needed for :class:`LedgerSigner`, Linux users may have to install additional packages:
17+
18+
.. code-block:: bash
19+
20+
sudo apt install python3-dev libusb-1.0-0-dev libudev-dev
21+
22+
These packages are needed for HIDAPI compilation. Read official `ledgerctl installation guide <https://github.com/LedgerHQ/ledgerctl?tab=readme-ov-file#quick-install)>`_ for more details.
23+
424
***************************
525
0.29.0-rc.1 Migration guide
626
***************************

poetry.lock

Lines changed: 17 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pylint_todo_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ def process_tokens(self, tokens):
2929
if token.type == tokenize.COMMENT:
3030
quotes_stripped = token.string.strip('"').strip("'")
3131
if "TODO" in quotes_stripped and not re.match(
32-
"#\s*TODO\s*\(#\d+\):.*", quotes_stripped
32+
r"#\s*TODO\s*\(#\d+\):.*", quotes_stripped
3333
):
3434
self.add_message(self.name, line=token.start[0])

0 commit comments

Comments
 (0)