All of lore.kernel.org
 help / color / mirror / Atom feed
* Deprecated Python Libraries
@ 2021-09-17  7:03 Barry Byford
  2021-09-17  8:04 ` Marijn Suijten
  2021-09-21  3:48 ` Tedd Ho-Jeong An
  0 siblings, 2 replies; 4+ messages in thread
From: Barry Byford @ 2021-09-17  7:03 UTC (permalink / raw)
  To: Bluez mailing list

The Python examples in the test directory have some dependencies that
have issues:

optparse
According to the documentation this has now been deprecated

https://docs.python.org/3/library/optparse.html#:~:text=Deprecated%20since%20version%203.2

dbus-python
This has some known issues according to the documentation

https://dbus.freedesktop.org/doc/dbus-python/#:~:text=Alternative%20ways%20to%20get%20your%20Python%20code%20onto%20D-Bus

The above documentation has recommendations of switching to
import argparse
from gi.repository import Gio

Both of these should already be on systems because argparse is built
in to Python and gi.repository is used for GLib elsewhere in the
examples.
Would there be any interest in getting patches to change to these
different libraries?
Are these test scripts used in any of the automated tests?
Can I submit a PR via https://github.com/bluez/bluez/pulls?

Thanks,
Barry

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

* Re: Deprecated Python Libraries
  2021-09-17  7:03 Deprecated Python Libraries Barry Byford
@ 2021-09-17  8:04 ` Marijn Suijten
  2021-09-19 13:45   ` Barry Byford
  2021-09-21  3:48 ` Tedd Ho-Jeong An
  1 sibling, 1 reply; 4+ messages in thread
From: Marijn Suijten @ 2021-09-17  8:04 UTC (permalink / raw)
  To: Barry Byford; +Cc: Bluez mailing list, Sanchayan Maity, Sanchayan Maity

Hi Barry,

On 2021-09-17 08:03:36, Barry Byford wrote:
> The Python examples in the test directory have some dependencies that
> have issues:
> [..]
> Would there be any interest in getting patches to change to these
> different libraries?
> Are these test scripts used in any of the automated tests?
> Can I submit a PR via https://github.com/bluez/bluez/pulls?

Perhaps of relevance: Sanchayan (cc'd) imporved some scripts for Python
3 compatibility (Python 2 is already deprecated for the better part of
1.5 years) and proper formatting [1] while working on BT LDAC [2], some
patches made it to the list [3] but were ultimately never merged.
Sanchayan, would you be willing to resubmit these?  Alternatively Barry
can pick them up as part of their quest to improve the scripts for
longevity?

Disclaimer: I'm not a maintainer, merely a passer-by so don't take my
comment as an acknowledgement to go ahead with the changes.  But if you
do I think everyone appreciates improved shebangs and PEP8 style
formatting (I find `black` to perform formatting nicely) along the way
just like Sanchayan's patches.

[1]: https://gitlab.freedesktop.org/SanchayanMaity/bluez/-/commits/python3/
[2]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1621
[3]: https://lore.kernel.org/linux-bluetooth/?q=sanchayan

Thanks!
- Marijn

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

* Re: Deprecated Python Libraries
  2021-09-17  8:04 ` Marijn Suijten
