ruff: run check --fix (MR 2252)

Get rid of unused imports and such

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-06-13 05:21:00 +02:00 committed by Oliver Smith
parent 139c205424
commit f2ca9c618e
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
38 changed files with 15 additions and 59 deletions

View file

@ -3,7 +3,6 @@
import fnmatch import fnmatch
from pmb.helpers import logging from pmb.helpers import logging
import re import re
from pmb.types import PmbArgs
import pmb.helpers.git import pmb.helpers.git
import pmb.helpers.run import pmb.helpers.run
import pmb.helpers.args import pmb.helpers.args

View file

@ -6,7 +6,6 @@ import pmb.build
import pmb.chroot.apk import pmb.chroot.apk
import pmb.chroot.apk_static import pmb.chroot.apk_static
from pmb.core.arch import Arch from pmb.core.arch import Arch
from pmb.types import PmbArgs
import pmb.helpers.run import pmb.helpers.run
import pmb.parse.apkindex import pmb.parse.apkindex
from pmb.core import Chroot from pmb.core import Chroot

View file

@ -18,7 +18,6 @@ import pmb.helpers.pmaports
import pmb.helpers.repo import pmb.helpers.repo
import pmb.helpers.mount import pmb.helpers.mount
import pmb.helpers.package import pmb.helpers.package
from pmb.meta import Cache
import pmb.parse import pmb.parse
import pmb.parse.apkindex import pmb.parse.apkindex
from pmb.helpers.exceptions import BuildFailedError from pmb.helpers.exceptions import BuildFailedError

View file

@ -8,7 +8,7 @@ from typing import Any, Dict, Optional, Union
import pmb.config import pmb.config
import pmb.chroot.apk import pmb.chroot.apk
import pmb.helpers.pmaports import pmb.helpers.pmaports
from pmb.core import Chroot, ChrootType from pmb.core import Chroot
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.meta import Cache from pmb.meta import Cache

View file

@ -5,13 +5,11 @@ from pmb.core.pkgrepo import pkgrepo_default_path
from pmb.helpers import logging from pmb.helpers import logging
from pathlib import Path from pathlib import Path
import pmb.chroot import pmb.chroot
from pmb.types import PmbArgs
import pmb.helpers.cli import pmb.helpers.cli
import pmb.parse import pmb.parse
import pmb.build import pmb.build
from pmb.core import Chroot from pmb.core import Chroot
from pmb.core.context import get_context
def newapkbuild(folder, args_passed, force=False): def newapkbuild(folder, args_passed, force=False):

View file

@ -1,15 +1,12 @@
# Copyright 2023 Oliver Smith # Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import os import os
import glob
from pmb.core.pkgrepo import pkgrepo_iglob from pmb.core.pkgrepo import pkgrepo_iglob
from pmb.helpers import logging from pmb.helpers import logging
import pmb.config import pmb.config
import pmb.chroot.apk import pmb.chroot.apk
from pmb.core import Chroot from pmb.core import Chroot
from pmb.core.context import get_context
from pmb.types import PmbArgs
def list_chroot(suffix: Chroot, remove_prefix=True): def list_chroot(suffix: Chroot, remove_prefix=True):

View file

@ -11,7 +11,7 @@ import pmb.chroot.binfmt
import pmb.helpers.run import pmb.helpers.run
import pmb.helpers.run_core import pmb.helpers.run_core
from pmb.core import Chroot from pmb.core import Chroot
from pmb.types import Env, PathString, PmbArgs from pmb.types import Env, PathString
def executables_absolute_path(): def executables_absolute_path():

View file

@ -2,8 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations from __future__ import annotations
from typing import Generator, List, Optional from typing import List
from pathlib import Path, PosixPath, PurePosixPath
from pmb import commands from pmb import commands
from pmb.types import PathString from pmb.types import PathString
from pmb.helpers import run from pmb.helpers import run

View file

@ -2,7 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, List
from pmb import commands, logging from pmb import commands, logging
import pmb.helpers.repo import pmb.helpers.repo
import pmb.parse.apkindex import pmb.parse.apkindex

View file

@ -10,7 +10,7 @@ import glob
import json import json
import os import os
import shutil import shutil
from typing import Any, List, Optional from typing import Any, Optional
import pmb.aportgen import pmb.aportgen
import pmb.config import pmb.config

View file

@ -3,9 +3,7 @@
"""Global runtime context""" """Global runtime context"""
from typing import List, Optional
from pathlib import Path from pathlib import Path
from pmb.core.arch import Arch
from .config import Config from .config import Config

View file

@ -1,10 +1,9 @@
# Copyright 2024 Caleb Connolly # Copyright 2024 Caleb Connolly
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from argparse import Namespace
import enum import enum
from pathlib import Path from pathlib import Path
from typing import Dict, List, Optional, Tuple, TypedDict, Union from typing import List
from pmb.core.chroot import ChrootType from pmb.core.chroot import ChrootType
from pmb.types import PathString from pmb.types import PathString

View file

@ -1,7 +1,7 @@
import os import os
import glob import glob
from pathlib import Path from pathlib import Path
from typing import Any, Dict, Generator, List, Optional, Tuple from typing import Dict, Generator, List, Optional, Tuple
import pmb.config import pmb.config
from pmb.core.context import get_context from pmb.core.context import get_context

View file

@ -3,7 +3,6 @@
import pmb.chroot.apk import pmb.chroot.apk
import pmb.config import pmb.config
import pmb.config.pmaports import pmb.config.pmaports
from pmb.types import PmbArgs
import pmb.helpers.mount import pmb.helpers.mount
import pmb.helpers.args import pmb.helpers.args
from pmb.helpers.mount import mount_device_rootfs from pmb.helpers.mount import mount_device_rootfs

View file

@ -1,8 +1,6 @@
# Copyright 2023 Oliver Smith # Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from typing import Dict
from pmb.parse.deviceinfo import Deviceinfo from pmb.parse.deviceinfo import Deviceinfo
from pmb.types import PmbArgs
import pmb.flasher import pmb.flasher
import pmb.chroot.initfs import pmb.chroot.initfs
import pmb.helpers.args import pmb.helpers.args

View file

@ -1,13 +1,12 @@
# Copyright 2023 Johannes Marbach, Oliver Smith # Copyright 2023 Johannes Marbach, Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import os import os
from pathlib import Path
from typing import List, Sequence from typing import List, Sequence
import pmb.chroot import pmb.chroot
import pmb.config.pmaports import pmb.config.pmaports
from pmb.core.arch import Arch from pmb.core.arch import Arch
from pmb.types import PathString, PmbArgs from pmb.types import PathString
import pmb.helpers.cli import pmb.helpers.cli
import pmb.helpers.run import pmb.helpers.run
import pmb.helpers.run_core import pmb.helpers.run_core

View file

@ -1,11 +1,5 @@
# Copyright 2023 Oliver Smith # Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from argparse import Namespace
import copy
import json
import os
from pathlib import Path
import sys
import pmb.config import pmb.config
from pmb.core.context import Context from pmb.core.context import Context
from pmb.core.pkgrepo import pkgrepo_default_path from pmb.core.pkgrepo import pkgrepo_default_path

View file

@ -8,7 +8,6 @@ import readline
import sys import sys
import pmb.config import pmb.config
from pmb.types import PmbArgs
from pmb.core.context import get_context from pmb.core.context import get_context

View file

@ -3,7 +3,6 @@
import os import os
from pathlib import Path from pathlib import Path
from typing import Optional from typing import Optional
from pmb.core.context import get_context
from pmb.core.pkgrepo import pkgrepo_glob_one, pkgrepo_iglob from pmb.core.pkgrepo import pkgrepo_glob_one, pkgrepo_iglob

View file

