public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Akash Hadke <akash.hadke27@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Michael Estner <michaelestner@web.de>,
	Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: [poky][scarthgap][PATCH 07/23] bitbake: lib: Remove double imports
Date: Fri,  8 Aug 2025 14:19:15 +0530	[thread overview]
Message-ID: <20250808084931.2156763-7-akash.hadke27@gmail.com> (raw)
In-Reply-To: <20250808084931.2156763-1-akash.hadke27@gmail.com>

From: Michael Estner <michaelestner@web.de>

* Remove double imports mentioned by pylint

(Bitbake rev: 741db6719efca5aa9ef2c15e60cdd624e4aa1a8d)

Signed-off-by: Michael Estner <michaelestner@web.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e1836b205a2716e85f36346762805e2e505a5eb6)
Signed-off-by: Akash Hadke <akash.hadke27@gmail.com>
---
 bitbake/lib/bb/__init__.py                                 | 1 -
 bitbake/lib/bb/acl.py                                      | 2 --
 bitbake/lib/bb/fetch2/git.py                               | 1 -
 bitbake/lib/bb/fetch2/gitsm.py                             | 2 +-
 bitbake/lib/bb/runqueue.py                                 | 1 -
 bitbake/lib/bs4/__init__.py                                | 1 -
 bitbake/lib/bs4/diagnose.py                                | 1 -
 bitbake/lib/ply/yacc.py                                    | 1 -
 bitbake/lib/toaster/orm/models.py                          | 3 +--
 bitbake/lib/toaster/toastergui/templatetags/projecttags.py | 1 -
 bitbake/lib/toaster/toastergui/views.py                    | 2 --
 bitbake/lib/toaster/toastermain/settings.py                | 1 -
 12 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index cdec9e4d6c..a3c259479a 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -214,7 +214,6 @@ def deprecated(func, name=None, advice=""):
 # For compatibility
 def deprecate_import(current, modulename, fromlist, renames = None):
     """Import objects from one module into another, wrapping them with a DeprecationWarning"""
-    import sys
 
     module = __import__(modulename, fromlist = fromlist)
     for position, objname in enumerate(fromlist):
diff --git a/bitbake/lib/bb/acl.py b/bitbake/lib/bb/acl.py
index 0f41b275cf..e9dbdb617f 100755
--- a/bitbake/lib/bb/acl.py
+++ b/bitbake/lib/bb/acl.py
@@ -195,8 +195,6 @@ class ACL(object):
 
 def main():
     import argparse
-    import pwd
-    import grp
     from pathlib import Path
 
     parser = argparse.ArgumentParser()
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 6badda5972..168f14d0c8 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -817,7 +817,6 @@ class Git(FetchMethod):
         """
         Return True if git-lfs can be found, False otherwise.
         """
-        import shutil
         return shutil.which("git-lfs", path=d.getVar('PATH')) is not None
 
     def _get_repo_url(self, ud):
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index ba62517f08..bab1bf2580 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -264,7 +264,7 @@ class GitSM(Git):
         Git.clean(self, ud, d)
 
     def implicit_urldata(self, ud, d):
-        import shutil, subprocess, tempfile
+        import subprocess
 
         urldata = []
         def add_submodule(ud, url, module, modpath, workdir, d):
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index db68f97e68..809324d3fd 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -476,7 +476,6 @@ class RunQueueData:
         self.runtaskentries = {}
 
     def runq_depends_names(self, ids):
-        import re
         ret = []
         for id in ids:
             nam = os.path.basename(id)
diff --git a/bitbake/lib/bs4/__init__.py b/bitbake/lib/bs4/__init__.py
index e35725b86e..e226b9cf4a 100644
--- a/bitbake/lib/bs4/__init__.py
+++ b/bitbake/lib/bs4/__init__.py
@@ -463,6 +463,5 @@ class FeatureNotFound(ValueError):
 
 #By default, act as an HTML pretty-printer.
 if __name__ == '__main__':
-    import sys
     soup = BeautifulSoup(sys.stdin)
     print(soup.prettify())
diff --git a/bitbake/lib/bs4/diagnose.py b/bitbake/lib/bs4/diagnose.py
index 083395fb46..8d6ce8f87e 100644
--- a/bitbake/lib/bs4/diagnose.py
+++ b/bitbake/lib/bs4/diagnose.py
@@ -16,7 +16,6 @@ import tempfile
 import time
 import traceback
 import sys
-import cProfile
 
 def diagnose(data):
     """Diagnostic suite for isolating common problems."""
diff --git a/bitbake/lib/ply/yacc.py b/bitbake/lib/ply/yacc.py
index 381b50cf0b..529f85b081 100644
--- a/bitbake/lib/ply/yacc.py
+++ b/bitbake/lib/ply/yacc.py
@@ -1122,7 +1122,6 @@ class LRParser:
 # manipulate the rules that make up a grammar. 
 # -----------------------------------------------------------------------------
 
