forked from pool/python-cx_Freeze
* Python 3.13 support. * Python 3.13 free-threaded support for Linux and macOS. * Download and extract the MSVC Redistributable files. * Implement bases using PEP587 - Python Initialization Configuration. * Drop Python 3.8 support. * New and Improved hooks. * Bug fixes and improvements. - Add patch use-only-console-on-python-313.patch: * Only build legacy console for Python 3.12 and earlier. - Stop skipping Python 3.13, it's supported upstream. - Normalize metadata directory name. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cx_Freeze?expand=0&rev=38
87 lines
2.6 KiB
Diff
87 lines
2.6 KiB
Diff
From 4d1325fedc01defcc5053672fc8eeb47ef81db57 Mon Sep 17 00:00:00 2001
|
|
From: Marcelo Duarte <marcelotduarte@users.noreply.github.com>
|
|
Date: Fri, 21 Mar 2025 18:27:46 -0300
|
|
Subject: [PATCH] fix: use only console based on PEP587 on Python 3.13
|
|
|
|
---
|
|
cx_Freeze/executable.py | 11 +++--------
|
|
setup.py | 6 +-----
|
|
tests/test_executables.py | 8 +-------
|
|
3 files changed, 5 insertions(+), 20 deletions(-)
|
|
|
|
diff --git a/cx_Freeze/executable.py b/cx_Freeze/executable.py
|
|
index b19b50555..56cc0f041 100644
|
|
--- a/cx_Freeze/executable.py
|
|
+++ b/cx_Freeze/executable.py
|
|
@@ -11,7 +11,6 @@
|
|
from typing import TYPE_CHECKING
|
|
|
|
from cx_Freeze._compat import (
|
|
- ABI_THREAD,
|
|
EXE_SUFFIX,
|
|
IS_MACOS,
|
|
IS_MINGW,
|
|
@@ -75,14 +74,10 @@ def base(self) -> Path:
|
|
|
|
@base.setter
|
|
def base(self, name: str | Path | None) -> None:
|
|
- # The default base is the legacy console, except for Python 3.13t and
|
|
- # Python 3.13 on macOS, that supports only the new console
|
|
+ # The default base is the legacy console, except for
|
|
+ # Python 3.13, that supports only the new console
|
|
version = sys.version_info[:2]
|
|
- if (
|
|
- version <= (3, 13)
|
|
- and ABI_THREAD == ""
|
|
- and not (IS_MACOS and version == (3, 13))
|
|
- ):
|
|
+ if version < (3, 13):
|
|
name = name or "console_legacy"
|
|
else:
|
|
name = name or "console"
|
|
diff --git a/setup.py b/setup.py
|
|
index 7185a255a..8278a42f4 100644
|
|
--- a/setup.py
|
|
+++ b/setup.py
|
|
@@ -285,11 +285,7 @@ def get_extensions() -> list[Extension]:
|
|
optional=optional,
|
|
)
|
|
]
|
|
- if (
|
|
- version <= (3, 13)
|
|
- and abi_thread == ""
|
|
- and not (IS_MACOS and version == (3, 13))
|
|
- ):
|
|
+ if version < (3, 13):
|
|
extensions += [
|
|
Extension(
|
|
"cx_Freeze.bases.console_legacy",
|
|
diff --git a/tests/test_executables.py b/tests/test_executables.py
|
|
index cdba2c9de..7e95bf161 100644
|
|
--- a/tests/test_executables.py
|
|
+++ b/tests/test_executables.py
|
|
@@ -12,10 +12,8 @@
|
|
|
|
from cx_Freeze import Executable
|
|
from cx_Freeze._compat import (
|
|
- ABI_THREAD,
|
|
BUILD_EXE_DIR,
|
|
EXE_SUFFIX,
|
|
- IS_MACOS,
|
|
IS_MINGW,
|
|
IS_WINDOWS,
|
|
)
|
|
@@ -242,11 +240,7 @@ def test_executables(
|
|
("icon.ico", "icon.icns", "icon.png", "icon.svg"),
|
|
),
|
|
]
|
|
-if (
|
|
- sys.version_info[:2] <= (3, 13)
|
|
- and ABI_THREAD == ""
|
|
- and not (IS_MACOS and sys.version_info[:2] == (3, 13))
|
|
-):
|
|
+if sys.version_info[:2] < (3, 13):
|
|
TEST_VALID_PARAMETERS += [
|
|
("base", None, "console_legacy-"),
|
|
("base", "console_legacy", "console_legacy-"),
|