Skip to content

Commit

Permalink
python: Fix distutils DeprecationWarning
Browse files Browse the repository at this point in the history
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
Acked-by: Paul Moore <[email protected]>
Signed-off-by: Tom Hromatka <[email protected]>
  • Loading branch information
drakenclimber authored and pcmoore committed Jul 11, 2022
1 parent 85a22fa commit afbde6d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

import os

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from setuptools import setup
from setuptools.extension import Extension
from Cython.Build import cythonize

setup(
name = "seccomp",
Expand All @@ -37,12 +37,9 @@
maintainer_email = "[email protected]",
license = "LGPLv2.1",
platforms = "Linux",
cmdclass = {'build_ext': build_ext},
ext_modules = [
ext_modules = cythonize([
Extension("seccomp", ["seccomp.pyx"],
# unable to handle libtool libraries directly
extra_objects=["../.libs/libseccomp.a"],
# fix build warnings, see PEP 3123
extra_compile_args=["-fno-strict-aliasing"])
]
extra_objects=["../.libs/libseccomp.a"]),
])
)

0 comments on commit afbde6d

Please sign in to comment.