-import re
 
 # regex matching identifiers
 _is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$')
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 19c9686206..e2f488ed89 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -79,7 +79,6 @@ if 'sqlite' in settings.DATABASES['default']['ENGINE']:
     # end of HACK
 
 class GitURLValidator(validators.URLValidator):
-    import re
     regex = re.compile(
         r'^(?:ssh|git|http|ftp)s?://'  # http:// or https://
         r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|'  # domain...
@@ -1500,7 +1499,7 @@ class Layer_Version(models.Model):
     # code lifted, with adaptations, from the layerindex-web application
     # https://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/
     def _handle_url_path(self, base_url, path):
-        import re, posixpath
+        import posixpath
         if base_url:
             if self.dirpath:
                 if path:
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index bd398f0012..aee9bbcd14 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -233,7 +233,6 @@ def filter_sizeovertotal(package_object, total_size):
 
     return '{:.1%}'.format(float(size)/float(total_size))
 
-from django.utils.safestring import mark_safe
 @register.filter
 def format_vpackage_rowclass(size):
     if size == -1:
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 40aed265dc..061e6436c8 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -372,7 +372,6 @@ def _get_parameters_values(request, default_count, default_order):
 # set cookies for parameters. this is usefull in case parameters are set
 # manually from the GET values of the link
 def _set_parameters_values(pagesize, orderby, request):
-    from django.urls import resolve
     current_url = resolve(request.path_info).url_name
     request.session['%s_count' % current_url] = pagesize
     request.session['%s_orderby' % current_url] =orderby
@@ -699,7 +698,6 @@ class LazyEncoder(json.JSONEncoder):
         return super(LazyEncoder, self).default(obj)
 
 from toastergui.templatetags.projecttags import filtered_filesizeformat
-import os
 def _get_dir_entries(build_id, target_id, start):
     node_str = {
         Target_File.ITYPE_REGULAR   : '-',
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
index e06adc5a93..d2a449627f 100644
--- a/bitbake/lib/toaster/toastermain/settings.py
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -298,7 +298,6 @@ SOUTH_TESTS_MIGRATE = False
 
 # We automatically detect and install applications here if
 # they have a 'models.py' or 'views.py' file
-import os
 currentdir = os.path.dirname(__file__)
 for t in os.walk(os.path.dirname(currentdir)):
     modulename = os.path.basename(t[0])
-- 
2.25.1



  parent reply	other threads:[~2025-08-08  8:50 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08  8:49 [poky][scarthgap][PATCH 01/23] bitbake: fetch2/git: Use git shallow fetch to implement clone_shallow_local() Akash Hadke
2025-08-08  8:49 ` [poky][scarthgap][PATCH 02/23] bitbake: bitbake: tests/fetch: Update GitShallowTest for clone_shallow_local() Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 03/23] bitbake: fetch2/git: Enforce default remote name to "origin" Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 04/23] bitbake: gitsm: Add clean function Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 05/23] bitbake: git: Clean shallow mirror tarball Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 06/23] bitbake: git: Clean broken symlink Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` Akash Hadke [this message]
2025-08-08  9:10   ` Patchtest results for [poky][scarthgap][PATCH 07/23] bitbake: lib: Remove double imports patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 08/23] bitbake: fetch2/git: Add support for fast initial shallow fetch Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 09/23] bitbake: fetch2/gitsm: Unpack even when `ud.clonedir` is not available Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 10/23] bitbake: tests/fetch: Adapt test cases for fast shallow fetches Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 11/23] bitbake: fetch2/git: Restore escape quoting for the git url when used Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 12/23] bitbake: fetch/git: always fetch lfs when creating shallow tarball Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 13/23] bitbake: tests/fetch: Move commonly used imports to top Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 14/23] bitbake: fetch2: Check for git-lfs existence before using it Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 15/23] bitbake: fetch2: Simplify git LFS detection Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 16/23] bitbake: fetch2: Use git-lfs fetch to download objects Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 17/23] bitbake: fetch2: Fix incorrect lfs parametrization for submodules Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 18/23] bitbake: fetch2: Fix LFS object checkout in submodules Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 19/23] bitbake: tests/fetch: Test gitsm with LFS Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 20/23] bitbake: fetch2/git: fix shallow clone for tag containing slash Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 21/23] bitbake: fetch2: Move the `ensure_symlink()` function into the `FetchMethod` class Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 22/23] bitbake: fetch2: Ensure a valid symlink in `PREMIRRORS` case when using shallow cloning Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-08  8:49 ` [poky][scarthgap][PATCH 23/23] bitbake: fetch2/git: Add multiple revision support Akash Hadke
2025-08-08  9:10   ` Patchtest results for " patchtest
2025-08-11  8:23   ` [OE-core] " Alexander Kanavin
     [not found]     ` <10458.1760096658331781386@lists.openembedded.org>
2025-10-10 12:41       ` Richard Purdie
2025-08-08  9:10 ` Patchtest results for [poky][scarthgap][PATCH 01/23] bitbake: fetch2/git: Use git shallow fetch to implement clone_shallow_local() patchtest

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=20250808084931.2156763-7-akash.hadke27@gmail.com \
    --to=akash.hadke27@gmail.com \
    --cc=michaelestner@web.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.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