Tuesday, April 29, 2014

angular aws django django form django permission env github javascript mac mysql nginx node.js pytho


ref: http://guide.python-distribute.org/ http://docs.python.org/2/distutils/packageindex.html http://dormousehole.readthedocs.org/en/latest/patterns/distribute.html http://www.ibm.com/developerworks/cn/opensource/os-pythonpackaging/ setup.py Example #!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() long_description = open('README.rst').read() + '\n\n' + open('HISTORY.rst').read() license = open('LICENSE').read() requirements_lines = [line.strip() for line in open('requirements.txt').readlines()] install_requires = list(filter(None, requirements_lines)) packages = [ 'haul', 'haul.finders', 'haul.finders.pipeline', 'haul.extenders', 'haul.extenders.pipeline', ] setup( name='haul', version='1.3.2', description='An Extensible Image Crawler', long_description=long_description, keywords='haul web image content scraper parser crawler', author='Vinta Chen', used stainless steel tables author_email=' [email protected] ', url='https://github.com/vinta/Haul', license=license, install_requires=install_requires, include_package_data=True, packages=packages, test_suite='tests', zip_safe=False, classifiers=( 'Development Status :: 3 - Alpha', 'Environment :: Web Environment', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Natural Language used stainless steel tables :: English', 'Natural Language :: Chinese (Traditional)', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', used stainless steel tables 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Multimedia :: Graphics', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Utilities', ), )
因為 setuptools 默認只會打包 *.py 檔案 但是你可以在 package_data 中指定額外的檔案也一起打包進去 另外 package_data 裡的檔案在安裝的時候會繼承你原來的檔案讀寫權限 package_data = { # 任何目錄中含有 .txt 文件 都包含它 '': ['*.txt', ], # 包含 demo 包 data 文件夹中的 *.dat 文件 'demo': ['data/*.dat', ], }
you need to register an account on PyPI (Python Package Index) to submit your package $ python setup.py install # 會安裝依賴的 packages 並 link 到 site-packages 而不是把檔案複製過去 $ python setup.py develop # 你必須在 setup.py 裡指定 `test_suite` $ python setup.py test # 打包 $ python setup.py sdist # 向 PyPI 註冊或更新你的 package used stainless steel tables 訊息 只是註冊而已 檔案要用下面那個 upload 指令上傳 $ python setup.py register # 打包並上傳到 PyPI $ python setup.py sdist upload python used stainless steel tables Post navigation
Recent Posts Karma: JavaScript test runner permission decorator in class-based used stainless steel tables view with django-guardian Object Permission in Django coverage.py: Python code coverage $scope.apply() in AngularJS replace text in MySQL for WordPress templates cache in Django assign used stainless steel tables request.user in Django ModelForm / Class-Based View How to use vagrant share and Vagrant Cloud AngularJS with Django - Conflicting template tags Tags
angular aws django django form django permission env github javascript mac mysql nginx node.js python s3 sublime-text test tests vagrant xpath Categories Databases (1) JavaScript (6) Mac OS X (3) Python (12) Server (3) Uncategorized (1) Archives March 2014  (9) February 2014  (17)
Proudly powered by WordPress

No comments:

Post a Comment