Skip to content

Commit

Permalink
Merge pull request #27 from doronz88/refactor/remove-python38-support
Browse files Browse the repository at this point in the history
maintenance: remove python3.8 support
  • Loading branch information
doronz88 authored Oct 30, 2024
2 parents 705f3a6 + 69f2fe0 commit 9fb57a1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:

strategy:
matrix:
python-version: [ 3.8, 3.9, "3.10", "3.11", "3.12" ]
os: [ macos-latest ]
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
os: [ ubuntu-latest, macos-latest, windows-latest ]

steps:
- uses: actions/checkout@v2
Expand All @@ -24,7 +24,6 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
brew install blacktop/tap/ipsw
python3 -m pip install --upgrade pip
python3 -m pip install pre-commit
- name: Run pre-commit hooks
Expand Down
6 changes: 3 additions & 3 deletions ipsw_parser/build_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from collections import UserDict
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import List, Mapping, Optional
from typing import Optional

from cached_property import cached_property
from plumbum import ProcessExecutionError, local
Expand Down Expand Up @@ -85,7 +85,7 @@ def macos_variant(self) -> str:
return self['Info'].get('MacOSVariant')

@cached_property
def manifest(self) -> Mapping:
def manifest(self) -> dict:
return self['Manifest']

@cached_property
Expand All @@ -101,7 +101,7 @@ def has_component(self, name: str) -> bool:
def get_component(self, name: str, **args) -> Component:
return Component(self, name, **args)

def populate_tss_request_parameters(self, parameters: Mapping, additional_keys: List[str] = None):
def populate_tss_request_parameters(self, parameters: dict, additional_keys: Optional[list[str]] = None) -> None:
""" equivalent to idevicerestore:tss_parameters_add_from_manifest """
key_list = ['ApBoardID', 'ApChipID']
if additional_keys is None:
Expand Down
5 changes: 2 additions & 3 deletions ipsw_parser/build_manifest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import plistlib
from typing import List

from cached_property import cached_property

Expand All @@ -15,7 +14,7 @@ def __init__(self, ipsw, manifest: bytes):

@cached_property
def build_major(self) -> int:
build_major = str()
build_major = ''
for i in self._manifest['ProductBuildVersion']:
if i.isdigit():
build_major += i
Expand All @@ -25,7 +24,7 @@ def build_major(self) -> int:
return int(build_major)

@cached_property
def supported_product_types(self) -> List[str]:
def supported_product_types(self) -> list[str]:
return self._manifest['SupportedProductTypes']

@cached_property
Expand Down
5 changes: 2 additions & 3 deletions ipsw_parser/ipsw.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from contextlib import contextmanager
from datetime import datetime
from pathlib import Path
from typing import List

from cached_property import cached_property
from construct import Const, Default, PaddedString, Struct
Expand Down Expand Up @@ -45,7 +44,7 @@ def system_version(self) -> bytes:
return self.read('SystemVersion.plist')

@cached_property
def filelist(self) -> List[zipfile.ZipInfo]:
def filelist(self) -> list[zipfile.ZipInfo]:
return self.archive.filelist

@contextmanager
Expand Down Expand Up @@ -105,7 +104,7 @@ def get_global_manifest(self, macos_variant: str, device_class: str) -> bytes:
def get_firmware(self, firmware_path: str) -> Firmware:
return Firmware(firmware_path, self)

def get_development_files(self) -> List[str]:
def get_development_files(self) -> list[str]:
result = []
for entry in self.archive.namelist():
for release in ('devel', 'kasan', 'research'):
Expand Down
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ipsw-parser"
description = "python3 utility for parsing and extracting data from IPSW"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = { file = "LICENSE" }
keywords = ["ios", "cli", "firmware", "ipsw"]
authors = [
Expand All @@ -15,13 +15,14 @@ classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
]
dynamic = ["dependencies","version"]
dynamic = ["dependencies", "version"]

[project.optional-dependencies]
test = ["pytest"]
Expand All @@ -38,7 +39,7 @@ exclude = ["docs*", "tests*"]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }
version = {attr = "ipsw_parser._version.__version__"}
version = { attr = "ipsw_parser._version.__version__" }

[tool.setuptools_scm]
version_file = "ipsw_parser/_version.py"
Expand Down

0 comments on commit 9fb57a1

Please sign in to comment.