1- from pythonforandroid .recipe import CompiledComponentsPythonRecipe
1+ from pythonforandroid .recipe import CompiledComponentsPythonRecipe , Recipe
22from pythonforandroid .logger import shprint , info
33from pythonforandroid .util import current_directory
44from multiprocessing import cpu_count
@@ -13,7 +13,11 @@ class NumpyRecipe(CompiledComponentsPythonRecipe):
1313 version = '1.22.3'
1414 url = 'https://pypi.python.org/packages/source/n/numpy/numpy-{version}.zip'
1515 site_packages_name = 'numpy'
16- depends = ['setuptools' , 'cython' ]
16+ depends = ["cython" ]
17+
18+ # This build specifically requires setuptools version 59.2.0
19+ hostpython_prerequisites = ["setuptools==59.2.0" ]
20+
1721 install_in_hostpython = True
1822 call_hostpython_via_targetpython = False
1923
@@ -36,6 +40,16 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
3640
3741 return env
3842
43+ def build_arch (self , arch ):
44+ self .install_hostpython_prerequisites ()
45+ super ().build_arch (arch )
46+
47+ # Post build step to restore setuptools version
48+ self .hostpython_prerequisites = ["setuptools=={}" .format (
49+ Recipe .get_recipe ("setuptools" , self .ctx ).version )
50+ ]
51+ self .install_hostpython_prerequisites ()
52+
3953 def _build_compiled_components (self , arch ):
4054 info ('Building compiled components in {}' .format (self .name ))
4155
0 commit comments