diff mbox series

[meta-python,kirkstone,1/1] Fix collections.abc deprecation warning in downloadutils Warning appears as:

Message ID 20221219053618.3558291-1-narpat.mali@windriver.com
State Under Review
Delegated to: Armin Kuster
Headers show
Series [meta-python,kirkstone,1/1] Fix collections.abc deprecation warning in downloadutils Warning appears as: | expand

Commit Message

nmali Dec. 19, 2022, 5:36 a.m. UTC
tests/test_downloadutils.py::test_stream_response_to_specific_filename
  requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    if path and isinstance(getattr(path, 'write', None), collections.Callable):

Upstream-Status: Backport [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]

Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
---
 ...abc-deprecation-warning-in-downloadu.patch | 41 +++++++++++++++++++
 .../python/python3-requests-toolbelt_0.9.1.bb |  5 ++-
 2 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch

Comments

nmali Feb. 22, 2023, 12:05 p.m. UTC | #1
Reminder.

Best Regards,
Narpat

From: Narpat Mali<mailto:narpat.mali@windriver.com>
Sent: 19 December 2022 11:07
To: openembedded-devel@lists.openembedded.org<mailto:openembedded-devel@lists.openembedded.org>
Cc: Polampalli, Archana<mailto:Archana.Polampalli@windriver.com>; G Pillai, Hari<mailto:Hari.GPillai@windriver.com>; Mali, Narpat<mailto:Narpat.Mali@windriver.com>
Subject: [oe][meta-python][kirkstone][PATCH 1/1] Fix collections.abc deprecation warning in downloadutils Warning appears as:

tests/test_downloadutils.py::test_stream_response_to_specific_filename
  requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    if path and isinstance(getattr(path, 'write', None), collections.Callable):

Upstream-Status: Backport [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]

Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
---
 ...abc-deprecation-warning-in-downloadu.patch | 41 +++++++++++++++++++
 .../python/python3-requests-toolbelt_0.9.1.bb |  5 ++-
 2 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch

diff --git a/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
new file mode 100644
index 000000000..baa833b6d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
@@ -0,0 +1,41 @@
+From 7188b06330e5260be20bce8cbcf0d5ae44e34eaf Mon Sep 17 00:00:00 2001
+From: Jon Dufresne <jon.dufresne@gmail.com>
+Date: Fri, 1 Feb 2019 16:30:01 -0800
+Subject: [PATCH] Fix collections.abc deprecation warning in downloadutils
+
+Warning appears as:
+
+tests/test_downloadutils.py::test_stream_response_to_specific_filename
+  requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
+    if path and isinstance(getattr(path, 'write', None), collections.Callable):
+
+Upstream-Status: Backport [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]
+
+Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
+---
+ requests_toolbelt/downloadutils/stream.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/requests_toolbelt/downloadutils/stream.py b/requests_toolbelt/downloadutils/stream.py
+index eed60a7..1d1c31b 100644
+--- a/requests_toolbelt/downloadutils/stream.py
++++ b/requests_toolbelt/downloadutils/stream.py
+@@ -1,6 +1,5 @@
+ # -*- coding: utf-8 -*-
+ """Utilities for dealing with streamed requests."""
+-import collections
+ import os.path
+ import re
+
+@@ -158,7 +157,7 @@ def stream_response_to_file(response, path=None, chunksize=_DEFAULT_CHUNKSIZE):
+     pre_opened = False
+     fd = None
+     filename = None
+-    if path and isinstance(getattr(path, 'write', None), collections.Callable):
++    if path and callable(getattr(path, 'write', None)):
+         pre_opened = True
+         fd = path
+         filename = getattr(fd, 'name', None)
+--
+2.25.1
+
diff --git a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
index 366f41ca8..72ad7a618 100644
--- a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
+++ b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
@@ -6,7 +6,8 @@ LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571"

 SRC_URI = "file://run-ptest \
-          "
+           file://0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch \
+           "

 SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e"
 SRC_URI[sha256sum] = "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
