Skip to content
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

Upgrade to Python 3.12.6 #941

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions kivy_ios/recipes/hostpython3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@


class Hostpython3Recipe(HostRecipe):
version = "3.11.6"
version = "3.12.6"
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz"
depends = ["hostopenssl"]
optional_depends = []
build_subdir = 'native-build'

def init_with_ctx(self, ctx):
super().init_with_ctx(ctx)
self.set_hostpython(self, "3.11")
self.ctx.so_suffix = ".cpython-311m-darwin.so"
self.set_hostpython(self, "3.12")
self.ctx.so_suffix = ".cpython-312m-darwin.so"
self.ctx.hostpython = join(self.ctx.dist_dir, "hostpython3", "bin", "python")
self.ctx.hostpgen = join(self.ctx.dist_dir, "hostpython3", "bin", "pgen")
logger.info("Global: hostpython located at {}".format(self.ctx.hostpython))
Expand Down Expand Up @@ -100,7 +100,7 @@ def install(self):
self.ctx.dist_dir,
"hostpython3",
"lib",
"python3.11",
"python3.12",
"site-packages",
"setuptools",
),
Expand Down
22 changes: 11 additions & 11 deletions kivy_ios/recipes/python3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@


class Python3Recipe(Recipe):
version = "3.11.6"
version = "3.12.6"
url = "https://www.python.org/ftp/python/{version}/Python-{version}.tgz"
depends = ["hostpython3", "libffi", "openssl"]
library = "libpython3.11.a"
library = "libpython3.12.a"
pbx_libraries = ["libz", "libbz2", "libsqlite3"]

def init_with_ctx(self, ctx):
super().init_with_ctx(ctx)
self.set_python(self, "3.11")
ctx.python_ver_dir = "python3.11"
self.set_python(self, "3.12")
ctx.python_ver_dir = "python3.12"
ctx.python_prefix = join(ctx.dist_dir, "root", "python3")
ctx.site_packages_dir = join(
ctx.python_prefix, "lib", ctx.python_ver_dir, "site-packages")
Expand Down Expand Up @@ -135,9 +135,9 @@ def reduce_python(self):
# platform binaries and configuration
with cd(join(
self.ctx.dist_dir, "root", "python3", "lib",
"python3.11", "config-3.11-darwin")):
"python3.12", "config-3.12-darwin")):
sh.rm(
"libpython3.11.a",
"libpython3.12.a",
"python.o",
"config.c.in",
"makesetup",
Expand All @@ -146,11 +146,11 @@ def reduce_python(self):

# cleanup pkgconfig and compiled lib
with cd(join(self.ctx.dist_dir, "root", "python3", "lib")):
sh.rm("-rf", "pkgconfig", "libpython3.11.a")
sh.rm("-rf", "pkgconfig", "libpython3.12.a")

# cleanup python libraries
with cd(join(
self.ctx.dist_dir, "root", "python3", "lib", "python3.11")):
self.ctx.dist_dir, "root", "python3", "lib", "python3.12")):
sh.rm("-rf", "wsgiref", "curses", "idlelib", "lib2to3",
"ensurepip", "turtledemo", "lib-dynload", "venv",
"pydoc_data")
Expand All @@ -171,12 +171,12 @@ def reduce_python(self):
sh.find(".", "-name", "__pycache__", "-type", "d", "-delete")

# create the lib zip
logger.info("Create a python3.11.zip")
sh.mv("config-3.11-darwin", "..")
logger.info("Create a python3.12.zip")
sh.mv("config-3.12-darwin", "..")
sh.mv("site-packages", "..")
sh.zip("-r", "../python311.zip", sh.glob("*"))
sh.rm("-rf", sh.glob("*"))
sh.mv("../config-3.11-darwin", ".")
sh.mv("../config-3.12-darwin", ".")
sh.mv("../site-packages", ".")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
NSString *python_home = [NSString stringWithFormat:@"PYTHONHOME=%@", resourcePath, nil];
putenv((char *)[python_home UTF8String]);

NSString *python_path = [NSString stringWithFormat:@"PYTHONPATH=%@:%@/lib/python3.11/:%@/lib/python3.11/site-packages:.", resourcePath, resourcePath, resourcePath, nil];
NSString *python_path = [NSString stringWithFormat:@"PYTHONPATH=%@:%@/lib/python3.12/:%@/lib/python3.12/site-packages:.", resourcePath, resourcePath, resourcePath, nil];
putenv((char *)[python_path UTF8String]);

NSString *tmp_path = [NSString stringWithFormat:@"TMP=%@/tmp", resourcePath, nil];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
"{{ cookiecutter.dist_dir }}/root/python3/include/python3.11/**",
"{{ cookiecutter.dist_dir }}/root/python3/include/python3.12/**",
"{{ cookiecutter.dist_dir }}/include/common/sdl2",
);
INFOPLIST_FILE = "{{ cookiecutter.project_name }}-Info.plist";
Expand Down Expand Up @@ -288,7 +288,7 @@
GCC_PREFIX_HEADER = "";
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = (
"{{ cookiecutter.dist_dir }}/root/python3/include/python3.11/**",
"{{ cookiecutter.dist_dir }}/root/python3/include/python3.12/**",
"{{ cookiecutter.dist_dir }}/include/common/sdl2",
);
INFOPLIST_FILE = "{{ cookiecutter.project_name }}-Info.plist";
Expand Down
Loading