{ "info": { "author": "Richard Gomes http://rgomes-info.blogspot.com", "author_email": "rgomes.info@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Cython", "Programming Language :: Python" ], "description": "distcontrib\n===========\n\n| Code_ | Bugs_ | Forums_ | License_ | Contact_\n\n.. _Code : http://code.launchpad.net/distcontrib\n.. _Bugs : http://bugs.launchpad.net/distcontrib\n.. _Forums : http://answers.launchpad.net/distcontrib\n.. _License : http://opensource.org/licenses/BSD-3-Clause\n.. _Contact : http://launchpad.net/~frgomes\n\nPython package ``distcontrib`` contributes utility functions to Distutils, extending its\nfunctionalities, like integration with Cython build and a launcher for doctest. \n\nThe primary reason for the existence of ``distcontrib`` is making life a lot easier\nwhen you write ``setup.py`` for your projects. You can create a template ``setup.py``\nfile and simply copy it to all new or existing projects you have, without any \nmodification, in most situations. Under the covers, ``distcontrib`` finds several \nbits and pieces about your project and *automagically* configures itself\nso that you don't have to adjust your setup.py file every time you create a new\nproject.\n\n\nSee also: `distcontrib-migrate`_\n\nUsage\n-----\n\nThis is an example of how your ``setup.py`` would look like::\n\n #!/usr/bin/env python\n \n from setuptools import find_packages\n from distutils.core import setup\n from Cython.Distutils import build_ext as cython_build\n import distcontrib as du\n\n ##\n # This block contains settings you will eventually need to change\n ###\n \n import myapp as myapp #--- adjust to your package name\n\n PACKAGE = myapp.pkg_name\n VERSION = myapp.pkg_version\n DESCRIPTION = myapp.pkg_description\n LICENSE = myapp.pkg_license\n URL = myapp.pkg_url\n AUTHOR = myapp.pkg_author\n AUTHOR_EMAIL = myapp.pkg_email\n KEYWORDS = myapp.pkg_keywords\n REQUIREMENTS = myapp.pkg_requirements\n LONG_DESCRIPTION = du.tools.read('README')\n CLASSIFIERS = [ 'License :: ' + LICENSE,\n 'Operating System :: OS Independent',\n 'Programming Language :: Python',\n 'Programming Language :: Cython',\n 'Development Status :: 3 - Alpha',\n 'Intended Audience :: Developers',\n 'Environment :: Console' ]\n \n ##\n # From this point on, it's unlikely you will be changing anything.\n ###\n \n PACKAGES = find_packages(exclude=[\"*.tests\", \"*.tests.*\", \"tests.*\", \"tests\"])\n PACKAGES_DATA = du.tools.findall_package_data(PACKAGES)\n EXT_MODULES = du.tools.find_ext_modules(PACKAGES)\n \n setup(\n name=PACKAGE,\n version=VERSION,\n description=DESCRIPTION,\n url=URL,\n author=AUTHOR,\n author_email=AUTHOR_EMAIL,\n long_description=LONG_DESCRIPTION,\n license=LICENSE,\n keywords=KEYWORDS,\n classifiers=CLASSIFIERS,\n packages=PACKAGES,\n package_data=PACKAGES_DATA,\n cmdclass={ 'build_ext' : cython_build,\n 'doctest' : du.doctest,\n 'zap' : du.zap, },\n ext_modules=EXT_MODULES,\n install_requires=REQUIREMENTS\n )\n\nThen create under your ``myapp/__init__.py`` file something like this::\n\n #!/usr/bin/env python\n \n pkg_name = __name__ if __package__ is None else __package__\n pkg_description = 'This application does everything you can imagine'\n pkg_version = '0.1.0'\n pkg_license = 'OSI Approved :: BSD License'\n pkg_url = 'http://' + pkg_name + '.readthedocs.org/'\n pkg_author = 'Richard Gomes http://rgomes-info.blogspot.com'\n pkg_email = 'rgomes.info@gmail.com'\n pkg_keywords = [ 'artificial','intelligence','magic','sorcery','voodoo' ]\n pkg_requirements = [ 'lxml', 'sqlalchemy' ]\n\nThen you can do enter from command line::\n\n $ python setup.py zap # clean on steroids\n $ python setup.py doctest # run your doctests\n $ python setup.py build_ext # build with Cython\n\n\nCommand *zap* cleans a lot more stuff than command *clean* does, being ideal as a step before committing changes to the source control or creating a backup copy of your working folder.\n\nCommand *doctest* runs all doctests, from all your packages. If you find that thre are doctests not being run, please make sure you have created ``__init__.py`` files in all packages.\n\nSpecial cases\n^^^^^^^^^^^^^\n\nIn certain circumstances, you may have to guarantee that your ``setup.py`` installs a minumun set of essential requirements which, if not installed, may prevent your ``setup.py`` from running properly. By borrowing function ``install_requirements`` from package ``distcontrib.bootstrap`` and calling it on the top of your ``setup.py``, you can install these essential requirements, as shown below::\n\n #!/usr/bin/env python\n \n ESSENTIAL = [ 'distribute', 'version', 'Cython', 'distcontrib', 'distcontrib-migrate' ]\n\n # This function was copied verbatim from distcontrib.bootstrap\n # In certain situations, you are not sure if distcontrib is installed, then\n # makes sense to have this function straight on the top of your setup.py\n def install_requirements(requirements, verbose=True):\n import os, pip\n pip_args = list()\n if verbose:\n print('Installing requirements: ' + str(requirements))\n pip_args.append( '--verbose' )\n proxy = os.environ['http_proxy']\n if proxy:\n pip_args.append('--proxy')\n pip_args.append(proxy)\n if verbose:\n print('http_proxy=' + proxy)\n pip_args.append('install')\n for req in requirements:\n pip_args.append( req )\n pip.main(initial_args = pip_args)\n\n\n try:\n from setuptools import find_packages\n from distutils.core import setup\n from Cython.Distutils import build_ext as cython_build\n import distcontrib as du\n import distcontrib_migrate as dm\n except:\n #-- import distcontrib.bootstrap\n #-- distcontrib.bootstrap.install_requirements( ESSENTIAL )\n install_requirements( ESSENTIAL )\n \n # do it again\n from setuptools import find_packages\n from distutils.core import setup\n from Cython.Distutils import build_ext as cython_build\n import distcontrib as du\n import distcontrib_migrate as dm\n\n ... the rest of your setup.py comes here\n\n\nSupport\n-------\n\n - Bugs: https://bugs.launchpad.net/distcontrib\n - Forums : https://answers.launchpad.net/distcontrib\n - Sources: https://code.launchpad.net/distcontrib\n\n\n.. _`distcontrib-migrate`: http://distcontrib-migrate.readthedocs.org/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://distcontrib.readthedocs.org/", "keywords": "distribute,setuptools,pip,cython", "license": "OSI Approved :: BSD License", "maintainer": null, "maintainer_email": null, "name": "distcontrib", "package_url": "https://pypi.org/project/distcontrib/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/distcontrib/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://distcontrib.readthedocs.org/" }, "release_url": "https://pypi.org/project/distcontrib/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Contributions to Distutils", "version": "0.1.0" }, "last_serial": 832529, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6b45e8ab79d07bd058721cf885dd7f06", "sha256": "2fafe2a59a1f27a814d87a3a61203311ac806b5624b1f88dddf83a587d2e469f" }, "downloads": -1, "filename": "distcontrib-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6b45e8ab79d07bd058721cf885dd7f06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7669, "upload_time": "2013-08-05T11:52:36", "url": "https://files.pythonhosted.org/packages/b6/3a/e663c8cf81158121fb9339a13fdcc3ea515cc746cc05cdfcfb866923fd4c/distcontrib-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6b45e8ab79d07bd058721cf885dd7f06", "sha256": "2fafe2a59a1f27a814d87a3a61203311ac806b5624b1f88dddf83a587d2e469f" }, "downloads": -1, "filename": "distcontrib-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6b45e8ab79d07bd058721cf885dd7f06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7669, "upload_time": "2013-08-05T11:52:36", "url": "https://files.pythonhosted.org/packages/b6/3a/e663c8cf81158121fb9339a13fdcc3ea515cc746cc05cdfcfb866923fd4c/distcontrib-0.1.0.tar.gz" } ] }