Activate "system-site-packages" only for specific Python versions

I use a Ubuntu Focal build matrix with Python 3.8 to 3.12 and the architectures “amd64” and “ppc64le”.

From the docs I do understand the the “system-site-packages” option is restricted to Python versions that are shipped with Ubuntu. In my case this would be Python 3.8.

dist: focal

arch :
 - amd64
 - ppc64le

  - "3.8"
  - "3.9"
  - "3.10"
  - "3.11"
  - "3.12"

  system_site_packages: true

This will fail because the option won’t work on all Python versions. Can I somehow restrict the option to a specific Python version? Something like this?

   - Python "3.8"
     system_site_packages: true

Background: I want to run unit tests using PyQt5. But it is not available via PyPi (install via “pip”) for architecture “ppc64le”. But Ubuntu do ship PyQt5 for this architecture. So I have to install PyQt5 via “apt-get”.

My current bad workaround is just to not run the specific unit tests on that architecture but installing PyQt via “pip” where it is possible

    # ...
  - if [ "$TRAVIS_ARCH" != "ppc64le" ] ; then pip install pyqt5; fi

# ...

  # ...
  - if [ "$TRAVIS_ARCH" != "ppc64le" ] ; then pytest; fi