Skip to content

Commit

Permalink
create a CPython2macOsArmFramework class
Browse files Browse the repository at this point in the history
  • Loading branch information
tmspicer authored and gaborbernat committed Dec 28, 2021
1 parent c8568fc commit 8074a00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 10 additions & 4 deletions src/virtualenv/create/via_global_ref/builtin/cpython/mac_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8074a00

Please sign in to comment.