diff mbox series

py-smbus/setup.py: use setuptools instead of distutils

Message ID 20220114134910.3994688-1-ross.burton@arm.com
State Accepted
Headers show
Series py-smbus/setup.py: use setuptools instead of distutils | expand

Commit Message

Ross Burton Jan. 14, 2022, 1:49 p.m. UTC
As per [1], distutils is deprecated in Python 3.10 and will be removed
entirely in Python 3.12.

As setuptools is essentially an enhanced version of distutils, it's
trivial to port to that.

[1] https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 py-smbus/setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jean Delvare Jan. 18, 2022, 12:23 p.m. UTC | #1
Hi Ross,

On Fri, 14 Jan 2022 13:49:10 +0000, Ross Burton wrote:
> As per [1], distutils is deprecated in Python 3.10 and will be removed
> entirely in Python 3.12.
> 
> As setuptools is essentially an enhanced version of distutils, it's
> trivial to port to that.
> 
> [1] https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  py-smbus/setup.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/py-smbus/setup.py b/py-smbus/setup.py
> index 28a4500..26db33a 100644
> --- a/py-smbus/setup.py
> +++ b/py-smbus/setup.py
> @@ -1,6 +1,6 @@
>  #!/usr/bin/env python
>  
> -from distutils.core import setup, Extension
> +from setuptools import setup, Extension
>  
>  setup(	name="smbus",
>  	version="1.1",

Is setuptools available in python 2.7? For now, py-smbus can be built
for either python2 or python3, and I would like to maintain that
possibility.

Thanks,
Ross Burton Jan. 18, 2022, 4:50 p.m. UTC | #2
> Is setuptools available in python 2.7? For now, py-smbus can be built
> for either python2 or python3, and I would like to maintain that
> possibility.

Yes, it is.

Ross

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
Jean Delvare Jan. 19, 2022, 11:09 a.m. UTC | #3
On Tue, 18 Jan 2022 16:50:56 +0000, Ross Burton wrote:
> > Is setuptools available in python 2.7? For now, py-smbus can be built
> > for either python2 or python3, and I would like to maintain that
> > possibility.  
> 
> Yes, it is.

Patch applied then, thanks for your contribution.
diff mbox series

Patch

diff --git a/py-smbus/setup.py b/py-smbus/setup.py
index 28a4500..26db33a 100644
--- a/py-smbus/setup.py
+++ b/py-smbus/setup.py
@@ -1,6 +1,6 @@ 
 #!/usr/bin/env python
 
-from distutils.core import setup, Extension
+from setuptools import setup, Extension
 
 setup(	name="smbus",
 	version="1.1",