diff --git a/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java b/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java index 065f43c3bd..9e19a6327d 100644 --- a/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java +++ b/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java @@ -51,7 +51,7 @@ protected static ArrayList getLibraries(File libsDir) { addLibraryIfExists(libsList, name, libsDir); } - for (int v = 5; v <= 14; v++) { + for (int v = 14; v >= 5; v--) { libsList.add("python3." + v + (v <= 7 ? "m" : "")); } diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index 8808ffc0d2..dd2b3b3552 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -1020,18 +1020,11 @@ def install_python_package(self, arch, name=None, env=None, is_dir=True): hostpython = sh.Command(self.hostpython_location) hpenv = env.copy() with current_directory(self.get_build_dir(arch.arch)): - - if isfile("setup.py"): - shprint(hostpython, 'setup.py', 'install', '-O2', - '--root={}'.format(self.ctx.get_python_install_dir(arch.arch)), - '--install-lib=.', - _env=hpenv, *self.setup_extra_args) - - # If asked, also install in the hostpython build dir - if self.install_in_hostpython: - self.install_hostpython_package(arch) - else: - warning("`PythonRecipe.install_python_package` called without `setup.py` file!") + shprint(hostpython, '-m', 'pip', 'install', '.', + '--compile', + f'--root={self.ctx.get_python_install_dir(arch.arch)}', + _env=hpenv, *self.setup_extra_args + ) def get_hostrecipe_env(self, arch=None): env = environ.copy() @@ -1048,7 +1041,8 @@ def hostpython_site_dir(self): def install_hostpython_package(self, arch): env = self.get_hostrecipe_env(arch) real_hostpython = sh.Command(self.real_hostpython_location) - shprint(real_hostpython, 'setup.py', 'install', '-O2', + shprint(real_hostpython, '-m', 'pip', 'install', '.', + '--compile', '--install-lib=Lib/site-packages', '--root={}'.format(self._host_recipe.site_root), _env=env, *self.setup_extra_args) @@ -1095,7 +1089,7 @@ class CompiledComponentsPythonRecipe(PythonRecipe): def build_arch(self, arch): '''Build any cython components, then install the Python module by - calling setup.py install with the target Python dir. + calling pip install with the target Python dir. ''' Recipe.build_arch(self, arch) self.install_hostpython_prerequisites() @@ -1144,7 +1138,7 @@ class CythonRecipe(PythonRecipe): def build_arch(self, arch): '''Build any cython components, then install the Python module by - calling setup.py install with the target Python dir. + calling pip install with the target Python dir. ''' Recipe.build_arch(self, arch) self.build_cython_components(arch) diff --git a/pythonforandroid/recipes/hostpython3/__init__.py b/pythonforandroid/recipes/hostpython3/__init__.py index 094660fada..afc4df4955 100644 --- a/pythonforandroid/recipes/hostpython3/__init__.py +++ b/pythonforandroid/recipes/hostpython3/__init__.py @@ -36,7 +36,7 @@ class HostPython3Recipe(Recipe): :class:`~pythonforandroid.python.HostPythonRecipe` ''' - version = '3.11.13' + version = '3.14.0' url = 'https://github.com/python/cpython/archive/refs/tags/v{version}.tar.gz' '''The default url to download our host python recipe. This url will diff --git a/pythonforandroid/recipes/python3/__init__.py b/pythonforandroid/recipes/python3/__init__.py index 81aee7c66e..4c234ce8f4 100644 --- a/pythonforandroid/recipes/python3/__init__.py +++ b/pythonforandroid/recipes/python3/__init__.py @@ -54,7 +54,7 @@ class Python3Recipe(TargetPythonRecipe): :class:`~pythonforandroid.python.GuestPythonRecipe` ''' - version = '3.11.13' + version = '3.14.0' _p_version = Version(version) url = 'https://github.com/python/cpython/archive/refs/tags/v{version}.tar.gz' name = 'python3' @@ -389,17 +389,12 @@ def create_python_bundle(self, dirn, arch): place. """ # Todo: find a better way to find the build libs folder - modules_build_dir = join( + modules_build_dir = glob.glob(join( self.get_build_dir(arch.arch), 'android-build', 'build', - 'lib.{}{}-{}-{}'.format( - # android is now supported platform - "android" if self._p_version.minor >= 13 else "linux", - '2' if self.version[0] == '2' else '', - arch.command_prefix.split('-')[0], - self.major_minor_version_string - )) + 'lib.*' + ))[0] # Compile to *.pyc the python modules self.compile_python_files(modules_build_dir) diff --git a/pythonforandroid/recipes/six/__init__.py b/pythonforandroid/recipes/six/__init__.py deleted file mode 100644 index 3be8ce7578..0000000000 --- a/pythonforandroid/recipes/six/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -from pythonforandroid.recipe import PythonRecipe - - -class SixRecipe(PythonRecipe): - version = '1.15.0' - url = 'https://pypi.python.org/packages/source/s/six/six-{version}.tar.gz' - depends = ['setuptools'] - - -recipe = SixRecipe()