First off: Sorry. Everything Raspberry Pi Python is a bit of a mess right now.
Additionally, sorry for the radio silence: I’ve been having a (very, very much needed) first-time-in-a-long-time actual god’s honest break from touching my computer.
The shift to the standards-based libgpiod (in lieu of Pi-specific libraries like RPi.GPIO) took us (me, mostly because it’s my remit) much more by surprise than it should have (a cute little microcontroller might have distracted me for the last few years). On top of this, other changes with Python on the Pi 5 and Bookworm OS have been vying for my attention. Most notably the shift to requiring virtual environments versus the previous Python packaging free-for-all we’d all grown accustomed to.
I’m not going to contend these changes- they are reasonable and logical and should put us in a better situation for supporting both future Pi boards and alternate boards- but thinking how best to embrace them, and make them approachable to beginners has consumed my time over the last few months.
Additionally- While the Pi 5 was announced early, allowing me to work in the open and coordinate with other developers to get things ready, a month wasn’t even close to enough time to get the basic groundwork laid. I burned most of this time working with the developer of libgpiod in order to make a suitable Python package for our purposes- the result of this work is that
pip install gpiod should Just Work inside or outside a virtual environment and irrespective if your system libgpiod version. If these words mean nothing to you don’t worry- it’s like laying the foundation for a house. There also remain - particularly in respect to Pi 5 - some unanswered questions about how things like PWM (on arbitrary pins) or pulse counting could or should work
Similarly small but important changes to things like Thonny have taken research and rationalisation - cpython_frontend: Support for ~/.virtualenvs directory on unix. by Gadgetoid · Pull Request #2978 · thonny/thonny · GitHub
With Pi 5s going out to customers, plus folks upgrading to Bookworm OS I’ve been trying to balance doing the right thing with doing things quickly, and that hasn’t led to the best planning or execution. Stuff that shouldn’t be broken is broken and this will - somewhat unfairly - disproportionately affect users of older Pi’s who should be the furthest from having to know or care about this nonsense.
This is all new code, new concepts and new territory even for me and - particularly with gpiod - there’s virtually no Python precedent to lean on because nobody has been keen to adopt it. I may not make the right choices or have all the answers and I really appreciate those of you figuring out your way around these problems, guiding others and bringing issues to my attention. Thank you.
In all cases, GitHub is the best way to raise any issues, input, comments or join me in screaming into the void, currently there are a few relevant places for this tumultuous transition-
- the individual device drivers (for example
PMS5003) have repositories with a slew of gpiodevice/libgpiod related issues - Issues · pimoroni/pms5003-python · GitHub
- gpiodevice is the Python library I concocted to try and smooth over the cracks with libgpio, though it’s not always obvious where it’s at fault rather than an individual library - Issues · pimoroni/gpiodevice-python · GitHub
- on the Python boilerplate there’s an open PR detailing the Pep668 (Virtual Environment) change and what I’m trying to do about it - https://github.com/pimoroni/boilerplate-python/pull/13
- there’s also an open issue documenting my rampage through our libraries and what I need to change for Pi 5/Bookworm compatibility and more long-term compatibility - Migration to Pi 5 / Bookworm Progress · Issue #16 · pimoroni/boilerplate-python · GitHub
Without sounding like a videogame publisher Solemn JPEG, I really appreciate any patience you can extend me, and understand any frustration you’re having getting things to Just Work as they should. I’m feeling that same frustration for every library, simultaneously, plus the basic building blocks.
I’m sorry that I couldn’t better handle this transition and spare you the pain of having to know or care that it was even happening at all. Please bear with me!