@ 2021-09-19 13:45   ` Barry Byford
  0 siblings, 0 replies; 4+ messages in thread
From: Barry Byford @ 2021-09-19 13:45 UTC (permalink / raw)
  To: Marijn Suijten; +Cc: Bluez mailing list, Sanchayan Maity, Sanchayan Maity

Hello Marijn,

On Fri, 17 Sept 2021 at 09:04, Marijn Suijten
<marijn.suijten@somainline.org> wrote:
>
> Hi Barry,
>
> On 2021-09-17 08:03:36, Barry Byford wrote:
> > The Python examples in the test directory have some dependencies that
> > have issues:
> > [..]
> > Would there be any interest in getting patches to change to these
> > different libraries?
> > Are these test scripts used in any of the automated tests?
> > Can I submit a PR via https://github.com/bluez/bluez/pulls?
>
> Perhaps of relevance: Sanchayan (cc'd) imporved some scripts for Python
> 3 compatibility (Python 2 is already deprecated for the better part of
> 1.5 years) and proper formatting [1] while working on BT LDAC [2], some
> patches made it to the list [3] but were ultimately never merged.
> Sanchayan, would you be willing to resubmit these?  Alternatively Barry
> can pick them up as part of their quest to improve the scripts for
> longevity?
>
> Disclaimer: I'm not a maintainer, merely a passer-by so don't take my
> comment as an acknowledgement to go ahead with the changes.  But if you
> do I think everyone appreciates improved shebangs and PEP8 style
> formatting (I find `black` to perform formatting nicely) along the way
> just like Sanchayan's patches.
>
> [1]: https://gitlab.freedesktop.org/SanchayanMaity/bluez/-/commits/python3/
> [2]: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1621
> [3]: https://lore.kernel.org/linux-bluetooth/?q=sanchayan
>

Thanks for the feedback and references.

I'm not quite sure of the purpose of the the Python scripts in the
test directory.
Do they serve the automated tests? In which case any changes need to
be carefully considered.
Or are they a base for people to interactively test BlueZ and see how
to do an implementation with the D-Bus API.
The use of bluezutils.py file seems to be inconsistent so I'm not sure
if it is preferred or not.
I regularly refer people to the Python scripts as an example of using
the BlueZ D-Bus APi and that is my motivation for wanting to see them
be improved.

I've taken a look at moving the test-adapter script across to the Gio
bindings and argparse.
This meant updating the bluezutils.py also. Once I started
restructuring things I may have got slightly carried away. I've also
added some functionality such as being able to Introspect the
interface.

Anyway, the result of my experiment is at:
https://github.com/ukBaz/bluez/commit/44f9c205f798232f9417879401b2baefa1ef01ac

Any guidance from the maintainers as to what is required of the Python
scripts in the test directory would be appreciated. Are there any
scripts in the directory that you think are good examples of what you
are looking for?

Regards,
Barry


> Thanks!
> - Marijn

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

* Re: Deprecated Python Libraries
  2021-09-17  7:03 Deprecated Python Libraries Barry Byford
  2021-09-17  8:04 ` Marijn Suijten
@ 2021-09-21  3:48 ` Tedd Ho-Jeong An
  1 sibling, 0 replies; 4+ messages in thread
From: Tedd Ho-Jeong An @ 2021-09-21  3:48 UTC (permalink / raw)
  To: Barry Byford, Bluez mailing list

Hi Barry,

On Fri, 2021-09-17 at 08:03 +0100, Barry Byford wrote:
> The Python examples in the test directory have some dependencies that
> have issues:
> 
> optparse
> According to the documentation this has now been deprecated
> 
> https://docs.python.org/3/library/optparse.html#:~:text=Deprecated%20since%20version%203.2
> 
> dbus-python
> This has some known issues according to the documentation
> 
> https://dbus.freedesktop.org/doc/dbus-python/#:~:text=Alternative%20ways%20to%20get%20your%20Python%20code%20onto%20D-Bus
> 
> The above documentation has recommendations of switching to
> import argparse
> from gi.repository import Gio
> 
> Both of these should already be on systems because argparse is built
> in to Python and gi.repository is used for GLib elsewhere in the
> examples.
> Would there be any interest in getting patches to change to these
> different libraries?
> Are these test scripts used in any of the automated tests?
> Can I submit a PR via https://github.com/bluez/bluez/pulls?

If you have a patch, please submit it via mailing list instead of github.
Github is for other purpose and not ready to accept the patches/PR at this point.

> 
> Thanks,
> Barry

Regards,
Tedd Ho-Jeong An



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

end of thread, other threads:[~2021-09-21  3:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17  7:03 Deprecated Python Libraries Barry Byford
2021-09-17  8:04 ` Marijn Suijten
2021-09-19 13:45   ` Barry Byford
2021-09-21  3:48 ` Tedd Ho-Jeong An

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.