All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] python3: silence DeprecationWarnings in python3-config
@ 2021-11-02 18:02 Ross Burton
  2021-11-02 18:05 ` [OE-core] " Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Ross Burton @ 2021-11-02 18:02 UTC (permalink / raw)
  To: openembedded-core

Our patched python3-config uses distutils, but that will emit a
DeprecationWarning when imported.  This isn't useful when using the
output of python3-config to find include paths.

This isn't a huge problem typically as the warning goes to stderr, but
some build systems read both stdout and stderr.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-devtools/python/python3/python-config.patch | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch
index d0ddbbc7fd..c53f646af3 100644
--- a/meta/recipes-devtools/python/python3/python-config.patch
+++ b/meta/recipes-devtools/python/python3/python-config.patch
@@ -14,7 +14,6 @@ as appropriate.
 Upstream-Status: Inappropriate [Embedded Specific]
 
 Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
-:
 
 ---
  Misc/python-config.in | 10 +++++-----
@@ -24,11 +23,13 @@ diff --git a/Misc/python-config.in b/Misc/python-config.in
 index ebd99da..13e57ae 100644
 --- a/Misc/python-config.in
 +++ b/Misc/python-config.in
-@@ -6,7 +6,7 @@
+@@ -6,7 +6,9 @@
  import getopt
  import os
  import sys
 -import sysconfig
++import warnings
++warnings.filterwarnings("ignore", category=DeprecationWarning)
 +from distutils import sysconfig
  
  valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] python3: silence DeprecationWarnings in python3-config
  2021-11-02 18:02 [PATCH] python3: silence DeprecationWarnings in python3-config Ross Burton
@ 2021-11-02 18:05 ` Khem Raj
  2021-11-02 20:06   ` Ross Burton
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2021-11-02 18:05 UTC (permalink / raw)
  To: Ross Burton; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 2269 bytes --]

On Tue, Nov 2, 2021 at 11:02 AM Ross Burton <ross@burtonini.com> wrote:

> Our patched python3-config uses distutils, but that will emit a
> DeprecationWarning when imported.  This isn't useful when using the
> output of python3-config to find include paths.


So shouldn’t we fix python3-config to not use distutils and switch to setup
tools instead ?

I am afraid that masking the warning will come biting soon when this is
turned into a hard error

>
>
> This isn't a huge problem typically as the warning goes to stderr, but
> some build systems read both stdout and stderr.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/recipes-devtools/python/python3/python-config.patch | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/python/python3/python-config.patch
> b/meta/recipes-devtools/python/python3/python-config.patch
> index d0ddbbc7fd..c53f646af3 100644
> --- a/meta/recipes-devtools/python/python3/python-config.patch
> +++ b/meta/recipes-devtools/python/python3/python-config.patch
> @@ -14,7 +14,6 @@ as appropriate.
>  Upstream-Status: Inappropriate [Embedded Specific]
>
>  Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
> -:
>
>  ---
>   Misc/python-config.in | 10 +++++-----
> @@ -24,11 +23,13 @@ diff --git a/Misc/python-config.in b/Misc/
> python-config.in
>  index ebd99da..13e57ae 100644
>  --- a/Misc/python-config.in
>  +++ b/Misc/python-config.in
> -@@ -6,7 +6,7 @@
> +@@ -6,7 +6,9 @@
>   import getopt
>   import os
>   import sys
>  -import sysconfig
> ++import warnings
> ++warnings.filterwarnings("ignore", category=DeprecationWarning)
>  +from distutils import sysconfig
>
>   valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#157806):
> https://lists.openembedded.org/g/openembedded-core/message/157806
> Mute This Topic: https://lists.openembedded.org/mt/86772899/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 3850 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] python3: silence DeprecationWarnings in python3-config
  2021-11-02 18:05 ` [OE-core] " Khem Raj
@ 2021-11-02 20:06   ` Ross Burton
  2021-11-02 20:12     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Ross Burton @ 2021-11-02 20:06 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

On Tue, 2 Nov 2021 at 18:06, Khem Raj <raj.khem@gmail.com> wrote:
> So shouldn’t we fix python3-config to not use distutils and switch to setup tools instead ?
>
> I am afraid that masking the warning will come biting soon when this is turned into a hard error

That is a much bigger question that needs to be done, but most likely
involves rewriting large chunks of the cross integration as from what
I can tell, setuptools doesn't expose sysconfig (and we patch
distutils.sysconfig).

We can continue hacking the hack, until we solve this properly.  This
may happen as part of the pyo3 rust/python problem.

Ross


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] python3: silence DeprecationWarnings in python3-config
  2021-11-02 20:06   ` Ross Burton
@ 2021-11-02 20:12     ` Khem Raj
  2021-11-02 21:05       ` Tim Orling
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2021-11-02 20:12 UTC (permalink / raw)
  To: Ross Burton; +Cc: Patches and discussions about the oe-core layer

On Tue, Nov 2, 2021 at 1:06 PM Ross Burton <ross@burtonini.com> wrote:
>
> On Tue, 2 Nov 2021 at 18:06, Khem Raj <raj.khem@gmail.com> wrote:
> > So shouldn’t we fix python3-config to not use distutils and switch to setup tools instead ?
> >
> > I am afraid that masking the warning will come biting soon when this is turned into a hard error
>
> That is a much bigger question that needs to be done, but most likely
> involves rewriting large chunks of the cross integration as from what
> I can tell, setuptools doesn't expose sysconfig (and we patch
> distutils.sysconfig).
>
> We can continue hacking the hack, until we solve this properly.  This
> may happen as part of the pyo3 rust/python problem.

I guess, this patch is fine for what it is solving for now, I was
hopeful that converting to not use
distutils would be easy :)

>
> Ross


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] python3: silence DeprecationWarnings in python3-config
  2021-11-02 20:12     ` Khem Raj
@ 2021-11-02 21:05       ` Tim Orling
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Orling @ 2021-11-02 21:05 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer, Ross Burton

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]

On Tue, Nov 2, 2021 at 1:12 PM Khem Raj <raj.khem@gmail.com> wrote:

> On Tue, Nov 2, 2021 at 1:06 PM Ross Burton <ross@burtonini.com> wrote:
> >
> > On Tue, 2 Nov 2021 at 18:06, Khem Raj <raj.khem@gmail.com> wrote:
> > > So shouldn’t we fix python3-config to not use distutils and switch to
> setup tools instead ?
> > >
> > > I am afraid that masking the warning will come biting soon when this
> is turned into a hard error
> >
> > That is a much bigger question that needs to be done, but most likely
> > involves rewriting large chunks of the cross integration as from what
> > I can tell, setuptools doesn't expose sysconfig (and we patch
> > distutils.sysconfig).
> >
> > We can continue hacking the hack, until we solve this properly.  This
> > may happen as part of the pyo3 rust/python problem.
>
> I guess, this patch is fine for what it is solving for now, I was
> hopeful that converting to not use
> distutils would be easy :)
>

The distutils.sysconfig.get_python_inc(plat_specific=True) call has no
replacement. It will have to be rewritten.


> >
> > Ross
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#157815):
> https://lists.openembedded.org/g/openembedded-core/message/157815
> Mute This Topic: https://lists.openembedded.org/mt/86772899/924729
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> ticotimo@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 2808 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-02 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 18:02 [PATCH] python3: silence DeprecationWarnings in python3-config Ross Burton
2021-11-02 18:05 ` [OE-core] " Khem Raj
2021-11-02 20:06   ` Ross Burton
2021-11-02 20:12     ` Khem Raj
2021-11-02 21:05       ` Tim Orling

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.