Skip to content

Commit 702f208

Browse files
committed
Fix pep8 and apply reviewers corrections
The recent python3's refactoring leads us with some pep8 errors which causes CI tests to fail: - W293: blank line contains whitespace - W291: trailing whitespace - F401: imported but unused Also, in order to keep up to date the reviews, apply most of commented reviews, which are mostly affecting the readability of the source code.
1 parent 701c125 commit 702f208

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pythonforandroid.toolchain import (
22
Bootstrap, shprint, current_directory, info, info_main)
33
from pythonforandroid.util import ensure_dir
4-
from os.path import join, exists
4+
from os.path import join
55
import sh
66

77

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ def make_python_zip():
127127

128128
if not exists('private'):
129129
print('No compiled python is present to zip, skipping.')
130-
print('this should only be the case if you are using'
131-
'the CrystaX python, python2 or python3')
132130
return
133131

134132
global python_files

pythonforandroid/recipe.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ class variable.
10451045
'''The configure arguments needed to build the python recipe. Those are
10461046
used in method :meth:`build_arch` (if not overwritten like python3crystax's
10471047
recipe does).
1048-
1048+
10491049
.. note:: This variable should be properly set in subclass.
10501050
'''
10511051

@@ -1159,12 +1159,10 @@ def prebuild_arch(self, arch):
11591159

11601160
def include_root(self, arch_name):
11611161
'''The root directory from which to include headers.'''
1162-
return join(self.get_build_dir(arch_name),
1163-
'Include')
1162+
return join(self.get_build_dir(arch_name), 'Include')
11641163

11651164
def link_root(self, arch_name):
1166-
return join(self.get_build_dir(arch_name),
1167-
'android-build')
1165+
return join(self.get_build_dir(arch_name), 'android-build')
11681166

11691167
@property
11701168
def major_minor_version_string(self):
@@ -1290,7 +1288,7 @@ class TargetHostPythonRecipe(Recipe):
12901288
'''
12911289

12921290
name = ''
1293-
'''The hostpython's recipe name. This should be ``hostpython2`` or
1291+
'''The hostpython's recipe name. This should be ``hostpython2`` or
12941292
``hostpython3``
12951293
12961294
.. warning:: This must be set in inherited class.'''

pythonforandroid/recipes/sdl2/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ def get_recipe_env(self, arch=None):
2424
env['PYTHON_INCLUDE_ROOT'] = self.ctx.python_recipe.include_root(arch.arch)
2525
env['PYTHON_LINK_ROOT'] = self.ctx.python_recipe.link_root(arch.arch)
2626

27-
if 'python2' in self.ctx.recipe_build_order or \
28-
'python3' in self.ctx.recipe_build_order:
27+
if self.ctx.python_recipe.name in ('python2', 'python3'):
2928
env['EXTRA_LDLIBS'] = ' -lpython{}'.format(
3029
self.ctx.python_recipe.major_minor_version_string)
3130
if 'python3' in self.ctx.recipe_build_order:

0 commit comments

Comments
 (0)