1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 01:22:19 +03:00

setup.py: typing cleanups

* I didn't go looking for darwin 'py2app' docs to find the possible
  return types of py2app.recipes['member']['check'], so 'Any' will have
  to do.

* re.search may return None, which then doesn't have .group(), so mypy
  complains.  Just tell it to ignore that code.
This commit is contained in:
Athanasius 2020-10-08 13:53:24 +01:00
parent db40197f80
commit 1297ba9c0d

View File

@ -16,7 +16,7 @@ import sys
from distutils.core import setup
from os.path import exists, isdir, join
from tempfile import gettempdir
from typing import Set
from typing import Any, Generator, Set
import semantic_version
@ -59,7 +59,8 @@ if sys.platform == 'darwin':
import py2app.build_app
from py2app import recipes
def iter_recipes(module=recipes):
# NB: 'Any' is because I don't have MacOS docs
def iter_recipes(module=recipes) -> Generator[str, Any]:
"""Enumerate recipes via alternate method."""
for name in dir(module):
if name.startswith('_') or name == 'sip':
@ -276,7 +277,7 @@ elif sys.platform == 'win32':
# Seriously, this is how you make Windows Installer use the user's display language for its dialogs. What a crock.
# http://www.geektieguy.com/2010/03/13/create-a-multi-lingual-multi-language-msi-using-wix-and-custom-build-scripts
lcids = [
int(x) for x in re.search(
int(x) for x in re.search( # type: ignore
r'Languages\s*=\s*"(.+?)"',
open(f'{appname}.wxs').read()
).group(1).split(',')