mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-02-16 16:41:42 +00:00
aedi: fix missing and erroneous type hints
This commit is contained in:
parent
c6e40329e6
commit
5dc10de290
3 changed files with 9 additions and 7 deletions
|
@ -40,7 +40,7 @@ class Builder(object):
|
||||||
state.xcode = arguments.xcode
|
state.xcode = arguments.xcode
|
||||||
state.verbose = arguments.verbose
|
state.verbose = arguments.verbose
|
||||||
|
|
||||||
self._platforms = []
|
self._platforms: typing.List[TargetPlatform] = []
|
||||||
self._populate_platforms(arguments)
|
self._populate_platforms(arguments)
|
||||||
|
|
||||||
state.platform = self._platforms[0]
|
state.platform = self._platforms[0]
|
||||||
|
@ -193,7 +193,7 @@ class Builder(object):
|
||||||
# Merge executable and library files
|
# Merge executable and library files
|
||||||
dst_file = dst_path / src.name
|
dst_file = dst_path / src.name
|
||||||
|
|
||||||
args = ['lipo']
|
args: typing.List[typing.Union[str, Path]] = ['lipo']
|
||||||
args += src_sub_paths
|
args += src_sub_paths
|
||||||
args += ['-create', '-output', dst_file]
|
args += ['-create', '-output', dst_file]
|
||||||
subprocess.check_call(args)
|
subprocess.check_call(args)
|
||||||
|
|
|
@ -22,6 +22,7 @@ import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import typing
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ class BuildState:
|
||||||
args = ('git', 'checkout', '-b', branch, 'origin/' + branch)
|
args = ('git', 'checkout', '-b', branch, 'origin/' + branch)
|
||||||
subprocess.run(args, cwd=self.source, check=True)
|
subprocess.run(args, cwd=self.source, check=True)
|
||||||
|
|
||||||
def download_source(self, url: str, checksum: str, patches: [tuple, list, str] = None):
|
def download_source(self, url: str, checksum: str, patches: typing.Union[tuple, list, str] = None):
|
||||||
if self.external_source:
|
if self.external_source:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ class BuildState:
|
||||||
self.source = extract_path
|
self.source = extract_path
|
||||||
self.build_path = self.build_path / first_path_component
|
self.build_path = self.build_path / first_path_component
|
||||||
|
|
||||||
def _read_source_package(self, url: str) -> (bytes, Path):
|
def _read_source_package(self, url: str) -> typing.Tuple[bytes, Path]:
|
||||||
filename = url.rsplit(os.sep, 1)[1]
|
filename = url.rsplit(os.sep, 1)[1]
|
||||||
filepath = self.source / filename
|
filepath = self.source / filename
|
||||||
|
|
||||||
|
@ -140,7 +141,7 @@ class BuildState:
|
||||||
filepath.unlink()
|
filepath.unlink()
|
||||||
raise Exception(f'Checksum of {filepath} does not match, expected: {checksum}, actual: {file_checksum}')
|
raise Exception(f'Checksum of {filepath} does not match, expected: {checksum}, actual: {file_checksum}')
|
||||||
|
|
||||||
def _unpack_source_package(self, filepath: Path) -> (str, Path):
|
def _unpack_source_package(self, filepath: Path) -> typing.Tuple[str, Path]:
|
||||||
filepaths = subprocess.check_output(['tar', '-tf', filepath]).decode("utf-8")
|
filepaths = subprocess.check_output(['tar', '-tf', filepath]).decode("utf-8")
|
||||||
filepaths = filepaths.split('\n')
|
filepaths = filepaths.split('\n')
|
||||||
first_path_component = None
|
first_path_component = None
|
||||||
|
@ -186,5 +187,5 @@ class BuildState:
|
||||||
|
|
||||||
return result.decode('utf-8').rstrip('\n')
|
return result.decode('utf-8').rstrip('\n')
|
||||||
|
|
||||||
def has_source_file(self, path: [str, Path]):
|
def has_source_file(self, path: typing.Union[str, Path]):
|
||||||
return (self.source / path).exists()
|
return (self.source / path).exists()
|
||||||
|
|
|
@ -21,6 +21,7 @@ from distutils.version import StrictVersion
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import shutil
|
import shutil
|
||||||
|
import typing
|
||||||
|
|
||||||
|
|
||||||
# Minimum OS versions
|
# Minimum OS versions
|
||||||
|
@ -51,7 +52,7 @@ class CommandLineOptions(dict):
|
||||||
|
|
||||||
|
|
||||||
class TargetPlatform:
|
class TargetPlatform:
|
||||||
def __init__(self, architecture: str, host: str, os_version: [str, StrictVersion],
|
def __init__(self, architecture: str, host: str, os_version: typing.Union[str, StrictVersion],
|
||||||
sdk_path: Path, prefix_path: Path):
|
sdk_path: Path, prefix_path: Path):
|
||||||
self.architecture = architecture
|
self.architecture = architecture
|
||||||
self.host = host
|
self.host = host
|
||||||
|
|
Loading…
Reference in a new issue