Skip to content

Commit

Permalink
macOS app: update to Python 3.13 framework
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanDunfield committed Nov 25, 2024
1 parent ffc0280 commit 056faf5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 48 deletions.
14 changes: 7 additions & 7 deletions mac_osx_app/__boot__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import re
os.environ["ARGVZERO"] = sys.argv[0]
os.environ["RESOURCEPATH"] = os.path.split(__file__)[0]
PYTHON = 'python3.11'
PYTHON = 'python3.13'

def _reset_sys_path():
# Clear generic sys.path[0]
Expand Down Expand Up @@ -96,12 +96,12 @@ def _setup_ctypes():
_setup_ctypes()


def _boot_tkinter():
import os

resourcepath = os.environ["RESOURCEPATH"]
os.putenv("TCL_LIBRARY", os.path.join(resourcepath, "lib/tcl8"))
os.putenv("TK_LIBRARY", os.path.join(resourcepath, "lib/tk8.6"))
#def _boot_tkinter():
# import os
#
# resourcepath = os.environ["RESOURCEPATH"]
# os.putenv("TCL_LIBRARY", os.path.join(resourcepath, "lib/tcl8"))
# os.putenv("TK_LIBRARY", os.path.join(resourcepath, "lib/tk8.6"))
#_boot_tkinter()


Expand Down
7 changes: 3 additions & 4 deletions mac_osx_app/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
from subprocess import check_call, call, Popen, PIPE
from math import ceil
from check_target import TkChecker
APP_PYTHON = 'python3.11'
PYTHON_ZIP = 'python311.zip'
APP_PYTHON = 'python3.13'
PYTHON_ZIP = 'python313.zip'

# Make sure that we have our frameworks.
if not os.path.exists('Frameworks.tgz'):
print("Please build the frameworks for SnapPy.app first.")
sys.exit(1)

# Disable M1 builds until we can test.
os.environ['_PYTHON_HOST_PLATFORM'] = 'macosx-10.9-universal2'
os.environ['ARCHFLAGS'] = '-arch arm64 -arch x86_64'

Expand Down Expand Up @@ -170,7 +169,7 @@ def do_release(python, dmg_name, freshen=True):
nmd_python_dir = os.environ['HOME'] + '/pkgs/pythons'
if os.path.exists(nmd_python_dir):
print('Using virtualenv Pythons')
python3 = nmd_python_dir + '/py311/bin/python'
python3 = nmd_python_dir + '/py313/bin/python'
else:
python3 = APP_PYTHON
freshen = '--no-freshen' not in sys.argv
Expand Down
44 changes: 7 additions & 37 deletions mac_osx_app/setup.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
"""
This is a setup.py script generated by py2applet
Usage:
python setup.py py2app
Building everything from scratch:
Download and install Python 2.6.2 binary installer : http://www.python.org/download/releases/2.6.2/
Download and install Tcl/Tk 8.5 binaries : http://www.activestate.com/activetcl/
Download Python 2.6.2 source : http://www.python.org/download/releases/2.6.2/
tar xjf Python-2.6.2.tar.bz2
cd Python-2.6.2
./configure --enable-framework --enable-universalsdk
make
cp build/lib.macosx-10.3-fat-2.6/_tkinter.so /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/
python ~/work/bin/ez_setup.py
cd ~/work/plink; python setup.py install
python -m easy_install ipython
python -m easy_install py2app
sudo touch /Library/Frameworks/Python.framework/Versions/2.6/Resources/version.plist
python -m easy_install mercurial
python -m easy_install sphinx
python -m easy_install pyx==0.12.1
....
Note for 8.4.19 one needs to rebuild libToGL.
For 8.5.7....
"""

from setuptools import setup, Command
import os, sys, glob, plistlib
from py2app import __version__ as py2app_version
import py2app.util

def codesign_adhoc(bundle):
print('Monkey patching py2app to prevent codesigning, since we do this ourselves at the end')
py2app.util.codesign_adhoc = codesign_adhoc

from snappy.version import version as SnapPy_version
try:
import pyx
except ImportError:
raise ValueError('Please install PyX. (For python 2.7 use version 0.12.1.)')
raise ValueError('Please install PyX.')

class clean(Command):
user_options = []
Expand Down

0 comments on commit 056faf5

Please sign in to comment.