@ -4,11 +4,9 @@ import configparser
from pathlib import Path from pathlib import Path
from typing import Dict from typing import Dict
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.core.context import Context
from pmb.core.pkgrepo import pkgrepo_path from pmb.core.pkgrepo import pkgrepo_path
from pmb.helpers import logging from pmb.helpers import logging
import os import os
from pathlib import Path
import pmb.build import pmb.build
import pmb.chroot.apk import pmb.chroot.apk

View file

@ -9,7 +9,6 @@ import shutil
import urllib.request import urllib.request
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.types import PmbArgs
import pmb.helpers.run import pmb.helpers.run
def cache_file(prefix: str, url: str) -> Path: def cache_file(prefix: str, url: str) -> Path:

View file

@ -1,6 +1,5 @@
# Copyright 2023 Danct12 <danct12@disroot.org> # Copyright 2023 Danct12 <danct12@disroot.org>
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from pathlib import Path
from typing import Dict, List, Sequence from typing import Dict, List, Sequence
from pmb.core.chroot import Chroot from pmb.core.chroot import Chroot
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_names, pkgrepo_relative_path from pmb.core.pkgrepo import pkgrepo_iter_package_dirs, pkgrepo_names, pkgrepo_relative_path
@ -10,7 +9,6 @@ import os
import pmb.chroot import pmb.chroot
import pmb.chroot.apk import pmb.chroot.apk
import pmb.build import pmb.build
from pmb.types import PmbArgs
import pmb.helpers.run import pmb.helpers.run
import pmb.helpers.pmaports import pmb.helpers.pmaports

View file

@ -3,7 +3,6 @@
import os import os
from pathlib import Path, PurePath from pathlib import Path, PurePath
from typing import List from typing import List
from pmb.types import PmbArgs
import pmb.helpers import pmb.helpers
from pmb.core import Chroot from pmb.core import Chroot
import pmb.helpers.run import pmb.helpers.run

View file

@ -14,7 +14,6 @@ import pmb.helpers.pmaports
import pmb.helpers.run import pmb.helpers.run
from typing import Dict, Any from typing import Dict, Any
from typing import Any, Dict
def folder_size(path: Path): def folder_size(path: Path):

View file

@ -6,7 +6,6 @@ See also:
- pmb/helpers/repo.py (work with binary package repos) - pmb/helpers/repo.py (work with binary package repos)
- pmb/helpers/package.py (work with both) - pmb/helpers/package.py (work with both)
""" """
import glob
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.core.arch import Arch from pmb.core.arch import Arch
from pmb.core.pkgrepo import pkgrepo_iter_package_dirs from pmb.core.pkgrepo import pkgrepo_iter_package_dirs

View file

@ -14,11 +14,10 @@ from pmb.core.arch import Arch
from pmb.core.pkgrepo import pkgrepo_names from pmb.core.pkgrepo import pkgrepo_names
from pmb.helpers import logging from pmb.helpers import logging
from pathlib import Path from pathlib import Path
from typing import List, Optional, Set from typing import List, Optional
import pmb.config.pmaports import pmb.config.pmaports
from pmb.meta import Cache from pmb.meta import Cache
from pmb.types import PmbArgs
import pmb.helpers.http import pmb.helpers.http
import pmb.helpers.run import pmb.helpers.run
import pmb.helpers.other import pmb.helpers.other

View file

