From: Steve Sakoman <steve@sakoman.com>
To: bitbake-devel@lists.openembedded.org
Subject: [bitbake][dunfell][1.46][PATCH 1/8] compat.py: remove file since it no longer actually implements anything
Date: Tue, 19 Oct 2021 10:06:09 -1000 [thread overview]
Message-ID: <cc6ed47574fc087d30e54f9f5029fbac87ba13fa.1634673786.git.steve@sakoman.com> (raw)
In-Reply-To: <cover.1634673786.git.steve@sakoman.com>
From: Chris Laplante <chris.laplante@agilent.com>
Now that compat.py just imports Python standard library stuff, get rid
of the layer of indirection.
Signed-off-by: Chris Laplante <chris.laplante@agilent.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e2be6defbb9fcf25f9df04c3b452d0dba48dfd03)
Signed-off-by: Justin Bronder <jsbronder@cold-front.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
lib/bb/compat.py | 10 ----------
lib/bb/event.py | 16 ++++++++--------
lib/bb/persist_data.py | 8 ++++----
lib/bb/tests/event.py | 17 +++++++++--------
4 files changed, 21 insertions(+), 30 deletions(-)
delete mode 100644 lib/bb/compat.py
diff --git a/lib/bb/compat.py b/lib/bb/compat.py
deleted file mode 100644
index 49356681..00000000
--- a/lib/bb/compat.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# SPDX-License-Identifier: GPL-2.0-only
-#
-
-"""Code pulled from future python versions, here for compatibility"""
-
-from collections import MutableMapping, KeysView, ValuesView, ItemsView, OrderedDict
-from functools import total_ordering
-
-
diff --git a/lib/bb/event.py b/lib/bb/event.py
index d1359f01..cb0b3b33 100644
--- a/lib/bb/event.py
+++ b/lib/bb/event.py
@@ -10,17 +10,17 @@ BitBake build tools.
# SPDX-License-Identifier: GPL-2.0-only
#
-import sys
-import pickle
-import logging
-import atexit
-import traceback
import ast
+import atexit
+import collections
+import logging
+import pickle
+import sys
import threading
+import traceback
-import bb.utils
-import bb.compat
import bb.exceptions
+import bb.utils
# This is the pid for which we should generate the event. This is set when
# the runqueue forks off.
@@ -56,7 +56,7 @@ def set_class_handlers(h):
_handlers = h
def clean_class_handlers():
- return bb.compat.OrderedDict()
+ return collections.OrderedDict()
# Internal
_handlers = clean_class_handlers()
diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py
index 7357ab2d..5f4fbe35 100644
--- a/lib/bb/persist_data.py
+++ b/lib/bb/persist_data.py
@@ -12,14 +12,14 @@ currently, providing a key/value store accessed by 'domain'.
#
import collections
+import contextlib
+import functools
import logging
import os.path
+import sqlite3
import sys
import warnings
-from bb.compat import total_ordering
from collections import Mapping
-import sqlite3
-import contextlib
sqlversion = sqlite3.sqlite_version_info
if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
@@ -28,7 +28,7 @@ if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
logger = logging.getLogger("BitBake.PersistData")
-@total_ordering
+@functools.total_ordering
class SQLTable(collections.MutableMapping):
class _Decorators(object):
@staticmethod
diff --git a/lib/bb/tests/event.py b/lib/bb/tests/event.py
index 9229b63d..9ca7e9bc 100644
--- a/lib/bb/tests/event.py
+++ b/lib/bb/tests/event.py
@@ -6,17 +6,18 @@
# SPDX-License-Identifier: GPL-2.0-only
#
-import unittest
-import bb
-import logging
-import bb.compat
-import bb.event
+import collections
import importlib
+import logging
+import pickle
import threading
import time
-import pickle
+import unittest
from unittest.mock import Mock
from unittest.mock import call
+
+import bb
+import bb.event
from bb.msg import BBLogFormatter
@@ -75,7 +76,7 @@ class EventHandlingTest(unittest.TestCase):
def _create_test_handlers(self):
""" Method used to create a test handler ordered dictionary """
- test_handlers = bb.compat.OrderedDict()
+ test_handlers = collections.OrderedDict()
test_handlers["handler1"] = self._test_process.handler1
test_handlers["handler2"] = self._test_process.handler2
return test_handlers
@@ -96,7 +97,7 @@ class EventHandlingTest(unittest.TestCase):
def test_clean_class_handlers(self):
""" Test clean_class_handlers method """
- cleanDict = bb.compat.OrderedDict()
+ cleanDict = collections.OrderedDict()
self.assertEqual(cleanDict,
bb.event.clean_class_handlers())
--
2.25.1
next prev parent reply other threads:[~2021-10-19 20:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-19 20:06 [bitbake][dunfell][1.46][PATCH 0/8] Patch review Steve Sakoman
2021-10-19 20:06 ` Steve Sakoman [this message]
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 2/8] bitbake: correct the collections vs collections.abc deprecation Steve Sakoman
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 3/8] bitbake: fix regexp deprecation warnings Steve Sakoman
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 4/8] bitbake: do not import imp in layerindexlib Steve Sakoman
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 5/8] bitbake: adjust parser error check for python 3.10 compatibility Steve Sakoman
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 6/8] bitbake: correct deprecation warning in process.py Steve Sakoman
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 7/8] test/fetch: Update urls to match upstream branch name changes Steve Sakoman
2021-10-19 20:06 ` [bitbake][dunfell][1.46][PATCH 8/8] hashserv: let asyncio discover the running loop Steve Sakoman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cc6ed47574fc087d30e54f9f5029fbac87ba13fa.1634673786.git.steve@sakoman.com \
--to=steve@sakoman.com \
--cc=bitbake-devel@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).