Skip to content

Python 391 support #2392

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected static ArrayList<String> getLibraries(File libsDir) {
libsList.add("python3.6m");
libsList.add("python3.7m");
libsList.add("python3.8");
libsList.add("python3.9");
libsList.add("main");
return libsList;
}
Expand All @@ -63,7 +64,7 @@ public static void loadLibraries(File filesDir, File libsDir) {
// load, and it has failed, give a more
// general error
Log.v(TAG, "Library loading error: " + e.getMessage());
if (lib.startsWith("python3.8") && !foundPython) {
if (lib.startsWith("python3.9") && !foundPython) {
throw new RuntimeException("Could not load any libpythonXXX.so");
} else if (lib.startsWith("python")) {
continue;
Expand Down
22 changes: 10 additions & 12 deletions pythonforandroid/recipes/python3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import glob
import sh
import subprocess

from multiprocessing import cpu_count
from os import environ
from os.path import dirname, exists, join
from pathlib import Path
from shutil import copy2

from pythonforandroid.logger import info, warning, shprint
import sh
from pythonforandroid.logger import info, shprint, warning
from pythonforandroid.patching import version_starts_with
from pythonforandroid.recipe import Recipe, TargetPythonRecipe
from pythonforandroid.util import (
current_directory,
ensure_dir,
walk_valid_filens,
BuildInterruptingException,
)
from pythonforandroid.util import (BuildInterruptingException,
current_directory, ensure_dir,
walk_valid_filens)

NDK_API_LOWER_THAN_SUPPORTED_MESSAGE = (
'Target ndk-api is {ndk_api}, '
Expand Down Expand Up @@ -67,14 +63,16 @@ class Python3Recipe(TargetPythonRecipe):
('patches/py3.7.1_fix-ctypes-util-find-library.patch', version_starts_with("3.7")),
('patches/py3.7.1_fix-zlib-version.patch', version_starts_with("3.7")),

# Python 3.8.1
('patches/py3.8.1.patch', version_starts_with("3.8"))
# Python 3.8.1 and Python 3.9.1
('patches/py3.8_3.9.patch', version_starts_with("3.8")),
('patches/py3.8_3.9.patch', version_starts_with("3.9"))
]

if sh.which('lld') is not None:
patches = patches + [
("patches/py3.7.1_fix_cortex_a8.patch", version_starts_with("3.7")),
("patches/py3.8.1_fix_cortex_a8.patch", version_starts_with("3.8"))
("patches/py3.8_3.9_fix_cortex_a8.patch", version_starts_with("3.8")),
("patches/py3.8_3.9_fix_cortex_a8.patch", version_starts_with("3.9"))
]

depends = ['hostpython3', 'sqlite3', 'openssl', 'libffi']
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/recipes/setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class SetuptoolsRecipe(PythonRecipe):
version = '49.2.1'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.zip'
url = 'https://pypi.python.org/packages/source/s/setuptools/setuptools-{version}.tar.gz'
call_hostpython_via_targetpython = False
install_in_hostpython = True

Expand Down