Skip to content

Remove Python 3.13 version cap on lgpio dependency - #1107

Merged
makermelissa merged 1 commit into
adafruit:mainfrom
makermelissa-ai-assistant:fix-lgpio-version-cap
Apr 21, 2026
Merged

Remove Python 3.13 version cap on lgpio dependency#1107
makermelissa merged 1 commit into
adafruit:mainfrom
makermelissa-ai-assistant:fix-lgpio-version-cap

Conversation

@makermelissa-ai-assistant

Copy link
Copy Markdown
Contributor

Problem

setup.py pinned lgpio to python_version<'3.13', which meant pip install adafruit-blinka on Python 3.13+ would skip lgpio entirely, breaking GPIO on Raspberry Pi 5.

On 3.13, the post-install message told users to install lgpio manually, but the upstream source tarball fails to build without swig and liblgpio — so most users hit a dead end.

Fixes #1016

Changes

  • lgpio;python_version<'3.13'lgpio>=0.2.2.0 — installs on all Python versions
  • Pin >=0.2.2.0 to skip the broken empty stub (0.0.0.2) on piwheels
  • Remove unused yellow_text() function and raspberry_pi variable
  • Remove post-install warning about manual lgpio installation

The lgpio dependency is only included when running on Raspberry Pi hardware (guarded by /proc/device-tree/compatible check), so this has no effect on non-Pi platforms.

Pre-built wheels

Since there are no aarch64 lgpio wheels on PyPI, pre-built statically linked wheels for Python 3.13 and 3.14 are now available at:
https://github.com/adafruit/lgpio-python-wheels

Users in a venv with --system-site-packages will pick up the apt-installed python3-lgpio automatically.

Testing

Tested on Raspberry Pi 5 (aarch64, Python 3.13.5, Raspberry Pi OS Trixie):

  • pip install in --system-site-packages venv — picks up apt lgpio 0.2.2.0
  • ✅ Full Blinka install completes with all dependencies
  • lgpio.gpiochip_open(0) works (pinctrl-rp1, 54 lines)

- Change lgpio requirement from 'lgpio;python_version<"3.13"' to
  'lgpio>=0.2.2.0' so it installs on Python 3.13+
- Pin >=0.2.2.0 to avoid the broken empty stub (0.0.0.2) on piwheels
- Remove unused yellow_text() function and raspberry_pi variable
  that were only used for the now-removed manual install warning
- Remove post-install warning about manual lgpio installation

The version cap was preventing lgpio from being installed on Python 3.13+
which broke GPIO on Raspberry Pi 5. The lgpio dependency is only included
when running on Raspberry Pi hardware (checked via /proc/device-tree/compatible).

Pre-built aarch64 wheels for Python 3.13 and 3.14 are available at:
https://github.com/adafruit/lgpio-python-wheels

Fixes adafruit#1016

@makermelissa makermelissa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and makes sense.

@makermelissa
makermelissa merged commit 792baf1 into adafruit:main Apr 21, 2026
1 check passed
makermelissa pushed a commit that referenced this pull request Apr 22, 2026
When installing on a Raspberry Pi and lgpio is not already available,
print guidance directing users to either:
- Install via apt: sudo apt-get install -y python3-lgpio
- Use pre-built wheels from adafruit/lgpio-python-wheels

This helps users who encounter build failures when pip tries to compile
lgpio from source without swig and other build dependencies.

Follow-up to #1107
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blinka Install Errors and Warnings

2 participants