diff --git a/PlotDevice.xcodeproj/project.pbxproj b/PlotDevice.xcodeproj/project.pbxproj index ba4bca4..1464ae4 100644 --- a/PlotDevice.xcodeproj/project.pbxproj +++ b/PlotDevice.xcodeproj/project.pbxproj @@ -607,7 +607,7 @@ INFOPLIST_FILE = app/info.plist; INSTALL_PATH = /Applications; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../Frameworks/Python.framework"; - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; ONLY_ACTIVE_ARCH = NO; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = io.plotdevice.PlotDevice; @@ -625,6 +625,7 @@ CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; CONFIGURATION_BUILD_DIR = dist; + COPY_PHASE_STRIP = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_HARDENED_RUNTIME = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -637,7 +638,7 @@ INFOPLIST_FILE = app/info.plist; INSTALL_PATH = /Applications; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../Frameworks/Python.framework"; - MACOSX_DEPLOYMENT_TARGET = 11.0; + MACOSX_DEPLOYMENT_TARGET = 10.13; OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = io.plotdevice.PlotDevice; PRODUCT_NAME = PlotDevice; diff --git a/app/python.xcconfig b/app/python.xcconfig index 697f55d..868ff60 100644 --- a/app/python.xcconfig +++ b/app/python.xcconfig @@ -1,7 +1,7 @@ // Generated by deps/frameworks/config.py PYTHON_FRAMEWORK = $(PROJECT_DIR)/deps/frameworks/Python.framework -PYTHON = $(PYTHON_FRAMEWORK)/Versions/3.11/bin/python3 -LIBRARY_SEARCH_PATHS = $(inherited) $(PYTHON_FRAMEWORK)/Versions/3.11/lib/python3.11/config-3.11-darwin -HEADER_SEARCH_PATHS = $(inherited) $(PYTHON_FRAMEWORK)/Versions/3.11/include/python3.11 -OTHER_LDFLAGS = $(inherited) -lpython3.11 +PYTHON = $(PYTHON_FRAMEWORK)/Versions/3.13/bin/python3 +LIBRARY_SEARCH_PATHS = $(inherited) $(PYTHON_FRAMEWORK)/Versions/3.13/lib/python3.13/config-3.13-darwin +HEADER_SEARCH_PATHS = $(inherited) $(PYTHON_FRAMEWORK)/Versions/3.13/include/python3.13 +OTHER_LDFLAGS = $(inherited) -lpython3.13 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) PYTHON_BIN="$(PYTHON)" PY3K=1 \ No newline at end of file diff --git a/deps/frameworks/Makefile b/deps/frameworks/Makefile index 3a48160..788b538 100644 --- a/deps/frameworks/Makefile +++ b/deps/frameworks/Makefile @@ -1,4 +1,4 @@ -PYTHON_VERSION = 3.11.9 +PYTHON_VERSION = 3.13.3 FRAMEWORK_REPO = https://github.com/gregneagle/relocatable-python.git BUILD_OPTS = --os-version=11 --python-version=$(PYTHON_VERSION) --upgrade-pip --pip-requirements=requirements.txt BIN = ./Python.framework/Versions/Current/bin @@ -11,6 +11,7 @@ PIP_INCLUDES = $(shell $(BIN)/python3-config --includes) all: Python.framework $(PIP_ENV) CFLAGS="$(PIP_INCLUDES)" $(BIN)/pip3 install --upgrade ../.. + find $(shell find ./Python.framework -name py2app -type d) -name main-\* -not -name \*universal2 -delete Python.framework: relocatable-python PYTHONNOUSERSITE=1 $(PIP_ENV) python3 ./relocatable-python/make_relocatable_python_framework.py $(BUILD_OPTS) diff --git a/deps/frameworks/requirements.txt b/deps/frameworks/requirements.txt index 8c84793..150f105 100644 --- a/deps/frameworks/requirements.txt +++ b/deps/frameworks/requirements.txt @@ -2,6 +2,7 @@ xattr cachecontrol[filecache] cffi -pyobjc==8.5.1 +pyobjc==11.0 +py2app requests six \ No newline at end of file diff --git a/plotdevice/gfx/image.py b/plotdevice/gfx/image.py index c413681..8817cf0 100644 --- a/plotdevice/gfx/image.py +++ b/plotdevice/gfx/image.py @@ -10,7 +10,7 @@ from plotdevice import DeviceError from ..util import _copy_attrs, autorelease -from ..util.readers import HTTP, last_modified +from ..util.readers import get_http_session, last_modified from ..lib.io import MovieExportSession, ImageExportSession from .geometry import Region, Size, Point, Transform, CENTER from .atoms import TransformMixin, EffectsMixin, FrameMixin, Grob @@ -123,7 +123,7 @@ def _lazyload(self, path=None, data=None): if re.match(r'https?:', path): # load from url key = err_info = path - resp = HTTP.get(path) + resp = get_http_session().get(path) mtime = last_modified(resp) # return a cached image if possible... if path in _cache and _cache[path][1] >= mtime: diff --git a/plotdevice/gui/editor.py b/plotdevice/gui/editor.py index 3f2393c..7d8044b 100644 --- a/plotdevice/gui/editor.py +++ b/plotdevice/gui/editor.py @@ -2,13 +2,10 @@ import os import re import json -import cgi import objc from io import open from objc import super -from pprint import pprint from time import time -from bisect import bisect from ..lib.cocoa import * from plotdevice.gui.preferences import get_default, editor_info from plotdevice.gui import bundle_path, set_timeout diff --git a/plotdevice/run/__init__.py b/plotdevice/run/__init__.py index c1e02f3..5dc8ec2 100644 --- a/plotdevice/run/__init__.py +++ b/plotdevice/run/__init__.py @@ -5,6 +5,7 @@ try: # test the sys.path by attempting to load a PyObjC submodule... from Foundation import * + import objc except ImportError: # detect whether we're being run from the repository and set up a local env if so repo = abspath(join(dirname(__file__), '../..')) @@ -17,6 +18,7 @@ call([sys.executable, setup_py, 'dev']) site.addsitedir(local_libs) from Foundation import * + import objc else: from pprint import pformat missing = "Searched for PyObjC libraries in:\n%s\nto no avail..."%pformat(sys.path) @@ -28,4 +30,4 @@ # expose the script-runner object from .sandbox import Sandbox -__all__ = ('objc', 'encoding', 'Sandbox') \ No newline at end of file +__all__ = ('objc', 'encoded', 'Sandbox') \ No newline at end of file diff --git a/setup.py b/setup.py index 22165f7..61b181a 100644 --- a/setup.py +++ b/setup.py @@ -506,10 +506,10 @@ def codesign(root, name=None, exec=False, entitlement=False): install_requires = [ 'requests', 'cachecontrol[filecache]', - 'pyobjc-core==8.5.1', - 'pyobjc-framework-Quartz==8.5.1', - 'pyobjc-framework-LaunchServices==8.5.1', - 'pyobjc-framework-WebKit==8.5.1', + 'pyobjc-core==11.0', + 'pyobjc-framework-Quartz==11.0', + 'pyobjc-framework-LaunchServices==11.0', + 'pyobjc-framework-WebKit==11.0', ], scripts = ["app/plotdevice"], zip_safe=False, diff --git a/tests/compositing.py b/tests/compositing.py index 6c73e1b..5db3274 100644 --- a/tests/compositing.py +++ b/tests/compositing.py @@ -111,5 +111,5 @@ def test_beginclip(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(CompositingTests)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(CompositingTests)) return suite diff --git a/tests/drawing.py b/tests/drawing.py index 8769369..1d0dbe1 100644 --- a/tests/drawing.py +++ b/tests/drawing.py @@ -479,5 +479,5 @@ def test_strokewidth(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(DrawingTests)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(DrawingTests)) return suite diff --git a/tests/geometry.py b/tests/geometry.py index cbbcec2..4819798 100644 --- a/tests/geometry.py +++ b/tests/geometry.py @@ -247,5 +247,5 @@ def test_push(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(GeometryTests)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(GeometryTests)) return suite diff --git a/tests/module.py b/tests/module.py index 9a13100..77a30bb 100644 --- a/tests/module.py +++ b/tests/module.py @@ -35,9 +35,9 @@ def test_cli(self): def suite(): - from unittest import TestSuite, makeSuite + from unittest import TestSuite, defaultTestLoader suite = TestSuite() - suite.addTest(makeSuite(ModuleTests)) + suite.addTest(defaultTestLoader.loadTestsFromTestCase(ModuleTests)) return suite \ No newline at end of file diff --git a/tests/primitives.py b/tests/primitives.py index 1c31dd3..4fcf41c 100644 --- a/tests/primitives.py +++ b/tests/primitives.py @@ -160,5 +160,5 @@ def test_star(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PrimitivesTests)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(PrimitivesTests)) return suite diff --git a/tests/typography.py b/tests/typography.py index bc30adb..2f777dc 100644 --- a/tests/typography.py +++ b/tests/typography.py @@ -494,5 +494,5 @@ def test_line_fragment(self): def suite(): suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(TypographyTests)) + suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TypographyTests)) return suite