diff --git a/requirements.build.txt b/requirements.build.txt index aa68724..e404603 100644 --- a/requirements.build.txt +++ b/requirements.build.txt @@ -1,25 +1,10 @@ -r requirements.txt -build==0.6.0.post1 -packaging==23.1 -pep517==0.13.0 -pyinstaller==6.3.0 -black==23.7.0 -certifi==2023.7.22 -charset-normalizer==3.2.0 -idna==3.4 -isort==5.12.0 -lazy-object-proxy==1.9.0 -mccabe==0.7.0 -mypy==1.7.1 +build==1.2.1 +pyinstaller==6.10.0 +black==24.8.0 +mypy==1.11.2 mypy-extensions==1.0.0 -pylint==3.0.3 -pyparsing==3.1.1 -six==1.16.0 -toml==0.10.2 -tomli==2.0.1 -types-python-dateutil==2.8.19.14 -types-requests==2.31.0.2 -typing-extensions==4.7.1 -urllib3==2.0.4 -websocket-client==1.6.1 -wrapt==1.15.0 +pylint==3.2.7 +types-python-dateutil==2.9.0.20240906 +types-requests==2.32.0.20240905 +typing-extensions==4.12.2 diff --git a/requirements.txt b/requirements.txt index a4c3398..63f4a0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,3 @@ -docker==7.0.0 -python-dateutil==2.8.2 -pyelftools==0.30 - -# Pinned due to https://github.com/docker/docker-py/issues/3256 -requests==2.31.0 +docker==7.1.0 +python-dateutil==2.9.0.post0 +pyelftools==0.31 diff --git a/tests/test_strip.py b/tests/test_strip.py index 5b86895..4ce2f54 100644 --- a/tests/test_strip.py +++ b/tests/test_strip.py @@ -55,11 +55,14 @@ def test_strip(self) -> None: dist_dir = path.join(tmp_dir, "dist") shutil.copytree(src_dir, rec_dir) replacements = {"flags=()": "flags=(nostrip)"} - with open( - path.join(src_dir, "package"), "rt", encoding="utf-8" - ) as infile, open( - path.join(rec_dir, "package"), "wt", encoding="utf-8" - ) as outfile: + with ( + open( + path.join(src_dir, "package"), "rt", encoding="utf-8" + ) as infile, + open( + path.join(rec_dir, "package"), "wt", encoding="utf-8" + ) as outfile, + ): for line in infile: for src, target in replacements.items(): line = line.replace(src, target) diff --git a/toltec/bash.py b/toltec/bash.py index b81d3aa..c6a6727 100644 --- a/toltec/bash.py +++ b/toltec/bash.py @@ -344,7 +344,7 @@ def _parse_func(lexer: shlex.shlex) -> Tuple[int, int]: assert lexer.get_token() == "{" brace_depth = 1 - start_byte = lexer.instream.tell() + start_byte = lexer.instream.tell() # type: ignore while brace_depth > 0: token = lexer.get_token() @@ -355,7 +355,7 @@ def _parse_func(lexer: shlex.shlex) -> Tuple[int, int]: elif token == "}": brace_depth -= 1 - end_byte = lexer.instream.tell() - 1 + end_byte = lexer.instream.tell() - 1 # type: ignore return start_byte, end_byte diff --git a/toltec/hooks/__init__.py b/toltec/hooks/__init__.py index 51d3150..72aaefe 100644 --- a/toltec/hooks/__init__.py +++ b/toltec/hooks/__init__.py @@ -1,6 +1,7 @@ """ Built in hooks """ + __all__ = [ "patch_rm2fb", "strip", diff --git a/toltec/hooks/install_lib.py b/toltec/hooks/install_lib.py index 88ce7fb..1287014 100644 --- a/toltec/hooks/install_lib.py +++ b/toltec/hooks/install_lib.py @@ -4,6 +4,7 @@ After the artifacts are packaged, this hook will look for known install-lib methods and add them to scripts if found. """ + import logging from typing import Set, Iterable diff --git a/toltec/hooks/patch_rm2fb.py b/toltec/hooks/patch_rm2fb.py index accc135..a6edc3d 100644 --- a/toltec/hooks/patch_rm2fb.py +++ b/toltec/hooks/patch_rm2fb.py @@ -8,6 +8,7 @@ binaries. This behavior is only enabled if the recipe declares the 'patch_rm2fb' flag. """ + import os import logging import shlex diff --git a/toltec/hooks/reload_oxide_apps.py b/toltec/hooks/reload_oxide_apps.py index 2edd617..ac945b2 100644 --- a/toltec/hooks/reload_oxide_apps.py +++ b/toltec/hooks/reload_oxide_apps.py @@ -5,6 +5,7 @@ /opt/etc/draft or /opt/usr/share/applications and adds reload-oxide-apps to configure, postupgrade, and postremove """ + import os import logging diff --git a/toltec/hooks/strip.py b/toltec/hooks/strip.py index 7cb0e0d..f60e118 100644 --- a/toltec/hooks/strip.py +++ b/toltec/hooks/strip.py @@ -5,6 +5,7 @@ hook looks for ELF-files in the build directory and strips them. This behavior is disabled if the recipe declares the 'nostrip' flag. """ + import os import logging import shlex diff --git a/toltec/ipk.py b/toltec/ipk.py index 2b98790..a911c59 100644 --- a/toltec/ipk.py +++ b/toltec/ipk.py @@ -143,9 +143,11 @@ def write( :param pkg_dir: directory containing the package tree to include in the data sub-archive, leave empty to generate an empty data archive """ - with BytesIO() as control, BytesIO() as data, _targz_open( - file, epoch - ) as archive: + with ( + BytesIO() as control, + BytesIO() as data, + _targz_open(file, epoch) as archive, + ): root_info = tarfile.TarInfo("./") root_info.type = tarfile.DIRTYPE archive.addfile(_clean_info(None, epoch, root_info)) diff --git a/toltec/repo.py b/toltec/repo.py index c08328d..b5abe3a 100644 --- a/toltec/repo.py +++ b/toltec/repo.py @@ -31,9 +31,10 @@ def make_index(base_dir: str, _start: bool = True) -> None: index_path = os.path.join(base_dir, "Packages") index_gzip_path = os.path.join(base_dir, "Packages.gz") - with open( - index_path, "w", encoding=locale.getencoding() - ) as index_file, gzip.open(index_gzip_path, "wt") as index_gzip_file: + with ( + open(index_path, "w", encoding=locale.getencoding()) as index_file, + gzip.open(index_gzip_path, "wt") as index_gzip_file, + ): for entry in os.scandir(base_dir): if entry.name in ("Packages", "Packages.gz"): pass diff --git a/toltec/version.py b/toltec/version.py index 2e72921..8624413 100644 --- a/toltec/version.py +++ b/toltec/version.py @@ -79,9 +79,11 @@ def split( def map_alpha(string: str, length: int) -> tuple[int, ...]: return tuple( - _ALPHA_SORT_KEY.index(string[i]) - if i in range(len(string)) - else _ALPHA_SORT_KEY.index(None) + ( + _ALPHA_SORT_KEY.index(string[i]) + if i in range(len(string)) + else _ALPHA_SORT_KEY.index(None) + ) for i in range(length) )