@@ -31,4 +32,4 @@ do_install_ptest() {
         # remove test test_multipart_encoder.py as it fails,
         # downloaded file is not supported
         rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py
-}
+}
--
2.25.1
akuster808 Feb. 25, 2023, 5:15 p.m. UTC | #2
On 2/22/23 7:05 AM, Narpat Mali wrote:
>
> Reminder.
>

Is this it?

https://git.openembedded.org/meta-openembedded/commit/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb?h=kirkstone&id=19f07c055a3d023f81882c4904d66949085fa322

- armin
>
> Best Regards,
>
> Narpat
>
> *From: *Narpat Mali <mailto:narpat.mali@windriver.com>
> *Sent: *19 December 2022 11:07
> *To: *openembedded-devel@lists.openembedded.org
> *Cc: *Polampalli, Archana <mailto:Archana.Polampalli@windriver.com>; G 
> Pillai, Hari <mailto:Hari.GPillai@windriver.com>; Mali, Narpat 
> <mailto:Narpat.Mali@windriver.com>
> *Subject: *[oe][meta-python][kirkstone][PATCH 1/1] Fix collections.abc 
> deprecation warning in downloadutils Warning appears as:
>
> tests/test_downloadutils.py::test_stream_response_to_specific_filename
>   requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: 
> Using or importing the ABCs from 'collections' instead of from 
> 'collections.abc' is deprecated, and in 3.8 it will stop working
>     if path and isinstance(getattr(path, 'write', None), 
> collections.Callable):
>
> Upstream-Status: Backport 
> [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]
>
> Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
> ---
>  ...abc-deprecation-warning-in-downloadu.patch | 41 +++++++++++++++++++
>  .../python/python3-requests-toolbelt_0.9.1.bb |  5 ++-
>  2 files changed, 44 insertions(+), 2 deletions(-)
>  create mode 100644 
> meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
>
> diff --git 
> a/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch 
> b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
> new file mode 100644
> index 000000000..baa833b6d
> --- /dev/null
> +++ 
> b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
> @@ -0,0 +1,41 @@
> +From 7188b06330e5260be20bce8cbcf0d5ae44e34eaf Mon Sep 17 00:00:00 2001
> +From: Jon Dufresne <jon.dufresne@gmail.com>
> +Date: Fri, 1 Feb 2019 16:30:01 -0800
> +Subject: [PATCH] Fix collections.abc deprecation warning in downloadutils
> +
> +Warning appears as:
> +
> +tests/test_downloadutils.py::test_stream_response_to_specific_filename
> +  requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: 
> Using or importing the ABCs from 'collections' instead of from 
> 'collections.abc' is deprecated, and in 3.8 it will stop working
> +    if path and isinstance(getattr(path, 'write', None), 
> collections.Callable):
> +
> +Upstream-Status: Backport 
> [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]
> +
> +Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
> +---
> + requests_toolbelt/downloadutils/stream.py | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/requests_toolbelt/downloadutils/stream.py 
> b/requests_toolbelt/downloadutils/stream.py
> +index eed60a7..1d1c31b 100644
> +--- a/requests_toolbelt/downloadutils/stream.py
> ++++ b/requests_toolbelt/downloadutils/stream.py
> +@@ -1,6 +1,5 @@
> + # -*- coding: utf-8 -*-
> + """Utilities for dealing with streamed requests."""
> +-import collections
> + import os.path
> + import re
> +
> +@@ -158,7 +157,7 @@ def stream_response_to_file(response, path=None, 
> chunksize=_DEFAULT_CHUNKSIZE):
> +     pre_opened = False
> +     fd = None
> +     filename = None
> +-    if path and isinstance(getattr(path, 'write', None), 
> collections.Callable):
> ++    if path and callable(getattr(path, 'write', None)):
> +         pre_opened = True
> +         fd = path
> +         filename = getattr(fd, 'name', None)
> +--
> +2.25.1
> +
> diff --git 
> a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb 
> b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
> index 366f41ca8..72ad7a618 100644
> --- 
> a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
> +++ 
> b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
> @@ -6,7 +6,8 @@ LICENSE = "Apache-2.0"
>  LIC_FILES_CHKSUM = 
> "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571 
> <file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571>"
>
>  SRC_URI = "file://run-ptest \
> -          "
> + 
> file://0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch 
> <file://0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch> \
> +           "
>
>  SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e"
>  SRC_URI[sha256sum] = 
> "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
> @@ -31,4 +32,4 @@ do_install_ptest() {
>          # remove test test_multipart_encoder.py as it fails,
>          # downloaded file is not supported
>          rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py
> -}
> +}
> -- 
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#101209): https://lists.openembedded.org/g/openembedded-devel/message/101209
> Mute This Topic: https://lists.openembedded.org/mt/95760086/3616698
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [akuster808@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
nmali Feb. 27, 2023, 6:45 a.m. UTC | #3
Yes, it was only.
Got it and sorry for bothering you.

Best Regards,
Narpat
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
new file mode 100644
index 000000000..baa833b6d
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-requests-toolbelt/0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch
@@ -0,0 +1,41 @@ 
+From 7188b06330e5260be20bce8cbcf0d5ae44e34eaf Mon Sep 17 00:00:00 2001
+From: Jon Dufresne <jon.dufresne@gmail.com>
+Date: Fri, 1 Feb 2019 16:30:01 -0800
+Subject: [PATCH] Fix collections.abc deprecation warning in downloadutils
+
+Warning appears as:
+
+tests/test_downloadutils.py::test_stream_response_to_specific_filename
+  requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
+    if path and isinstance(getattr(path, 'write', None), collections.Callable):
+
+Upstream-Status: Backport [https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf]
+
+Signed-off-by: Narpat Mali <narpat.mali@windriver.com>
+---
+ requests_toolbelt/downloadutils/stream.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/requests_toolbelt/downloadutils/stream.py b/requests_toolbelt/downloadutils/stream.py
+index eed60a7..1d1c31b 100644
+--- a/requests_toolbelt/downloadutils/stream.py
++++ b/requests_toolbelt/downloadutils/stream.py
+@@ -1,6 +1,5 @@
+ # -*- coding: utf-8 -*-
+ """Utilities for dealing with streamed requests."""
+-import collections
+ import os.path
+ import re
+ 
+@@ -158,7 +157,7 @@ def stream_response_to_file(response, path=None, chunksize=_DEFAULT_CHUNKSIZE):
+     pre_opened = False
+     fd = None
+     filename = None
+-    if path and isinstance(getattr(path, 'write', None), collections.Callable):
++    if path and callable(getattr(path, 'write', None)):
+         pre_opened = True
+         fd = path
+         filename = getattr(fd, 'name', None)
+-- 
+2.25.1
+
diff --git a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
index 366f41ca8..72ad7a618 100644
--- a/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
+++ b/meta-python/recipes-devtools/python/python3-requests-toolbelt_0.9.1.bb
@@ -6,7 +6,8 @@  LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=71760e0f1dda8cff91b0bc9246caf571"
 
 SRC_URI = "file://run-ptest \
-          "
+           file://0001-Fix-collections.abc-deprecation-warning-in-downloadu.patch \
+           "
 
 SRC_URI[md5sum] = "b1509735c4b4cf95df2619facbc3672e"
 SRC_URI[sha256sum] = "968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0"
@@ -31,4 +32,4 @@  do_install_ptest() {
 	# remove test test_multipart_encoder.py as it fails,
 	# downloaded file is not supported
 	rm -f ${D}${PTEST_PATH}/tests/test_multipart_encoder.py
-}
+}