Skip to content

Commit

Permalink
Fixed linter errors
Browse files Browse the repository at this point in the history
Latest changes regarding type hints introduced linter errors.
Also adapt the workflow run which is expected to detect them
  • Loading branch information
schaefi committed Aug 1, 2023
1 parent d5dae47 commit 45d64fd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Tox
run: |
python -m pip install --upgrade pip
python -m pip install tox==3.28.0
python -m pip install tox
- name: Run code checks
run: |
tox -e check
4 changes: 2 additions & 2 deletions .github/workflows/ci-units-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.6", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand All @@ -23,7 +23,7 @@ jobs:
- name: Install Tox
run: |
python -m pip install --upgrade pip
python -m pip install tox==3.28.0
python -m pip install tox
- name: Run unit and type tests
run: |
tox -e unit_py3_6,unit_py3_8,unit_py3_9,unit_py3_10
2 changes: 1 addition & 1 deletion kiwi/container/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ def create(
self, filename: str, base_image: str,
ensure_empty_tmpdirs: bool, compress_archive: bool = False
) -> str:
pass # pragma: no cover
pass # pragma: no cover
7 changes: 3 additions & 4 deletions kiwi/container/oci.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import sys
from typing import Dict, List, Optional
if sys.version_info >= (3, 8):
from typing import TypedDict # pragma: no cover
else: # pragma: no cover
from typing_extensions import TypedDict # pragma: no cover
from typing import TypedDict # pragma: no cover
else: # pragma: no cover
from typing_extensions import TypedDict # pragma: no cover

# project
from kiwi.utils.compress import Compress
Expand Down Expand Up @@ -119,7 +119,6 @@ def __init__(self, root_dir: str, transport: str, custom_args: Optional[OciConfi
self.oci_config['history']['created_by'] = \
Defaults.get_default_container_created_by()


def create(
self, filename: str, base_image: str,
ensure_empty_tmpdirs: bool = True, compress_archive: bool = False
Expand Down
7 changes: 4 additions & 3 deletions kiwi/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,10 @@ def rebase_to_root(root: str, elements: List[str]) -> List[str]:

@staticmethod
def which(
filename: str, alternative_lookup_paths: Optional[List[str]]=None,
custom_env: Optional[Dict[str, str]]=None, access_mode: Optional[int]=None,
root_dir: Optional[str]=None
filename: str, alternative_lookup_paths: Optional[List[str]] = None,
custom_env: Optional[Dict[str, str]] = None,
access_mode: Optional[int] = None,
root_dir: Optional[str] = None
) -> Optional[str]:
"""
Lookup file name in PATH
Expand Down
8 changes: 5 additions & 3 deletions kiwi/utils/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class Compress:
:param str uncompressed_filename:
Uncompressed file name path
"""
def __init__(self, source_filename: str, keep_source_on_compress: bool=False) -> None:
def __init__(
self, source_filename: str, keep_source_on_compress: bool = False
) -> None:
if not os.path.exists(source_filename):
raise KiwiFileNotFound(
'compression source file %s not found' % source_filename
Expand All @@ -57,7 +59,7 @@ def __init__(self, source_filename: str, keep_source_on_compress: bool=False) ->
self.compressed_filename: Optional[str] = None
self.uncompressed_filename: Optional[str] = None

def xz(self, options: Optional[List[str]]=None) -> str:
def xz(self, options: Optional[List[str]] = None) -> str:
"""
Create XZ compressed file
Expand Down Expand Up @@ -89,7 +91,7 @@ def gzip(self) -> str:
self.compressed_filename = self.source_filename + '.gz'
return self.compressed_filename

def uncompress(self, temporary: bool=False) -> str:
def uncompress(self, temporary: bool = False) -> str:
"""
Uncompress with format autodetection
Expand Down

0 comments on commit 45d64fd

Please sign in to comment.