Skip to content

BUG: Python distutils is deprecated#374

Closed
drakenclimber wants to merge 1 commit into
seccomp:mainfrom
drakenclimber:issues/372
Closed

BUG: Python distutils is deprecated#374
drakenclimber wants to merge 1 commit into
seccomp:mainfrom
drakenclimber:issues/372

Conversation

@drakenclimber

@drakenclimber drakenclimber commented Mar 21, 2022

Copy link
Copy Markdown
Member

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: #372
Signed-off-by: Tom Hromatka tom.hromatka@oracle.com

@coveralls

coveralls commented Mar 21, 2022

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 89.604% when pulling 0a8311f on drakenclimber:issues/372 into 5731dd9 on seccomp:main.

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>
Comment thread src/python/setup.py
Extension("seccomp", ["seccomp.pyx"],
# unable to handle libtool libraries directly
extra_objects=["../.libs/libseccomp.a"],
# fix build warnings, see PEP 3123

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't observe any build warnings on Python 3.10.2. Do we still need this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jhenstridge, mystery solved :)

@pcmoore pcmoore added this to the v2.6.0 milestone Apr 5, 2022

@pcmoore pcmoore left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Acked-by: Paul Moore <paul@paul-moore.com>

@pcmoore

pcmoore commented Jul 11, 2022

Copy link
Copy Markdown
Member

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.

@pcmoore pcmoore closed this Jul 11, 2022
@drakenclimber

Copy link
Copy Markdown
Member Author

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Python distutils is deprecated

4 participants