Skip to content

Commit be650bc

Browse files
authored
Linter fixes (kivy#2874)
The errors were: ``` pythonforandroid/bootstrap.py:136:5: F811 redefinition of unused 'name' from line 73 pythonforandroid/build.py:111:5: F811 redefinition of unused 'libs_dir' from line 82 pythonforandroid/build.py:127:5: F811 redefinition of unused 'aars_dir' from line 83 pythonforandroid/graph.py:48:12: E721 do not compare types, for exact checks use `is` pythonforandroid/graph.py:163:20: E721 do not compare types, for exact checks use `is` tests/test_build.py:39:41: E231 missing whitespace after ',' tests/test_build.py:40:58: E231 missing whitespace after ',' tests/test_build.py:41:61: E231 missing whitespace after ',' tests/test_build.py:42:71: E231 missing whitespace after ',' ```
1 parent 7a0c935 commit be650bc

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

pythonforandroid/bootstrap.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ class Bootstrap:
7070
'''An Android project template, containing recipe stuff for
7171
compilation and templated fields for APK info.
7272
'''
73-
name = ''
7473
jni_subdir = '/jni'
7574
ctx = None
7675

pythonforandroid/build.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ class Context:
7777
# the Android project folder where everything ends up
7878
dist_dir = None
7979

80-
# where Android libs are cached after build
81-
# but before being placed in dists
82-
libs_dir = None
83-
aars_dir = None
84-
8580
# Whether setup.py or similar should be used if present:
8681
use_setup_py = False
8782

@@ -109,6 +104,10 @@ def templates_dir(self):
109104

110105
@property
111106
def libs_dir(self):
107+
"""
108+
where Android libs are cached after build
109+
but before being placed in dists
110+
"""
112111
# Was previously hardcoded as self.build_dir/libs
113112
directory = join(self.build_dir, 'libs_collections',
114113
self.bootstrap.distribution.name)

pythonforandroid/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def get_dependency_tuple_list_for_recipe(recipe, blacklist=None):
4545
"""
4646
if blacklist is None:
4747
blacklist = set()
48-
assert type(blacklist) == set
48+
assert type(blacklist) is set
4949
if recipe.depends is None:
5050
dependencies = []
5151
else:
@@ -160,7 +160,7 @@ def obvious_conflict_checker(ctx, name_tuples, blacklist=None):
160160
current_to_be_added = list(to_be_added)
161161
to_be_added = []
162162
for (added_tuple, adding_recipe) in current_to_be_added:
163-
assert type(added_tuple) == tuple
163+
assert type(added_tuple) is tuple
164164
if len(added_tuple) > 1:
165165
# No obvious commitment in what to add, don't check it itself
166166
# but throw it into deps for later comparing against

tests/test_build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def test_strip_if_with_debug_symbols(self):
3636
modules = ["mymodule"]
3737
project_dir = None
3838
with mock.patch('pythonforandroid.build.info'), \
39-
mock.patch('sh.Command'),\
40-
mock.patch('pythonforandroid.build.open'),\
41-
mock.patch('pythonforandroid.build.shprint'),\
42-
mock.patch('pythonforandroid.build.current_directory'),\
39+
mock.patch('sh.Command'), \
40+
mock.patch('pythonforandroid.build.open'), \
41+
mock.patch('pythonforandroid.build.shprint'), \
42+
mock.patch('pythonforandroid.build.current_directory'), \
4343
mock.patch('pythonforandroid.build.CythonRecipe') as m_CythonRecipe, \
4444
mock.patch('pythonforandroid.build.project_has_setup_py') as m_project_has_setup_py, \
4545
mock.patch('pythonforandroid.build.run_setuppy_install'):

0 commit comments

Comments
 (0)