Skip to content

Commit 0fef037

Browse files
authored
Merge pull request kivy#1674 from AndreMiras/feature/tox_update_and_linter_fixes
tox update and linter fixes
2 parents 1e49255 + b54a1d0 commit 0fef037

File tree

12 files changed

+23
-29
lines changed

12 files changed

+23
-29
lines changed

ci/constants.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class TargetPython(Enum):
3939
'protobuf_cpp',
4040
'xeddsa',
4141
'x3dh',
42+
# fatal error: crypt.h: No such file or directory
43+
'pyleveldb',
4244
'pynacl',
4345
'doubleratchet',
4446
'omemo',
@@ -77,6 +79,8 @@ class TargetPython(Enum):
7779
# requires `libpq-dev` system dependency e.g. for `pg_config` binary
7880
'psycopg2',
7981
'netifaces',
82+
# fatal error: crypt.h: No such file or directory
83+
'pyleveldb',
8084
'protobuf_cpp',
8185
# most likely some setup in the Docker container, because it works in host
8286
'pyjnius', 'pyopenal',

ci/rebuild_updated_recipes.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,12 @@ def build(target_python, requirements):
6363
requirements = ','.join(requirements)
6464
logger.info('requirements: {}'.format(requirements))
6565
with current_directory('testapps/'):
66-
try:
67-
# iterates to stream the output
68-
for line in sh.python(
69-
testapp, 'apk', '--sdk-dir', android_sdk_home,
70-
'--ndk-dir', android_ndk_home, '--bootstrap', 'sdl2', '--requirements',
71-
requirements, _err_to_out=True, _iter=True):
72-
print(line)
73-
except sh.ErrorReturnCode as e:
74-
raise
66+
# iterates to stream the output
67+
for line in sh.python(
68+
testapp, 'apk', '--sdk-dir', android_sdk_home,
69+
'--ndk-dir', android_ndk_home, '--bootstrap', 'sdl2', '--requirements',
70+
requirements, _err_to_out=True, _iter=True):
71+
print(line)
7572

7673

7774
def main():

pythonforandroid/bootstraps/common/build/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def make_package(args):
426426
target = fileh.read().strip()
427427
android_api = target.split('-')[1]
428428
try:
429-
android_api_int_test = int(android_api)
429+
int(android_api)
430430
except (ValueError, TypeError):
431431
raise ValueError(
432432
"failed to extract the Android API level from " +

pythonforandroid/bootstraps/pygame/build/buildlib/argparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ def _check_conflict(self, action):
14681468
def _handle_conflict_error(self, action, conflicting_actions):
14691469
message = _('conflicting option string(s): %s')
14701470
conflict_string = ', '.join([option_string
1471-
for option_string, action
1471+
for option_string, action # noqa F812
14721472
in conflicting_actions])
14731473
raise ArgumentError(action, message % conflict_string)
14741474

@@ -2071,7 +2071,7 @@ def _parse_optional(self, arg_string):
20712071
# if multiple actions match, the option string was ambiguous
20722072
if len(option_tuples) > 1:
20732073
options = ', '.join(
2074-
[option_string for action, option_string, explicit_arg in option_tuples])
2074+
[option_string for action, option_string, explicit_arg in option_tuples]) # noqa F812
20752075
tup = arg_string, options
20762076
self.error(_('ambiguous option: %s could match %s') % tup)
20772077

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ def run_distribute(self):
1414
info_main("# Creating Android project ({})".format(self.name))
1515

1616
arch = self.ctx.archs[0]
17-
python_install_dir = self.ctx.get_python_install_dir()
18-
from_crystax = self.ctx.python_recipe.from_crystax
1917

2018
if len(self.ctx.archs) > 1:
2119
raise ValueError("SDL2/gradle support only one arch")

pythonforandroid/build.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ def not_has_package(self, name, arch=None):
528528

529529
def build_recipes(build_order, python_modules, ctx):
530530
# Put recipes in correct build order
531-
bs = ctx.bootstrap
532531
info_notify("Recipe build order is {}".format(build_order))
533532
if python_modules:
534533
python_modules = sorted(set(python_modules))