@ -5,8 +5,8 @@ from pathlib import Path
import subprocess import subprocess
from pmb.core.arch import Arch from pmb.core.arch import Arch
import pmb.helpers.run_core import pmb.helpers.run_core
from typing import Any, Dict, List, Optional, Sequence from typing import Optional, Sequence
from pmb.types import Env, PathString, PmbArgs from pmb.types import Env, PathString
def user(cmd: Sequence[PathString], working_dir: Optional[Path] = None, output: str = "log", output_return: bool = False, def user(cmd: Sequence[PathString], working_dir: Optional[Path] = None, output: str = "log", output_return: bool = False,

View file

@ -13,7 +13,7 @@ import subprocess
import sys import sys
import threading import threading
import time import time
from typing import Dict, Optional, Sequence from typing import Optional, Sequence
import pmb.helpers.run import pmb.helpers.run
"""For a detailed description of all output modes, read the description of """For a detailed description of all output modes, read the description of

View file

@ -7,7 +7,6 @@ import pmb.helpers.git
from pmb.core import Config from pmb.core import Config
from pmb.types import PmbArgs from pmb.types import PmbArgs
from pmb.core.context import get_context from pmb.core.context import get_context
from typing import List, Tuple
def print_status_line(key: str, value: str): def print_status_line(key: str, value: str):

View file

@ -1,8 +1,6 @@
# Copyright 2023 Clayton Craft # Copyright 2023 Clayton Craft
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import os import os
import glob
from pmb.core.context import get_context
from pmb.core.pkgrepo import pkgrepo_iglob from pmb.core.pkgrepo import pkgrepo_iglob
import pmb.helpers.pmaports import pmb.helpers.pmaports
import pmb.helpers.package import pmb.helpers.package

View file

@ -7,7 +7,7 @@ import re
import glob import glob
import shlex import shlex
import sys import sys
from typing import Dict, List, Optional, Sequence, TypedDict from typing import Dict, List, Optional, Sequence
from pathlib import Path from pathlib import Path
import pmb.build import pmb.build

View file

@ -3,7 +3,6 @@
from typing import Optional from typing import Optional
from pmb.helpers import logging from pmb.helpers import logging
import os import os
import glob
from pathlib import Path from pathlib import Path
from pmb.types import PmbArgs from pmb.types import PmbArgs
import pmb.helpers.mount import pmb.helpers.mount

View file

@ -1,14 +1,12 @@
# Copyright 2023 Oliver Smith # Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import glob
import json import json
from pathlib import Path from pathlib import Path
from typing import List, Optional from typing import List
from pmb.helpers import logging from pmb.helpers import logging
import os
import time import time
from pmb.types import PathString, PmbArgs from pmb.types import PathString
import pmb.helpers.mount import pmb.helpers.mount
import pmb.helpers.run import pmb.helpers.run
import pmb.chroot import pmb.chroot

View file

@ -10,7 +10,6 @@ from collections import OrderedDict
import pmb.config import pmb.config
from pmb.meta import Cache from pmb.meta import Cache
from pmb.types import PmbArgs
import pmb.helpers.devices import pmb.helpers.devices
import pmb.parse.version import pmb.parse.version

View file

@ -1,7 +1,7 @@
# Copyright 2023 Oliver Smith # Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
import collections import collections
from typing import Any, Dict, List, Optional, Sequence, Union from typing import Any, Dict, List, Optional, Sequence
from pmb.core.arch import Arch from pmb.core.arch import Arch
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.helpers import logging from pmb.helpers import logging

View file

@ -4,7 +4,6 @@ import os
from pmb.core.context import get_context from pmb.core.context import get_context
from pmb.helpers import logging from pmb.helpers import logging
from pathlib import Path from pathlib import Path
from pmb.types import PmbArgs
import pmb.helpers.run import pmb.helpers.run
import pmb.chroot import pmb.chroot
import pmb.chroot.other import pmb.chroot.other

View file

@ -1,6 +1,5 @@
# Copyright 2023 Oliver Smith # Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
from typing import Dict, List, Sequence, Set
from pmb.helpers import logging from pmb.helpers import logging
import pmb.chroot import pmb.chroot
import pmb.chroot.apk import pmb.chroot.apk

View file

@ -7,7 +7,6 @@ import os
import pmb.build import pmb.build
import pmb.config import pmb.config
from pmb.types import PmbArgs
import pmb.parse import pmb.parse
import pmb.helpers.pmaports import pmb.helpers.pmaports
from pmb.helpers.exceptions import NonBugError from pmb.helpers.exceptions import NonBugError