BUG: Python distutils is deprecated#374
Conversation
The python distutils package is deprecated. Utilize setuptools and cythonize instead. ./setup.py:26: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 [1] for potential alternatives [1] https://peps.python.org/pep-0632/ Fixes: seccomp#372 Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
093e73a to
0a8311f
Compare
| Extension("seccomp", ["seccomp.pyx"], | ||
| # unable to handle libtool libraries directly | ||
| extra_objects=["../.libs/libseccomp.a"], | ||
| # fix build warnings, see PEP 3123 |
There was a problem hiding this comment.
I didn't observe any build warnings on Python 3.10.2. Do we still need this?
There was a problem hiding this comment.
I ... don't know? The python bindings went in so long ago I don't recall why it was necessary beyond the comment.
Is it so that the bindings are built with the library statically linked as opposed to using a shared library installed on the system?
There was a problem hiding this comment.
You shouldn't need -fno-strict-aliasing with Python 3. It was an issue with Python 2's C API, where the first fields in an extension type's struct duplicated the fields from PyObject (i.e. the reference count and type pointer). In Python 3, the first field of an extension type's struct is a PyObject.
From the look of it, you've dropped Python 2 support, so you could safely drop -fno-strict-aliasing too.
pcmoore
left a comment
There was a problem hiding this comment.
Looks good to me.
Acked-by: Paul Moore <paul@paul-moore.com>
|
I'm hoping @drakenclimber wasn't sitting on this for a reason, but I'm in a daring mood right now so I'm going to go ahead and merge it ;) @drakenclimber if you're not ready for this to go in let me know and we can revert it. Merged via afbde6d. |
|
I'm good with merging it. Thanks, @pcmoore. Got sidetracked with other work, then Covid got me. I'm getting back up to speed though :) |
The python distutils package is deprecated. Utilize
setuptools and cythonize instead.
[1] https://peps.python.org/pep-0632/
Fixes: #372
Signed-off-by: Tom Hromatka tom.hromatka@oracle.com