Python's Egg pack

Source: Internet
Author: User
Tags pack

1. Background

To view the source code of flower, first see the main program of Flower as follows:

#!/usr/local/sinasrv2/bin/python2.7# easy-install-entry-script: ' flower==0.7.3 ', ' console_scripts ', ' Flower ' __ requires__ = ' flower==0.7.3 ' import sys from pkg_resources import load_entry_pointif __name__ = = ' __main__ ':    sys.exit (        load_entry_point (' flower==0.7.3 ', ' console_scripts ', ' Flower ') ()

Load_entry_point, the source of its information is Entry_points.txt

What about the source of Entry_points.txt?

setup.py inside has entry_points information, will be based on this information to generate the egg info directory, there are entry_points.txt files, inside the content is setup.py entry_points information

Setup (    name= ' flower ',    version=get_package_version (),    description= ' celery flower ',    long_ Description=open (' Readme.rst '). Read (),    author= ' Mher Movsisyan ',    author_email= ' [email protected] ',    Url= ' Https://github.com/mher/flower ',    license= ' BSD ',    classifiers=classifiers,    packages=find_ Packages (exclude=[' tests ', ' tests.* ']),    install_requires=install_requires,    test_suite= "tests",    Tests_require=get_requirements (' Test.txt '),    package_data={' flower ': [' templates/* ', ' static/**/* ', ' static/* . * '},    entry_points={        ' console_scripts ': [                                                                                                                     ' flower = Flower.__main__:main ',        ],          ' Celery.commands ': [            ' flower = Flower.command:FlowerCommand ',        ],      },  )

  

A python script is then encapsulated

Description The flower script actually calls:

Two ways to start

[Celery.commands]flower = Flower.command:flowercommand[console_scripts]flower = Flower.__main__:main

2, how to make a egg package and corresponding setup.py how to write it?

 

3. References

1, http://www.cnblogs.com/itech/archive/2011/02/13/1953268.html

2, http://zhiwei.li/text/2011/06/load_entry_point%E5%92%8Csetup-egg/

3, http://django-china.cn/topic/90/

Python's Egg pack

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.