From Wikinico

Jump to: navigation, search

Create the egg

#from distutils.core import setup
from setuptools import setup

setup( name='egg_name', version='1.0', packages=['package_A', 'package_B', 'package_C', 'package_D'], )

To create the egg:

python bdist_egg

Develop with eggs

In each module create a file :

class EggManager( object ):
    def smith_use_egg():
        return True

    def smith():
        return 'smith==1.4'

In each file external to smith using something in smith:

from myclientmodule.EggManager import EggManager
from pkg_resources import require

if EggManager.smith_use_egg():
    require( EggManager.smith() )

import smith
Personal tools