Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 6, 2023
1 parent 0553297 commit 170fe08
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 22 deletions.
4 changes: 3 additions & 1 deletion examples/PyQt/cython_app/testLoad.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import sys
from PyQt6.QtWidgets import QMessageBox, QApplication

from PyQt6.QtWidgets import QApplication, QMessageBox


def main():
app = QApplication(sys.argv)
Expand Down
1 change: 0 additions & 1 deletion examples/pygame/aliens.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ def main(winstyle=0):
all.add(Score())

while player.alive():

# get input
for event in pygame.event.get():
if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):
Expand Down
1 change: 0 additions & 1 deletion py2app_tests/test_recipe_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,4 @@ def test_imports(self):
pass

else:

self.fail(f"Can import {mod!r}")
1 change: 0 additions & 1 deletion src/py2app/bootstrap/argv_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def _ctypes_setup() -> ctypes.CDLL:


def _run_argvemulator(timeout: float = 60.0) -> None:

# Configure ctypes
carbon = _ctypes_setup()

Expand Down
1 change: 0 additions & 1 deletion src/py2app/bootstrap/setup_included_subpackages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def _included_subpackages(packages: "list[str]") -> None:

class Loader:
def load_module(self, fullname: str) -> types.ModuleType:

pkg_dir = os.path.join(
os.environ["RESOURCEPATH"], "lib", "python%d.%d" % (sys.version_info[:2])
)
Expand Down
1 change: 0 additions & 1 deletion src/py2app/bootstrap/setup_pkgresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def _setup_pkgresources() -> None:
resource_path = os.getenv("RESOURCEPATH")
assert resource_path is not None
with open(os.path.join(os.path.dirname(resource_path), "Info.plist"), "rb") as fp:

pl = plistlib.load(fp)

appname = pl.get("CFBundleIdentifier")
Expand Down
22 changes: 9 additions & 13 deletions src/py2app/build_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,13 @@ def copy_framework(self, info: _FrameworkInfo) -> str:
return destfn


def iter_recipes() -> typing.Iterator[
typing.Tuple[
str, typing.Callable[["py2app", ModuleGraph], typing.Optional[RecipeInfo]]
def iter_recipes() -> (
typing.Iterator[
typing.Tuple[
str, typing.Callable[["py2app", ModuleGraph], typing.Optional[RecipeInfo]]
]
]
]:
):
for name in dir(recipes):
if name.startswith("_"):
continue
Expand Down Expand Up @@ -690,7 +692,6 @@ def finalize_options(self) -> None:
if not self.plist:
self.plist = {}
if isinstance(self.plist, str):

with open(self.plist, "rb") as fp:
self.plist = plistlib.load(fp)

Expand Down Expand Up @@ -901,9 +902,7 @@ def run(self) -> None:
def iter_datamodels(
self, resdir: typing.Union[str, os.PathLike[str]]
) -> typing.Iterator[typing.Tuple[str, str]]:
for (path, files) in (
normalize_data_file(fn) for fn in (self.datamodels or ())
):
for path, files in (normalize_data_file(fn) for fn in (self.datamodels or ())):
for fn in files:
basefn, ext = os.path.splitext(fn)
if ext != ".xcdatamodel":
Expand All @@ -921,7 +920,7 @@ def compile_datamodels(self, resdir: typing.Union[str, os.PathLike[str]]) -> Non
def iter_mappingmodels(
self, resdir: typing.Union[str, os.PathLike[str]]
) -> typing.Iterator[typing.Tuple[str, str]]:
for (path, files) in (
for path, files in (
normalize_data_file(fn) for fn in (self.mappingmodels or ())
):
for fn in files:
Expand Down Expand Up @@ -961,7 +960,7 @@ def iter_extra_plugins(self) -> typing.Iterator[typing.Tuple[str, str]]:
def iter_data_files(self) -> typing.Iterator[typing.Tuple[str, str]]:
dist = self.distribution
allres = chain(getattr(dist, "data_files", ()) or (), self.resources)
for (path, files) in (normalize_data_file(fn) for fn in allres):
for path, files in (normalize_data_file(fn) for fn in allres):
for fn in files:
assert isinstance(fn, str)
yield fn, os.path.join(path, os.path.basename(fn))
Expand Down Expand Up @@ -2054,7 +2053,6 @@ def initialize_prescripts(self) -> None:
real_prefix = None
global_site_packages = False
with open(os.path.join(sys.prefix, "pyvenv.cfg")) as fp:

for ln in fp:
if ln.startswith("home = "):
_, home_path = ln.split("=", 1)
Expand Down Expand Up @@ -2141,7 +2139,6 @@ def initialize_prescripts(self) -> None:
prescripts.append("disable_linecache")
prescripts.append("boot_" + self.style)
else:

# Add ctypes prescript because it is needed to
# find libraries in the bundle, but we don't run
# recipes and hence the ctypes recipe is not used
Expand Down Expand Up @@ -2354,7 +2351,6 @@ def copy_loader_paths(
sourcefn: typing.Union[str, os.PathLike[str]],
destfn: typing.Union[str, os.PathLike[str]],
) -> None:

todo = [(sourcefn, destfn)]

while todo:
Expand Down
1 change: 0 additions & 1 deletion src/py2app/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,6 @@ def copy_tree(
condition: typing.Optional[typing.Callable[[str], bool]] = None,
progress: typing.Optional[Progress] = None,
) -> typing.List[str]:

"""
Copy an entire directory tree 'src' to a new location 'dst'. Both
'src' and 'dst' must be directory names. If 'src' is not a
Expand Down
1 change: 1 addition & 0 deletions stubs/macholib/MachOGraph.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import typing

from .MachO import MachO

class MachOGraph:
Expand Down
3 changes: 2 additions & 1 deletion stubs/macholib/MachOStandalone.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" """
import typing
import collections
import typing

from macholib.MachOGraph import MachOGraph

class MachOStandalone:
Expand Down
3 changes: 2 additions & 1 deletion stubs/modulegraph/find_modules.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
""" """
import typing
from .modulegraph import Node, Extension, ModuleGraph

from .modulegraph import Extension, ModuleGraph, Node

PY_SUFFIXES: list[str]
C_SUFFIXES: list[str]
Expand Down

0 comments on commit 170fe08

Please sign in to comment.