Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of packaging app using py2app #337

Open
cztomczak opened this issue Mar 25, 2017 · 0 comments
Open

Example of packaging app using py2app #337

cztomczak opened this issue Mar 25, 2017 · 0 comments

Comments

@cztomczak
Copy link
Owner

cztomczak commented Mar 25, 2017

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:

@cztomczak cztomczak changed the title Example of packaging using py2app Example of packaging using app py2app Mar 25, 2017
@cztomczak cztomczak changed the title Example of packaging using app py2app Example of packaging app using py2app Mar 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant