@@ -1268,7 +1268,7 @@ def get_pip_install_args(self, arch):
12681268 "--no-deps" ,
12691269 ]
12701270 # add platform tags
1271- tags = self . get_wheel_platform_tag (arch .arch )
1271+ tags = PyProjectRecipe . get_wheel_platform_tags (arch .arch , self . ctx )
12721272 for tag in tags :
12731273 opts .append (f"--platform={ tag } " )
12741274
@@ -1297,7 +1297,8 @@ def check_prebuilt(self, arch, msg=""):
12971297 if msg != "" :
12981298 info (f"Prebuilt pip wheel found, { msg } " )
12991299 return True
1300- return
1300+
1301+ return False
13011302
13021303 def get_recipe_env (self , arch , ** kwargs ):
13031304 # Custom hostpython
@@ -1310,16 +1311,15 @@ def get_recipe_env(self, arch, **kwargs):
13101311
13111312 with open (build_opts , "w" ) as file :
13121313 file .write ("[bdist_wheel]\n plat_name={}" .format (
1313- self .get_wheel_platform_tag (arch .arch )[ 0 ]
1314+ self .get_wheel_platform_tag (arch .arch )
13141315 ))
13151316 file .close ()
13161317
13171318 env ["DIST_EXTRA_CONFIG" ] = build_opts
13181319 return env
13191320
1320- def get_wheel_platform_tag (self , arch , ctx = None ):
1321- if ctx is None :
1322- ctx = self .ctx
1321+ @staticmethod
1322+ def get_wheel_platform_tags (arch , ctx ):
13231323 # https://peps.python.org/pep-0738/#packaging
13241324 # official python only supports 64 bit:
13251325 # android_21_arm64_v8a
@@ -1332,6 +1332,9 @@ def get_wheel_platform_tag(self, arch, ctx=None):
13321332 }[arch ]
13331333 return [f"android_{ ctx .ndk_api } _" + _ for _ in _suffix ]
13341334
1335+ def get_wheel_platform_tag (self , arch ):
1336+ return PyProjectRecipe .get_wheel_platform_tags (arch , self .ctx )[0 ]
1337+
13351338 def install_prebuilt_wheel (self , arch ):
13361339 info ("Installing prebuilt built wheel" )
13371340 destination = self .ctx .get_python_install_dir (arch .arch )
@@ -1354,10 +1357,14 @@ def install_wheel(self, arch, built_wheels):
13541357 # Fix wheel platform tag
13551358 wheel_tag = wheel_tags (
13561359 _wheel ,
1357- platform_tags = self .get_wheel_platform_tag (arch .arch )[ 0 ] ,
1360+ platform_tags = self .get_wheel_platform_tag (arch .arch ),
13581361 remove = True ,
13591362 )
13601363 selected_wheel = join (built_wheel_dir , wheel_tag )
1364+ _dev_wheel_dir = environ .get ("P4A_WHEEL_DIR" , False )
1365+ if _dev_wheel_dir :
1366+ ensure_dir (_dev_wheel_dir )
1367+ shprint (sh .cp , selected_wheel , _dev_wheel_dir )
13611368
13621369 if exists (self .ctx .save_wheel_dir ):
13631370 shprint (sh .cp , selected_wheel , self .ctx .save_wheel_dir )
@@ -1370,7 +1377,7 @@ def install_wheel(self, arch, built_wheels):
13701377 wf .close ()
13711378
13721379 def build_arch (self , arch ):
1373- if self .check_prebuilt (arch , "skipping build_arch" ) is not None :
1380+ if self .check_prebuilt (arch , "skipping build_arch" ):
13741381 result = self .install_prebuilt_wheel (arch )
13751382 if result :
13761383 return
0 commit comments