pythonforandroid/distribution.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def get_distribution(cls, ctx, name=None, recipes=[],
7979

8080
existing_dists = Distribution.get_distributions(ctx)
8181

82-
needs_build = True # whether the dist needs building, will be returned
83-
8482
possible_dists = existing_dists
8583

8684
name_match_dist = None

pythonforandroid/python.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def build_arch(self, arch):
421421
shprint(sh.cp, join('Modules', 'Setup.dist'),
422422
join(build_dir, 'Modules', 'Setup'))
423423

424-
result = shprint(sh.make, '-j', str(cpu_count()), '-C', build_dir)
424+
shprint(sh.make, '-j', str(cpu_count()), '-C', build_dir)
425425
else:
426426
info('Skipping {name} ({version}) build, as it has already '
427427
'been completed'.format(name=self.name, version=self.version))

pythonforandroid/recipes/pygame/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def build_arch(self, arch):
6868
shprint(sh.find, build_lib[0], '-name', '*.o', '-exec',
6969
env['STRIP'], '{}', ';')
7070

71-
python_install_path = join(self.ctx.build_dir, 'python-install')
7271
warning('Should remove pygame tests etc. here, but skipping for now')
7372

7473

pythonforandroid/recipes/pyleveldb/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class PyLevelDBRecipe(CompiledComponentsPythonRecipe):
1212
site_packages_name = 'leveldb'
1313

1414
def build_arch(self, arch):
15-
env = self.get_recipe_env(arch)
1615
with current_directory(self.get_build_dir(arch.arch)):
1716
# Remove source in this pypi package
1817
sh.rm('-rf', 'leveldb', 'leveldb.egg-info', 'snappy')

pythonforandroid/toolchain.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def add_parser(subparsers, *args, **kwargs):
361361
kwargs.pop('aliases')
362362
return subparsers.add_parser(*args, **kwargs)
363363

364-
parser_recommendations = add_parser(
364+
add_parser(
365365
subparsers,
366366
'recommendations',
367367
parents=[generic_parser],
@@ -470,20 +470,20 @@ def add_parser(subparsers, *args, **kwargs):
470470
'--signkeypw', dest='signkeypw', action='store', default=None,
471471
help='Password for key alias')
472472

473-
parser_create = add_parser(
473+
add_parser(
474474
subparsers,
475475
'create', help='Compile a set of requirements into a dist',
476476
parents=[generic_parser])
477-
parser_archs = add_parser(
477+
add_parser(
478478
subparsers,
479479
'archs', help='List the available target architectures',
480480
parents=[generic_parser])
481-
parser_distributions = add_parser(
481+
add_parser(
482482
subparsers,
483483
'distributions', aliases=['dists'],
484484
help='List the currently available (compiled) dists',
485485
parents=[generic_parser])
486-
parser_delete_dist = add_parser(
486+
add_parser(
487487
subparsers,
488488
'delete_dist', aliases=['delete-dist'], help='Delete a compiled dist',
489489
parents=[generic_parser])
@@ -496,15 +496,15 @@ def add_parser(subparsers, *args, **kwargs):
496496
parser_sdk_tools.add_argument(
497497
'tool', help='The binary tool name to run')
498498

499-
parser_adb = add_parser(
499+
add_parser(
500500
subparsers,
501501
'adb', help='Run adb from the given SDK',
502502
parents=[generic_parser])
503-
parser_logcat = add_parser(
503+
add_parser(
504504
subparsers,
505505
'logcat', help='Run logcat from the given SDK',
506506
parents=[generic_parser])
507-
parser_build_status = add_parser(
507+
add_parser(
508508
subparsers,
509509
'build_status', aliases=['build-status'],
510510
help='Print some debug information about current built components',

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ ignore =
1919
E123, E124, E126,
2020
E226,
2121
E402, E501,
22-
F841, W503,
22+
W503,
2323
W504

0 commit comments

Comments
 (0)