amazonlinux / amazon-linux-2023

Amazon Linux 2023
https://aws.amazon.com/linux/amazon-linux-2023/
Other
501 stars 38 forks source link

[Package Request] - SELinux bindings for Python 3.11 #560

Open ps-jay opened 7 months ago

ps-jay commented 7 months ago

What package is missing from Amazon Linux 2023? Please describe and include package name.

I'd like a package for the SELinux bindings for Python 3.11 in Amazon Linux 2023

In Amazon Linux 2023, both Python 3.9 and Python 3.11 are packaged. For example, today the versions available are:

But there is no Python 3.11 package for the SELinux bindings. The Python 3.9 package is:

Ideally, python3.11-libselinux would exist

Is this an update to existing package or new package request?

New, but similar to python3-libselinux

Is this package available in Amazon Linux 2? If it is available via external sources such as EPEL, please specify.

No

Any additional information you'd like to include. (use-cases, etc)

Our use-case for this package is so that Ansible version 9.x can be used to manage files on AL2023 EC2's.

Ansible 9.x requires a minimum version of Python 3.10 (see: ansible-core support matrix)

If SELinux is turned on, and Ansible tries to manage files, then it encounters the following error:

Exception: Failed to detect selinux python bindings at ['/usr/local/lib64/python3.11/site-packages', '/usr/local/lib/python3.11/site-packages', '/usr/lib64/python3.11/site-packages', '/usr/lib/python3.11/site-packages']

We setup the Python 3.11 environment for Ansible like so:

# python3.11 -m venv /tmp/3.11
# source /tmp/3.11/bin/activate
# python --version
Python 3.11.2
# pip --version
pip 22.3.1 from /tmp/3.11/lib64/python3.11/site-packages/pip (python 3.11)
# pip install -U ansible boto3 pip requests selinux
# pip freeze | grep selinux
selinux==0.3.0
stewartsmith commented 7 months ago

We do ship Ansible 8.3 in AL2023 (as of AL2023.2), and this works with the system Python 3.9. As per https://docs.aws.amazon.com/linux/al2023/ug/python.html#python-modules we don't build all the possible python modules for each version of python, instead focusing on the system python (3.9).

ps-jay commented 7 months ago

I understand the default stance of not building all possible Python modules, and that seems sensible

I wondered if the SELinux bindings might be an exception, since producing a 3.11 package requires compiling against the system libraries (e.g. libselinux isn't available as a wheel from PyPI)

bitsky6 commented 4 months ago

any update regarding this? still not working with python3.11