Skip to content

Example of packaging app using py2app #337

Open

Description

@cztomczak

See https://py2app.readthedocs.io/en/latest/

Example setup.py file:

import os
from setuptools import setup

# If not set possibly could result in a blank window issue
os.environ['MACOSX_DEPLOYMENT_TARGET'] = "10.9"

APP_VERSION = '1.0.0'
OPTIONS = {
    'packages' : ['cefpython3', 'objc', 'json', 'urllib'],
    # 'iconfile' : 'appicon.icns',
    'plist' : {
        'CFBundleIdentifier' : 'hello.world',
        'CFBundleShortVersionString' : APP_VERSION,
        'CFBundleVersion' : APP_VERSION,
    }
}

setup(
    name="Hello World",
    app=["hello_world.py"],
    data_files=[],
    options={'py2app': OPTIONS},
    setup_requires=['py2app']
)

CEF Python expects a certain directory structure and if py2app uses a different structure then you have to set these paths manually, for example with such code:

options = {
    "framework_dir_path": os.path.abspath("lib/python3.7/cefpython3/Chromium Embedded Framework.framework"),
    "browser_subprocess_path": os.path.abspath("lib/python3.7/cefpython3/subprocess")
}
cef.Initialize(settings=options)

See also:

Activity

  1. changed the title [-]Example of packaging using py2app[/-] [+]Example of packaging using app py2app[/+] on Mar 25, 2017
  2. changed the title [-]Example of packaging using app py2app[/-] [+]Example of packaging app using py2app[/+] on Mar 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions