Last active
September 14, 2015 10:42
-
-
Save leafsummer/db3e3f3620f6ae50225c to your computer and use it in GitHub Desktop.
python setup egg program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from setuptools import setup, find_packages | |
import os | |
entrypoints = {} | |
console_scripts = entrypoints['console_scripts'] = [ | |
'report_init = bailu.__main__:init', | |
'report_run = bailu.__main__:run', | |
'report_deploy = bailu.__main__:deploy', | |
'report_publish = bailu.__main__:publish' | |
] | |
def get_packages(package): | |
""" | |
Return root package and all sub-packages. | |
""" | |
return [dirpath | |
for dirpath, dirnames, filenames in os.walk(package) | |
if os.path.exists(os.path.join(dirpath, '__init__.py'))] | |
def get_package_data(package): | |
""" | |
Return all files under the root package, that are not in a | |
package themselves. | |
""" | |
walk = [(dirpath.replace(package + os.sep, '', 1), filenames) | |
for dirpath, dirnames, filenames in os.walk(package) | |
if not os.path.exists(os.path.join(dirpath, '__init__.py'))] | |
filepaths = [] | |
for base, filenames in walk: | |
if '.svn' not in base: | |
filepaths.extend([os.path.join(base, filename) | |
for filename in filenames]) | |
return {package: filepaths} | |
setup( | |
name="bailu", | |
version="0.1.0", | |
packages=get_packages('bailu'), | |
package_data=get_package_data('bailu'), | |
zip_safe=False, | |
install_requires=["celery==3.1.18", "requests==2.7.0", "pyyaml==3.11", "mako==1.0.1"], | |
description="bailu report worker packages install egg", | |
long_description="bailu report worker packages install egg, used by every type of report worker", | |
author="wuqingfeng", | |
license="BSD", | |
keywords=("bailu", 'report', 'celery', 'egg'), | |
platforms="Independant", | |
url="", | |
entry_points=entrypoints, | |
scripts=['bailu/bin/wkhtmltopdf-amd64_old', 'bailu/bin/wkhtmltoimage-amd64_old'], | |
data_files=[('bailu/worker/report_clone/', ['bailu/worker/report_clone/config.yaml'])] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment