All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/2] Python patches
@ 2021-09-16 22:07 John Snow
  2021-09-16 22:07 ` [PULL 1/2] python: Update for pylint 2.10 John Snow
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: John Snow @ 2021-09-16 22:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, Daniel Berrange, Eduardo Habkost,
	Alex Bennée, Markus Armbruster, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Cleber Rosa, John Snow

The following changes since commit 831aaf24967a49d7750090b9dcfd6bf356f16529:

  Merge remote-tracking branch 'remotes/marcandre/tags/misc-pull-request' into staging (2021-09-14 18:14:56 +0100)

are available in the Git repository at:

  https://gitlab.com/jsnow/qemu.git tags/python-pull-request

for you to fetch changes up to eb8033f658e8b6f23ba9f4ef4a1b55894f7ea486:

  python: pylint 2.11 support (2021-09-16 15:04:04 -0400)

----------------------------------------------------------------
Python Pull request

This fixes the check-python-tox job.

CI including optional jobs is all green:
https://gitlab.com/jsnow/qemu/-/pipelines/372151147

----------------------------------------------------------------

John Snow (2):
  python: Update for pylint 2.10
  python: pylint 2.11 support

 python/qemu/machine/machine.py | 7 ++++++-
 python/setup.cfg               | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.31.1




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

* [PULL 1/2] python: Update for pylint 2.10
  2021-09-16 22:07 [PULL 0/2] Python patches John Snow
@ 2021-09-16 22:07 ` John Snow
  2021-09-16 22:07 ` [PULL 2/2] python: pylint 2.11 support John Snow
  2021-09-20 15:16 ` [PULL 0/2] Python patches Peter Maydell
  2 siblings, 0 replies; 6+ messages in thread
From: John Snow @ 2021-09-16 22:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, Daniel Berrange, Eduardo Habkost,
	Alex Bennée, Markus Armbruster, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Cleber Rosa, John Snow

A few new annoyances. Of note is the new warning for an unspecified
encoding when opening a text file, which actually does indicate a
potentially real problem; see
https://www.python.org/dev/peps/pep-0597/#motivation

Use LC_CTYPE to determine an encoding to use for interpreting QEMU's
terminal output. Note that Python states: "language code and encoding
may be None if their values cannot be determined" -- use a platform
default as a backup.

Notes: Passing encoding=None will generate a suppressed warning on
Python 3.10+ that 'None' should not be passed as the encoding
argument. This behavior may be deprecated in the future and the default
switched to be a ubiquitous UTF-8. Opting in to the locale default will
be done by passing the encoding 'locale', but that isn't available in
3.6 through 3.9. Presumably this warning will be unsuppressed some time
prior to the actual switch and we can re-investigate these issues at
that time if necessary.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20210916182248.721529-2-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/qemu/machine/machine.py | 7 ++++++-
 python/setup.cfg               | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index a7081b1845..34131884a5 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -19,6 +19,7 @@
 
 import errno
 from itertools import chain
+import locale
 import logging
 import os
 import shutil
@@ -290,8 +291,12 @@ def get_pid(self) -> Optional[int]:
         return self._subp.pid
 
     def _load_io_log(self) -> None:
+        # Assume that the output encoding of QEMU's terminal output is
+        # defined by our locale. If indeterminate, allow open() to fall
+        # back to the platform default.
+        _, encoding = locale.getlocale()
         if self._qemu_log_path is not None:
-            with open(self._qemu_log_path, "r") as iolog:
+            with open(self._qemu_log_path, "r", encoding=encoding) as iolog:
                 self._iolog = iolog.read()
 
     @property
diff --git a/python/setup.cfg b/python/setup.cfg
index 83909c1c97..0f0cab098f 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -104,6 +104,7 @@ good-names=i,
 [pylint.similarities]
 # Ignore imports when computing similarities.
 ignore-imports=yes
+ignore-signatures=yes
 
 # Minimum lines number of a similarity.
 # TODO: Remove after we opt in to Pylint 2.8.3. See commit msg.
-- 
2.31.1



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

* [PULL 2/2] python: pylint 2.11 support
  2021-09-16 22:07 [PULL 0/2] Python patches John Snow
  2021-09-16 22:07 ` [PULL 1/2] python: Update for pylint 2.10 John Snow
@ 2021-09-16 22:07 ` John Snow
  2021-09-20 15:16 ` [PULL 0/2] Python patches Peter Maydell
  2 siblings, 0 replies; 6+ messages in thread
From: John Snow @ 2021-09-16 22:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Thomas Huth, Daniel Berrange, Eduardo Habkost,
	Alex Bennée, Markus Armbruster, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Willian Rampazzo, Cleber Rosa, John Snow

We're not ready to enforce f-strings everywhere, so just silence this
new warning.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-id: 20210916182248.721529-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/setup.cfg | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/setup.cfg b/python/setup.cfg
index 0f0cab098f..fdca265fec 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -87,7 +87,7 @@ ignore_missing_imports = True
 # --enable=similarities". If you want to run only the classes checker, but have
 # no Warning level messages displayed, use "--disable=all --enable=classes
 # --disable=W".
-disable=
+disable=consider-using-f-string,
 
 [pylint.basic]
 # Good variable names which should always be accepted, separated by a comma.
-- 
2.31.1



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

* Re: [PULL 0/2] Python patches
  2021-09-16 22:07 [PULL 0/2] Python patches John Snow
  2021-09-16 22:07 ` [PULL 1/2] python: Update for pylint 2.10 John Snow
  2021-09-16 22:07 ` [PULL 2/2] python: pylint 2.11 support John Snow
@ 2021-09-20 15:16 ` Peter Maydell
  2 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2021-09-20 15:16 UTC (permalink / raw)
  To: John Snow
  Cc: Thomas Huth, Daniel Berrange, Eduardo Habkost, QEMU Developers,
	Wainer dos Santos Moschetta, Markus Armbruster, Willian Rampazzo,
	Cleber Rosa, Alex Bennée, Philippe Mathieu-Daudé

On Thu, 16 Sept 2021 at 23:07, John Snow <jsnow@redhat.com> wrote:
>
> The following changes since commit 831aaf24967a49d7750090b9dcfd6bf356f16529:
>
>   Merge remote-tracking branch 'remotes/marcandre/tags/misc-pull-request' into staging (2021-09-14 18:14:56 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/jsnow/qemu.git tags/python-pull-request
>
> for you to fetch changes up to eb8033f658e8b6f23ba9f4ef4a1b55894f7ea486:
>
>   python: pylint 2.11 support (2021-09-16 15:04:04 -0400)
>
> ----------------------------------------------------------------
> Python Pull request
>
> This fixes the check-python-tox job.
>
> CI including optional jobs is all green:
> https://gitlab.com/jsnow/qemu/-/pipelines/372151147
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.2
for any user-visible changes.

-- PMM


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

* Re: [PULL 0/2] Python patches
  2023-02-23  4:36 John Snow
@ 2023-02-24 15:07 ` Peter Maydell
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2023-02-24 15:07 UTC (permalink / raw)
  To: John Snow
  Cc: qemu-devel, Hanna Reitz, Beraldo Leal, Markus Armbruster,
	Thomas Huth, Eduardo Habkost, Kevin Wolf,
	Vladimir Sementsov-Ogievskiy, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Alex Bennée, qemu-block,
	Cleber Rosa

On Thu, 23 Feb 2023 at 04:36, John Snow <jsnow@redhat.com> wrote:
>
> The following changes since commit 79b677d658d3d35e1e776826ac4abb28cdce69b8:
>
>   Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging (2023-02-21 11:28:31 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/jsnow/qemu.git tags/python-pull-request
>
> for you to fetch changes up to 6832189fd791622c30e7bbe3a12b76be14dc1158:
>
>   python: drop pipenv (2023-02-22 23:35:03 -0500)
>
> ----------------------------------------------------------------
> Python
>
> Only minor testing updates.
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/8.0
for any user-visible changes.

-- PMM


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

* [PULL 0/2] Python patches
@ 2023-02-23  4:36 John Snow
  2023-02-24 15:07 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: John Snow @ 2023-02-23  4:36 UTC (permalink / raw)
  To: qemu-devel
  Cc: Hanna Reitz, Beraldo Leal, Markus Armbruster, Peter Maydell,
	Thomas Huth, John Snow, Eduardo Habkost, Kevin Wolf,
	Vladimir Sementsov-Ogievskiy, Philippe Mathieu-Daudé,
	Wainer dos Santos Moschetta, Alex Bennée, qemu-block,
	Cleber Rosa

The following changes since commit 79b677d658d3d35e1e776826ac4abb28cdce69b8:

  Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging (2023-02-21 11:28:31 +0000)

are available in the Git repository at:

  https://gitlab.com/jsnow/qemu.git tags/python-pull-request

for you to fetch changes up to 6832189fd791622c30e7bbe3a12b76be14dc1158:

  python: drop pipenv (2023-02-22 23:35:03 -0500)

----------------------------------------------------------------
Python

Only minor testing updates.

----------------------------------------------------------------

John Snow (2):
  python: support pylint 2.16
  python: drop pipenv

 python/README.rst                             |   3 -
 .gitlab-ci.d/static_checks.yml                |   4 +-
 python/.gitignore                             |   4 +-
 python/Makefile                               |  53 ++-
 python/Pipfile                                |  13 -
 python/Pipfile.lock                           | 347 ------------------
 python/qemu/qmp/protocol.py                   |   2 +-
 python/qemu/qmp/qmp_client.py                 |   2 +-
 python/qemu/utils/qemu_ga_client.py           |   6 +-
 python/setup.cfg                              |   4 +-
 python/tests/minreqs.txt                      |  45 +++
 tests/docker/dockerfiles/python.docker        |   1 -
 tests/qemu-iotests/iotests.py                 |   4 +-
 .../tests/migrate-bitmaps-postcopy-test       |   2 +-
 14 files changed, 94 insertions(+), 396 deletions(-)
 delete mode 100644 python/Pipfile
 delete mode 100644 python/Pipfile.lock
 create mode 100644 python/tests/minreqs.txt

-- 
2.39.0




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

end of thread, other threads:[~2023-02-24 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 22:07 [PULL 0/2] Python patches John Snow
2021-09-16 22:07 ` [PULL 1/2] python: Update for pylint 2.10 John Snow
2021-09-16 22:07 ` [PULL 2/2] python: pylint 2.11 support John Snow
2021-09-20 15:16 ` [PULL 0/2] Python patches Peter Maydell
2023-02-23  4:36 John Snow
2023-02-24 15:07 ` Peter Maydell

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.