diff --git a/setup.cfg b/setup.cfg index 1ab1dfc75..ccd2f8d25 100644 --- a/setup.cfg +++ b/setup.cfg @@ -72,6 +72,7 @@ virtualenv.create = cpython3-win = virtualenv.create.via_global_ref.builtin.cpython.cpython3:CPython3Windows cpython2-posix = virtualenv.create.via_global_ref.builtin.cpython.cpython2:CPython2Posix cpython2-mac-framework = virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython2macOsFramework + cpython2-mac-arm-framework = virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython2macOsArmFramework cpython3-mac-framework = virtualenv.create.via_global_ref.builtin.cpython.mac_os:CPython3macOsFramework cpython2-win = virtualenv.create.via_global_ref.builtin.cpython.cpython2:CPython2Windows pypy2-posix = virtualenv.create.via_global_ref.builtin.pypy.pypy2:PyPy2Posix diff --git a/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py b/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py index 84bb56875..ca06d83ad 100644 --- a/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py +++ b/src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py @@ -48,8 +48,6 @@ def create(self): exes.extend(self.bin_dir / a for a in src.aliases) for exe in exes: fix_mach_o(str(exe), current, target, self.interpreter.max_size) - if IS_MAC_ARM64: - fix_signature(str(exe)) @classmethod def _executables(cls, interpreter): @@ -105,9 +103,17 @@ def reload_code(self): ) return result + +class CPython2macOsArmFramework(CPython2macOsFramework, CPythonmacOsFramework, CPython2PosixBase): @classmethod - def can_create(cls, interpreter): - return super(CPythonmacOsFramework, cls).can_create(interpreter) + def can_describe(cls, interpreter): + return IS_MAC_ARM64 and super(CPythonmacOsFramework, cls).can_describe(interpreter) + + def create(self): + super(CPython2macOsFramework, self).create() + # re-sign the newly copied/modified python binary + python_exe = os.path.join(str(self.dest), "bin", "python") + fix_signature(python_exe) class CPython3macOsFramework(CPythonmacOsFramework, CPython3, CPythonPosix):