How to use the py2app.recipes function in py2app

To help you get started, we’ve selected a few py2app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ilastik / ilastik / setup_mac.py View on Github external
# Don't put the module in the site-packages.zip file
        return dict(
            packages=[self.module]
        )

# Exclude various packages from the site-packages.zip file,
#  since they don't import correctly if they're zipped.
import py2app.recipes
for module in ['ilastik', 'volumina', 'lazyflow', 'iiboost', 'vtk', 'sklearn', 'skimage', 'jsonschema']:
    setattr( py2app.recipes, module, exclude_from_zipped_packages(module) )

# Include nanshe if it's available.
try:
    import nanshe
    py2app.recipes.nanshe = exclude_from_zipped_packages('nanshe')
except ImportError:
    pass

##
## The --include-meta-repo option is a special option added by this script.
## If given, we will include the entire ilastik-meta git repo directory (which includes ilastik, lazyflow, and volumina).
## (Otherwise, py2app just includes the individual python module directories, without the supporting files.)
##

include_meta_repo = False
if '--include-meta-repo' in sys.argv:
    include_meta_repo = True
    sys.argv.remove('--include-meta-repo')

# This hack allows us to run custom code before/after the py2app command executes.
# http://www.niteoweb.com/blog/setuptools-run-custom-code-during-install
github Marginal / EDMarketConnector / setup.py View on Github external
    def iterRecipes(module=recipes):
        for name in dir(module):
            if name.startswith('_') or name=='sip':
                continue
            check = getattr(getattr(module, name), 'check', None)
            if check is not None:
                yield (name, check)
    py2app.build_app.iterRecipes = iterRecipes
github vaexio / vaex / py2app.py View on Github external
has_py2app = False
#import vaex
try:
	import py2app.build_app
	has_py2app = True
except:
	pass

if has_py2app:
	import py2app.recipes
	class astropy(object):
		def check(self, cmd, graph):
			return dict(packages=["astropy"])
	py2app.recipes.astropy = astropy()
	# see http://stackoverflow.com/questions/31240052/py2app-typeerror-dyld-find-got-an-unexpected-keyword-argument-loader
	"""
	Monkey-patch macholib to fix "dyld_find() got an unexpected keyword argument 'loader'".

	Add 'import macholib_patch' to the top of set_py2app.py
	"""

	import macholib
	if macholib.__version__ <= "1.7":
		print("Applying macholib patch...")
		import macholib.dyld
		import macholib.MachOGraph
		dyld_find_1_7 = macholib.dyld.dyld_find
		def dyld_find(name, loader=None, **kwargs):
			#print("~"*60 + "calling alternate dyld_find")
			if loader is not None:
github ilastik / ilastik-0.5 / setup_mac.py View on Github external
'frameworks': [],
          }

class ilastik_recipe(object):
    def check(self, dist, mf):
        m = mf.findNode('ilastik')
        if m is None:
            return None
        
        return dict(
            packages=['ilastik'],
            prescripts=['osx-bundle-pre-launch.py']
        )

import py2app.recipes
py2app.recipes.ilastik   = ilastik_recipe()

setup(
    app=APP,
    data_files=DATA_FILES,
    options={'py2app': OPTIONS},
    setup_requires=['py2app'],
    iconfile='appIcon.icns',
)
github ilastik / ilastik / setup_mac.py View on Github external
def check(self, dist, mf):
        m = mf.findNode(self.module)
        if m is None:
            return None

        # Don't put the module in the site-packages.zip file
        return dict(
            packages=[self.module]
        )

# Exclude various packages from the site-packages.zip file,
#  since they don't import correctly if they're zipped.
import py2app.recipes
for module in ['ilastik', 'volumina', 'lazyflow', 'iiboost', 'vtk', 'sklearn', 'skimage', 'jsonschema']:
    setattr( py2app.recipes, module, exclude_from_zipped_packages(module) )

# Include nanshe if it's available.
try:
    import nanshe
    py2app.recipes.nanshe = exclude_from_zipped_packages('nanshe')
except ImportError:
    pass

##
## The --include-meta-repo option is a special option added by this script.
## If given, we will include the entire ilastik-meta git repo directory (which includes ilastik, lazyflow, and volumina).
## (Otherwise, py2app just includes the individual python module directories, without the supporting files.)
##

include_meta_repo = False
if '--include-meta-repo' in sys.argv:
github metachris / py2app / py2app / build_app.py View on Github external
def iterRecipes(module=recipes):
    for name in dir(module):
        if name.startswith('_'):
            continue
        check = getattr(getattr(module, name), 'check', None)
        if check is not None:
            yield (name, check)