diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 25836bd..d94b73b 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -13,7 +13,7 @@ jobs: runs-on: macos-latest strategy: matrix: - python: [3.12] + python: [3.13.13] steps: - uses: actions/checkout@v4 - name: Set up Python diff --git a/setup.py b/setup.py index ada9131..fdf8df7 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,6 @@ -from setuptools import setup +import sys + +from setuptools import Distribution, setup APP = ['main.py'] DATA_FILES = [''] @@ -11,8 +13,17 @@ 'includes': ['Cocoa'], } +class Py2AppDistribution(Distribution): + """Clear install_requires for py2app to avoid DistutilsOptionError.""" + def finalize_options(self): + super().finalize_options() + if "py2app" in sys.argv: + self.install_requires = [] + + setup( app=APP, options={'py2app': OPTIONS}, + distclass=Py2AppDistribution, setup_requires=['py2app'], -) \ No newline at end of file +)