Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Use picamera2 from venv#78

Closed
sonnyp wants to merge 1 commit intomainfrom
venv-picamera2
Closed

Use picamera2 from venv#78
sonnyp wants to merge 1 commit intomainfrom
venv-picamera2

Conversation

@sonnyp
Copy link
Contributor

@sonnyp sonnyp commented Apr 2, 2025

As discussed with @ethanjli in a 2025-04-02 one-on-one software meeting.

However on Fedora at least, it builds the packages from source and I had to install python3-devel and libcap-devel so I'm not sure we can do what's proposed here on RPI. End of day, will dig and test.

Todo

@sonnyp
Copy link
Contributor Author

sonnyp commented Apr 9, 2025

@ethanjli

regarding

poetry tries to build them from source instead of installing the armv7l wheels. Maybe poetry is messing up at detecting the machine platform or something.

Is that a big deal? I also noticed a couple of related things in install scripts

https://www.piwheels.org/ doesn't support 64 bits Raspberry OS anyway so I think we should assume some dependencies might be compiled from source and just count on things to get better over time ?

On the other hand picamera2 recommends installing from apt https://github.com/raspberrypi/picamera2?tab=readme-ov-file#installation

My suggestion would be to use picamera2 from apt (and anything else that we consider as part of the "Raspberry OS runtime") and the rest from pypy/piwheels without workarounds to avoid compiling from source.

@ethanjli
Copy link
Member

ethanjli commented Apr 9, 2025

Is that a big deal

It used to be a bigger deal because of the impact on the OS setup scripts used to take ~30 minutes to run on an actual booted RPi - but now that we're building OS images in arm64 runners on GitHub Actions (as of fairscope/PlanktoScope#520), we might be able to tolerate building a few small hardware-related packages from source if they have minimal impact on OS image build times. But "aesthetically" I'd prefer to avoid building packages from source. So I consider this a "small-to-medium-sized deal".

https://www.piwheels.org/ doesn't support 64 bits Raspberry OS anyway

As of #74 (which was the first PR made after the stable release of v2024.0.0, which is the first stable release with deprecation of 32-bit OS support), we no longer provide the option to download pre-built 32-bit wheels from piwheels. Instead, we rely on PyPI for pre-built 64-bit wheels.

My suggestion would be to use picamera2 from apt (and anything else that we consider as part of the "Raspberry OS runtime") and the rest from pypy/piwheels without workarounds to avoid compiling from source.

Yes, since the picamera2 Python package is coupled to libcamera, managing picamera2 in a venv still leaves libcamera outside the realm of what we can manage via poetry/venv. Relying on picamera2 from apt is our current practice and I think it's reasonable to continue this way (which if I understand correctly would mean that we just close this PR). If we do that and close this PR, I'd prefer to have a follow-up PR for fairscope/PlanktoScope#551 which implements option 1 as described in fairscope/PlanktoScope#551 (comment)

@sonnyp
Copy link
Contributor Author

sonnyp commented Apr 9, 2025

We decided to

  • keep using picamera2 @ethanjli
  • update this PR to drop unnecessary dependencies @sonnyp

@ethanjli ethanjli mentioned this pull request Apr 9, 2025
@sonnyp
Copy link
Contributor Author

sonnyp commented Apr 10, 2025

@sonnyp sonnyp closed this Apr 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants