├── .gitignore ├── .travis.yml ├── Changelog.md ├── LICENSE ├── Makefile ├── Readme.md ├── bin ├── compile ├── detect ├── release ├── steps │ ├── collectstatic │ ├── hooks │ │ ├── post_compile │ │ └── pre_compile │ ├── libffi │ └── pylibmc ├── test └── utils ├── requirements.txt ├── test ├── distutils │ ├── envoy.py │ └── setup.py ├── django-1.3-skeleton │ ├── haystack │ │ ├── __init__.py │ │ ├── manage.py │ │ ├── settings.py │ │ └── urls.py │ └── requirements.txt ├── django-1.4-skeleton │ ├── haystack │ │ ├── .DS_Store │ │ ├── __init__.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── manage.py │ └── requirements.txt ├── django-1.5-skeleton │ ├── haystack │ │ ├── __init__.py │ │ ├── settings.py │ │ ├── urls.py │ │ └── wsgi.py │ ├── manage.py │ └── requirements.txt ├── empty-requirements │ └── requirements.txt ├── no-requirements │ └── setup.py ├── not-django │ ├── haystack │ │ └── settings.py │ ├── manage.py │ └── requirements.txt ├── not-python │ └── Gemfile ├── pylibmc │ └── requirements.txt ├── simple-requirements │ └── requirements.txt └── simple-runtime │ ├── requirements.txt │ └── runtime.txt └── vendor ├── distribute-0.6.36 ├── CHANGES.txt ├── CONTRIBUTORS.txt ├── DEVGUIDE.txt ├── MANIFEST.in ├── PKG-INFO ├── README.txt ├── _markerlib │ ├── __init__.py │ └── markers.py ├── distribute.egg-info │ ├── PKG-INFO │ ├── SOURCES.txt │ ├── dependency_links.txt │ ├── entry_points.txt │ ├── top_level.txt │ └── zip-safe ├── distribute_setup.py ├── docs │ ├── Makefile │ ├── _templates │ │ └── indexsidebar.html │ ├── _theme │ │ └── nature │ │ │ ├── static │ │ │ ├── nature.css_t │ │ │ └── pygments.css │ │ │ └── theme.conf │ ├── build │ │ └── html │ │ │ ├── _sources │ │ │ ├── easy_install.txt │ │ │ ├── index.txt │ │ │ ├── pkg_resources.txt │ │ │ ├── python3.txt │ │ │ ├── roadmap.txt │ │ │ ├── setuptools.txt │ │ │ └── using.txt │ │ │ └── _static │ │ │ ├── basic.css │ │ │ ├── nature.css │ │ │ └── pygments.css │ ├── conf.py │ ├── easy_install.txt │ ├── index.txt │ ├── pkg_resources.txt │ ├── python3.txt │ ├── roadmap.txt │ ├── setuptools.txt │ └── using.txt ├── easy_install.py ├── launcher.c ├── pkg_resources.py ├── release.py ├── setup.cfg ├── setup.py ├── setuptools │ ├── __init__.py │ ├── archive_util.py │ ├── cli-32.exe │ ├── cli-64.exe │ ├── cli.exe │ ├── command │ │ ├── __init__.py │ │ ├── alias.py │ │ ├── bdist_egg.py │ │ ├── bdist_rpm.py │ │ ├── bdist_wininst.py │ │ ├── build_ext.py │ │ ├── build_py.py │ │ ├── develop.py │ │ ├── easy_install.py │ │ ├── egg_info.py │ │ ├── install.py │ │ ├── install_egg_info.py │ │ ├── install_lib.py │ │ ├── install_scripts.py │ │ ├── register.py │ │ ├── rotate.py │ │ ├── saveopts.py │ │ ├── sdist.py │ │ ├── setopt.py │ │ ├── test.py │ │ ├── upload.py │ │ └── upload_docs.py │ ├── depends.py │ ├── dist.py │ ├── extension.py │ ├── gui-32.exe │ ├── gui-64.exe │ ├── gui.exe │ ├── package_index.py │ ├── sandbox.py │ ├── script template (dev).py │ ├── script template.py │ └── tests │ │ ├── __init__.py │ │ ├── doctest.py │ │ ├── indexes │ │ └── test_links_priority │ │ │ ├── external.html │ │ │ └── simple │ │ │ └── foobar │ │ │ └── index.html │ │ ├── py26compat.py │ │ ├── server.py │ │ ├── test_bdist_egg.py │ │ ├── test_build_ext.py │ │ ├── test_develop.py │ │ ├── test_dist_info.py │ │ ├── test_easy_install.py │ │ ├── test_markerlib.py │ │ ├── test_packageindex.py │ │ ├── test_resources.py │ │ ├── test_sandbox.py │ │ ├── test_sdist.py │ │ ├── test_test.py │ │ ├── test_upload_docs.py │ │ └── win_script_wrapper.txt ├── site.py └── tests │ ├── api_tests.txt │ ├── install_test.py │ ├── manual_test.py │ ├── shlib_test │ ├── hello.c │ ├── hello.pyx │ ├── hellolib.c │ ├── setup.py │ └── test_hello.py │ └── test_distribute_setup.py ├── pip-1.3.1 ├── AUTHORS.txt ├── CHANGES.txt ├── LICENSE.txt ├── MANIFEST.in ├── PKG-INFO ├── PROJECT.txt ├── README.rst ├── docs │ ├── configuration.txt │ ├── cookbook.txt │ ├── development.txt │ ├── index.txt │ ├── installing.txt │ ├── logic.txt │ ├── news.txt │ ├── other-tools.txt │ ├── quickstart.txt │ └── usage.txt ├── pip │ ├── __init__.py │ ├── __main__.py │ ├── backwardcompat │ │ ├── __init__.py │ │ ├── socket_create_connection.py │ │ └── ssl_match_hostname.py │ ├── basecommand.py │ ├── baseparser.py │ ├── cacert.pem │ ├── cmdoptions.py │ ├── commands │ │ ├── __init__.py │ │ ├── bundle.py │ │ ├── completion.py │ │ ├── freeze.py │ │ ├── help.py │ │ ├── install.py │ │ ├── list.py │ │ ├── search.py │ │ ├── show.py │ │ ├── uninstall.py │ │ ├── unzip.py │ │ └── zip.py │ ├── download.py │ ├── exceptions.py │ ├── index.py │ ├── locations.py │ ├── log.py │ ├── req.py │ ├── runner.py │ ├── status_codes.py │ ├── util.py │ └── vcs │ │ ├── __init__.py │ │ ├── bazaar.py │ │ ├── git.py │ │ ├── mercurial.py │ │ └── subversion.py ├── setup.cfg └── setup.py ├── shunit2 └── test-utils /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | site 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 2.7 4 | script: make tests 5 | notifications: 6 | email: false -------------------------------------------------------------------------------- /Changelog.md: -------------------------------------------------------------------------------- 1 | ## v14 2 | 3 | Features: 4 | 5 | * Full removal of Django settings injection for new apps. 6 | * Support for profile.d 7 | * Fresh app detection. 8 | * Update to Virtualenv v1.7.2 9 | * Updated to Pip v1.1 (patched) 10 | 11 | Bugfixes: 12 | 13 | * Default pip path exists action. 14 | 15 | ## v13 16 | 17 | Bugfixes: 18 | 19 | * Fix pip quoting error. 20 | * Only talk about collectstatic in buildpack output when it's configured. 21 | 22 | ## v12 23 | 24 | Bugfixes: 25 | 26 | * Catch database setting corner case. 27 | 28 | ## v11 29 | 30 | Bugfixes: 31 | 32 | * Cleanup collectstatic output. 33 | 34 | 35 | ## v10 36 | 37 | Bugfixes: 38 | 39 | * Check for collectstatic validity with --dry-run instead of --help for Django 1.4. 40 | 41 | ## v9 42 | 43 | Bugfixes: 44 | 45 | * Unset PYTHONHOME in buildpack for [user_env_compile](http://devcenter.heroku.com/articles/labs-user-env-compile). 46 | 47 | ## v8 48 | 49 | Features: 50 | 51 | * Disable Django collectstatic with `$DISABLE_COLLECTSTATIC` + [user_env_compile](http://devcenter.heroku.com/articles/labs-user-env-compile). 52 | 53 | Bugfixes: 54 | 55 | * Don't disbable injection for new Django apps. 56 | * Inform user of July 1, 2012 deprecation of Django injection. 57 | 58 | ## v7 59 | 60 | Features: 61 | 62 | * Full removal of Django setting injection for new apps. 63 | * Automatic execution of collectstatic. 64 | * Suppress collectstatic errors via env SILENCE_COLLECTSTATIC. 65 | * Increase settings.py search depth to 3. 66 | * Search recursively from included requirements.txt files. 67 | 68 | 69 | ## v6 (03/23/2012) 70 | 71 | Features: 72 | 73 | * Dist packages (setup.py) support. 74 | * Move new virtualenvs to `/app/.heroku/venv`. 75 | * Heavily improved Django app detection, accounting for `Django` in `requirements.txt`. 76 | * Literate [documentation](http://python-buildpack.herokuapp.com). 77 | * Default `$PYTHONHOME`, `$PYTHONPATH`, and `$LANG` configurations. 78 | * Disable Django setting injection with `$DISABLE_INJECTION` + [user_env_compile](http://devcenter.heroku.com/articles/labs-user-env-compile). 79 | * General code refactor and improved messaging. 80 | * Unit tests. 81 | 82 | Bugfixes: 83 | 84 | * Django 1.4 startproject template layout support. 85 | * Django `manage.py` location can now be independent from `settings.py`. 86 | 87 | ## v5 (02/01/2012) 88 | 89 | Bugfixes: 90 | 91 | * Git requirements 100% work. 92 | 93 | 94 | ## v4 (01/20/2012) 95 | 96 | Features: 97 | 98 | * Updated to virtualenv v1.7 with patched pip v1.2. 99 | * Actually activate created virtualenv within compile process. 100 | * Use distribute instead of deprecated setuptools. 101 | * Automatically destroy and rebuild corrupt virtualenvs. 102 | * Refactor django and pylibmc detection. 103 | 104 | Bugfixes: 105 | 106 | * Fixed `package==dev` in requirements with patched pip embedded within virtualenv. Patch upstreamed. 107 | * Minor curl/rm flag fixes (thanks, contributors!) 108 | 109 | 110 | ## v3 (12/07/2011) 111 | 112 | Bugfixes: 113 | 114 | * Better django setup.py injection. 115 | 116 | 117 | ## v2 (11/15/2011) 118 | 119 | Features: 120 | 121 | * Support for pylibmc and libmemcached +sasl. 122 | 123 | Bugfixes: 124 | 125 | * Detect when virtualenv is checked in and alert user. 126 | 127 | 128 | ## v1 (10/01/2011) 129 | 130 | * Conception. 131 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License: 2 | 3 | Copyright (C) 2013 Heroku, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | tests: 2 | ./bin/test 3 | 4 | docs: 5 | mkdir -p site 6 | shocco -t 'Python Buildpack Compiler' ./bin/compile > site/index.html 7 | shocco -t 'Django Buildpack Compiler' ./bin/steps/django > site/django.html 8 | shocco -t 'Python Buildpack Detector' ./bin/detect > site/detect.html 9 | shocco -t 'Pylibmc Buildpack Compiler' ./bin/steps/pylibmc > site/pylibmc.html 10 | shocco -t 'Python Buildpack Changelog' ./Changelog.md > site/changelog.html 11 | 12 | site: docs 13 | cd site && git add -A && git commit -m 'update' && git push heroku master 14 | 15 | pip: 16 | git clone git@github.com:kennethreitz/pip.git --branch heroku --depth 1 17 | rm -fr vendor/virtualenv-1.8.4/virtualenv_support/pip-1.2.1.tar.gz 18 | rm -fr pip/.git 19 | tar -pczf vendor/virtualenv-1.8.4/virtualenv_support/pip-1.2.1.tar.gz pip 20 | rm -fr pip 21 | 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | Heroku buildpack: Python 2 | ======================== 3 | 4 | This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for Python apps, powered by [pip](http://www.pip-installer.org/). 5 | 6 | [![Build Status](https://secure.travis-ci.org/heroku/heroku-buildpack-python.png?branch=master)](http://travis-ci.org/heroku/heroku-buildpack-python) 7 | 8 | Usage 9 | ----- 10 | 11 | Example usage: 12 | 13 | $ ls 14 | Procfile requirements.txt web.py 15 | 16 | $ heroku create --stack cedar --buildpack git://github.com/mfenniak/heroku-buildpack-python-libffi.git 17 | 18 | $ git push heroku master 19 | ... 20 | -----> Fetching custom git buildpack... done 21 | -----> Python app detected 22 | -----> No runtime.txt provided; assuming python-2.7.3. 23 | -----> Preparing Python runtime (python-2.7.3) 24 | -----> Installing Distribute (0.6.34) 25 | -----> Installing Pip (1.2.1) 26 | -----> Installing dependencies using Pip (1.2.1) 27 | Downloading/unpacking Flask==0.7.2 (from -r requirements.txt (line 1)) 28 | Downloading/unpacking Werkzeug>=0.6.1 (from Flask==0.7.2->-r requirements.txt (line 1)) 29 | Downloading/unpacking Jinja2>=2.4 (from Flask==0.7.2->-r requirements.txt (line 1)) 30 | Installing collected packages: Flask, Werkzeug, Jinja2 31 | Successfully installed Flask Werkzeug Jinja2 32 | Cleaning up... 33 | 34 | You can also add it to upcoming builds of an existing application: 35 | 36 | $ heroku config:add BUILDPACK_URL=git://github.com/kennethjiang/heroku-buildpack-python-libffi.git 37 | 38 | The buildpack will detect your app as Python if it has the file `requirements.txt` in the root. 39 | 40 | It will use Pip to install your dependencies, vendoring a copy of the Python runtime into your slug. 41 | 42 | Specify a Runtime 43 | ----------------- 44 | 45 | You can also provide arbitrary releases Python with a `runtime.txt` file. 46 | 47 | $ cat runtime.txt 48 | python-3.3.0 49 | 50 | Runtime options include: 51 | 52 | - python-2.7.4 53 | - python-3.3.1 54 | - pypy-1.9 (experimental) 55 | -------------------------------------------------------------------------------- /bin/detect: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as the 4 | # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) 5 | # detector. 6 | # 7 | # A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an 8 | # adapter between a Python application and Heroku's runtime. 9 | 10 | # ## Usage 11 | # Compiling an app into a slug is simple: 12 | # 13 | # $ bin/detect 14 | 15 | BUILD_DIR=$1 16 | 17 | # Exit early if app is clearly not Python. 18 | if [ ! -f $BUILD_DIR/requirements.txt ] && [ ! -f $BUILD_DIR/setup.py ]; then 19 | exit 1 20 | fi 21 | 22 | echo Python 23 | -------------------------------------------------------------------------------- /bin/release: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # bin/release 3 | 4 | BIN_DIR=$(cd $(dirname $0); pwd) # absolute path 5 | BUILD_DIR=$1 6 | 7 | MANAGE_FILE=$(cd $BUILD_DIR && find . -maxdepth 3 -type f -name 'manage.py' | head -1) 8 | MANAGE_FILE=${MANAGE_FILE:2} 9 | 10 | cat < /dev/null && RUN_COLLECTSTATIC=true 21 | 22 | # Compile assets if collectstatic appears to be kosher. 23 | if [ "$RUN_COLLECTSTATIC" ]; then 24 | 25 | echo "-----> Collecting static files" 26 | python $MANAGE_FILE collectstatic --noinput 2>&1 | sed '/^Copying/d;/^$/d;/^ /d' | indent 27 | 28 | [ $? -ne 0 ] && { 29 | echo " ! Error running manage.py collectstatic. More info:" 30 | echo " http://devcenter.heroku.com/articles/django-assets" 31 | } 32 | fi 33 | 34 | echo 35 | 36 | 37 | fi 38 | 39 | -------------------------------------------------------------------------------- /bin/steps/hooks/post_compile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -f bin/post_compile ]; then 4 | echo "-----> Running post-compile hook" 5 | chmod +x bin/post_compile 6 | bin/post_compile 7 | fi -------------------------------------------------------------------------------- /bin/steps/hooks/pre_compile: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -f bin/pre_compile ]; then 4 | echo "-----> Running pre-compile hook" 5 | chmod +x bin/pre_compile 6 | bin/pre_compile 7 | fi -------------------------------------------------------------------------------- /bin/steps/libffi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # This script is invoked by [`bin/compile`](/). 4 | 5 | # The location of the pre-compiled libffi binary. 6 | VENDORED_LIBFFI="https://s3.amazonaws.com/rt-uploads/libffi-3.0.tgz" 7 | VENDORED_PATH=/app/vendor/libffi-3.0 8 | 9 | # Syntax sugar. 10 | source $BIN_DIR/utils 11 | 12 | # If cffi exists within requirements, use vendored libffi. 13 | if (grep -Eiq "^\s*cffi" requirements.txt || grep -Eiq "^\s*cryptography" requirements.txt) then 14 | echo "-----> Noticed cffi. Bootstrapping libffi." 15 | PREV_DIR=$(pwd) 16 | mkdir -p "$VENDORED_PATH" 17 | cd "$VENDORED_PATH" 18 | 19 | # Download and extract libffi into target vendor directory. 20 | curl -s -L -o tmp-libffi.tar.gz $VENDORED_LIBFFI 21 | tar -zxvf tmp-libffi.tar.gz > /dev/null 22 | rm tmp-libffi.tar.gz 23 | 24 | # Add libffi's to PKG_CONFIG_PATH 25 | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(pwd)/lib/pkgconfig/ 26 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/lib/ 27 | #export LIBRARY_PATH=$LIBRARY_PATH:$(pwd)/lib/ 28 | echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" 29 | if [ -e $(pwd)/lib/pkgconfig/libffi.pc ] 30 | then 31 | echo "libffi.pc is in-place at $(pwd)/vendor/lib/pkgconfig/libffi.pc, libffi-based builds should work!" 32 | fi 33 | 34 | cd "$PREV_DIR" 35 | fi 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /bin/steps/pylibmc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as the Pylibmc build step of the 4 | # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) 5 | # compiler. 6 | # 7 | # A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an 8 | # adapter between a Python application and Heroku's runtime. 9 | # 10 | # This script is invoked by [`bin/compile`](/). 11 | 12 | # The location of the pre-compiled libmemcached binary. 13 | VENDORED_MEMCACHED="http://cl.ly/0a191R3K160t1w1P0N25/vendor-libmemcached.tar.gz" 14 | 15 | # Syntax sugar. 16 | source $BIN_DIR/utils 17 | 18 | # If pylibmc exists within requirements, use vendored libmemcached. 19 | if (grep -Eiq "^\s*pylibmc" requirements.txt) then 20 | echo "-----> Noticed pylibmc. Bootstrapping libmemcached." 21 | cd .heroku 22 | 23 | if [ -d "vendor/lib/sasl2" ]; then 24 | export LIBMEMCACHED=$(pwd)/vendor 25 | else 26 | # Download and extract libmemcached into target vendor directory. 27 | curl -s -L -o tmp-libmemcached.tar.gz $VENDORED_MEMCACHED 28 | tar -zxvf tmp-libmemcached.tar.gz > /dev/null 29 | rm tmp-libmemcached.tar.gz 30 | export LIBMEMCACHED=$(pwd)/vendor 31 | fi 32 | 33 | export LIBMEMCACHED=$(pwd)/vendor 34 | cd .. 35 | fi 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Create a Heroku app with the following buildpack: 5 | # https://github.com/ddollar/buildpack-tet 6 | # 7 | # Push this Python buildpack to that Heroku app to 8 | # run the tests. 9 | # 10 | 11 | testDetectWithReqs() { 12 | detect "simple-requirements" 13 | assertCapturedEquals "Python" 14 | assertCapturedSuccess 15 | } 16 | 17 | testDetectWithEmptyReqs() { 18 | detect "empty-requirements" 19 | assertCapturedEquals "Python" 20 | assertCapturedSuccess 21 | } 22 | 23 | testDetectDjango15() { 24 | detect "django-1.5-skeleton" 25 | assertCapturedEquals "Python" 26 | assertCapturedSuccess 27 | } 28 | 29 | testDetectDjango14() { 30 | detect "django-1.4-skeleton" 31 | assertCapturedEquals "Python" 32 | assertCapturedSuccess 33 | } 34 | 35 | testDetectDjango13() { 36 | detect "django-1.3-skeleton" 37 | assertCapturedEquals "Python" 38 | assertCapturedSuccess 39 | } 40 | 41 | testDetectNotDjangoWithSettings() { 42 | detect "not-django" 43 | assertCapturedEquals "Python" 44 | assertCapturedSuccess 45 | } 46 | 47 | testDetectWithSetupPy() { 48 | detect "distutils" 49 | assertCapturedEquals "Python" 50 | assertCapturedSuccess 51 | } 52 | 53 | testDetectWithSetupRequires() { 54 | detect "no-requirements" 55 | assertCapturedEquals "Python" 56 | assertCapturedSuccess 57 | } 58 | 59 | testDetectNotPython() { 60 | detect "not-python" 61 | assertNotCaptured "Python" 62 | assertEquals "1" "${RETURN}" 63 | } 64 | 65 | 66 | ## utils ######################################## 67 | 68 | pushd $(dirname 0) >/dev/null 69 | BASE=$(pwd) 70 | popd >/dev/null 71 | 72 | source ${BASE}/vendor/test-utils 73 | 74 | detect() { 75 | capture ${BASE}/bin/detect ${BASE}/test/$1 76 | } 77 | 78 | compile() { 79 | capture ${BASE}/bin/compile ${BASE}/test/$1 80 | } 81 | 82 | source ${BASE}/vendor/shunit2 83 | 84 | -------------------------------------------------------------------------------- /bin/utils: -------------------------------------------------------------------------------- 1 | shopt -s extglob 2 | 3 | [ $(uname) == "Darwin" ] && SED_FLAG='-l' || SED_FLAG='-u' 4 | 5 | # Syntax sugar. 6 | indent() { 7 | RE="s/^/ /" 8 | sed $SED_FLAG "$RE" 9 | } 10 | 11 | # Clean up pip output 12 | cleanup() { 13 | sed $SED_FLAG -e 's/\.\.\.\+/.../g' | sed $SED_FLAG '/already satisfied/Id' | sed $SED_FLAG -e '/Overwriting/Id' | sed $SED_FLAG -e '/python executable/Id' | sed $SED_FLAG -e '/no previously-included files/Id' 14 | } 15 | 16 | # Buildpack Steps. 17 | function puts-step (){ 18 | echo "-----> $@" 19 | } 20 | 21 | # Buildpack Warnings. 22 | function puts-warn (){ 23 | echo " ! $@" 24 | } 25 | 26 | # Usage: $ set-env key value 27 | function set-env (){ 28 | echo "export $1=$2" >> $PROFILE_PATH 29 | } 30 | 31 | # Usage: $ set-default-env key value 32 | function set-default-env (){ 33 | echo "export $1=\${$1:-$2}" >> $PROFILE_PATH 34 | } 35 | 36 | # Usage: $ set-default-env key value 37 | function un-set-env (){ 38 | echo "unset $1" >> $PROFILE_PATH 39 | } 40 | 41 | # Does some serious copying. 42 | function deep-cp (){ 43 | find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec cp -a '{}' $2 \; 44 | cp -r $1/!(tmp) $2 45 | # echo copying $1 to $2 46 | } 47 | 48 | # Does some serious moving. 49 | function deep-mv (){ 50 | deep-cp $1 $2 51 | 52 | rm -fr $1/!(tmp) 53 | find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \; 54 | } 55 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | requests -------------------------------------------------------------------------------- /test/distutils/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | import os 5 | import sys 6 | import envoy 7 | 8 | try: 9 | from setuptools import setup 10 | except ImportError: 11 | from distutils.core import setup 12 | 13 | 14 | 15 | if sys.argv[-1] == "publish": 16 | os.system("python setup.py sdist upload") 17 | sys.exit() 18 | 19 | required = [] 20 | 21 | setup( 22 | name='envoy', 23 | version=envoy.__version__, 24 | description='Simple API for running external processes.', 25 | author='Kenneth Reitz', 26 | author_email='me@kennethreitz.com', 27 | url='https://github.com/kennethreitz/envoy', 28 | py_modules= ['envoy'], 29 | install_requires=required, 30 | license='MIT', 31 | classifiers=( 32 | 'Development Status :: 5 - Production/Stable', 33 | 'Intended Audience :: Developers', 34 | 'Natural Language :: English', 35 | 'License :: OSI Approved :: MIT License', 36 | 'Programming Language :: Python', 37 | 'Programming Language :: Python :: 2.5', 38 | 'Programming Language :: Python :: 2.6', 39 | 'Programming Language :: Python :: 2.7', 40 | # 'Programming Language :: Python :: 3.0', 41 | # 'Programming Language :: Python :: 3.1', 42 | ), 43 | ) 44 | -------------------------------------------------------------------------------- /test/django-1.3-skeleton/haystack/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/django-1.3-skeleton/haystack/__init__.py -------------------------------------------------------------------------------- /test/django-1.3-skeleton/haystack/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from django.core.management import execute_manager 3 | import imp 4 | try: 5 | imp.find_module('settings') # Assumed to be in the same directory. 6 | except ImportError: 7 | import sys 8 | sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__) 9 | sys.exit(1) 10 | 11 | import settings 12 | 13 | if __name__ == "__main__": 14 | execute_manager(settings) 15 | -------------------------------------------------------------------------------- /test/django-1.3-skeleton/haystack/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls.defaults import patterns, include, url 2 | 3 | # Uncomment the next two lines to enable the admin: 4 | # from django.contrib import admin 5 | # admin.autodiscover() 6 | 7 | urlpatterns = patterns('', 8 | # Examples: 9 | # url(r'^$', 'haystack.views.home', name='home'), 10 | # url(r'^haystack/', include('haystack.foo.urls')), 11 | 12 | # Uncomment the admin/doc line below to enable admin documentation: 13 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 14 | 15 | # Uncomment the next line to enable the admin: 16 | # url(r'^admin/', include(admin.site.urls)), 17 | ) 18 | -------------------------------------------------------------------------------- /test/django-1.3-skeleton/requirements.txt: -------------------------------------------------------------------------------- 1 | django==1.3 -------------------------------------------------------------------------------- /test/django-1.4-skeleton/haystack/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/django-1.4-skeleton/haystack/.DS_Store -------------------------------------------------------------------------------- /test/django-1.4-skeleton/haystack/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/django-1.4-skeleton/haystack/__init__.py -------------------------------------------------------------------------------- /test/django-1.4-skeleton/haystack/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | 3 | # Uncomment the next two lines to enable the admin: 4 | # from django.contrib import admin 5 | # admin.autodiscover() 6 | 7 | urlpatterns = patterns('', 8 | # Examples: 9 | # url(r'^$', 'haystack.views.home', name='home'), 10 | # url(r'^haystack/', include('haystack.foo.urls')), 11 | 12 | # Uncomment the admin/doc line below to enable admin documentation: 13 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 14 | 15 | # Uncomment the next line to enable the admin: 16 | # url(r'^admin/', include(admin.site.urls)), 17 | ) 18 | -------------------------------------------------------------------------------- /test/django-1.4-skeleton/haystack/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for haystack project. 3 | 4 | This module contains the WSGI application used by Django's development server 5 | and any production WSGI deployments. It should expose a module-level variable 6 | named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover 7 | this application via the ``WSGI_APPLICATION`` setting. 8 | 9 | Usually you will have the standard Django WSGI application here, but it also 10 | might make sense to replace the whole Django WSGI application with a custom one 11 | that later delegates to the Django one. For example, you could introduce WSGI 12 | middleware here, or combine a Django application with an application of another 13 | framework. 14 | 15 | """ 16 | import os 17 | 18 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haystack.settings") 19 | 20 | # This application object is used by any WSGI server configured to use this 21 | # file. This includes Django's development server, if the WSGI_APPLICATION 22 | # setting points here. 23 | from django.core.wsgi import get_wsgi_application 24 | application = get_wsgi_application() 25 | 26 | # Apply WSGI middleware here. 27 | # from helloworld.wsgi import HelloWorldApplication 28 | # application = HelloWorldApplication(application) 29 | -------------------------------------------------------------------------------- /test/django-1.4-skeleton/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haystack.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /test/django-1.4-skeleton/requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.4 -------------------------------------------------------------------------------- /test/django-1.5-skeleton/haystack/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/django-1.5-skeleton/haystack/__init__.py -------------------------------------------------------------------------------- /test/django-1.5-skeleton/haystack/urls.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import patterns, include, url 2 | 3 | # Uncomment the next two lines to enable the admin: 4 | # from django.contrib import admin 5 | # admin.autodiscover() 6 | 7 | urlpatterns = patterns('', 8 | # Examples: 9 | # url(r'^$', 'haystack.views.home', name='home'), 10 | # url(r'^haystack/', include('haystack.foo.urls')), 11 | 12 | # Uncomment the admin/doc line below to enable admin documentation: 13 | # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), 14 | 15 | # Uncomment the next line to enable the admin: 16 | # url(r'^admin/', include(admin.site.urls)), 17 | ) 18 | -------------------------------------------------------------------------------- /test/django-1.5-skeleton/haystack/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for haystack project. 3 | 4 | This module contains the WSGI application used by Django's development server 5 | and any production WSGI deployments. It should expose a module-level variable 6 | named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover 7 | this application via the ``WSGI_APPLICATION`` setting. 8 | 9 | Usually you will have the standard Django WSGI application here, but it also 10 | might make sense to replace the whole Django WSGI application with a custom one 11 | that later delegates to the Django one. For example, you could introduce WSGI 12 | middleware here, or combine a Django application with an application of another 13 | framework. 14 | 15 | """ 16 | import os 17 | 18 | # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks 19 | # if running multiple sites in the same mod_wsgi process. To fix this, use 20 | # mod_wsgi daemon mode with each site in its own daemon process, or use 21 | # os.environ["DJANGO_SETTINGS_MODULE"] = "haystack.settings" 22 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haystack.settings") 23 | 24 | # This application object is used by any WSGI server configured to use this 25 | # file. This includes Django's development server, if the WSGI_APPLICATION 26 | # setting points here. 27 | from django.core.wsgi import get_wsgi_application 28 | application = get_wsgi_application() 29 | 30 | # Apply WSGI middleware here. 31 | # from helloworld.wsgi import HelloWorldApplication 32 | # application = HelloWorldApplication(application) 33 | -------------------------------------------------------------------------------- /test/django-1.5-skeleton/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == "__main__": 6 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haystack.settings") 7 | 8 | from django.core.management import execute_from_command_line 9 | 10 | execute_from_command_line(sys.argv) 11 | -------------------------------------------------------------------------------- /test/django-1.5-skeleton/requirements.txt: -------------------------------------------------------------------------------- 1 | django==1.5 2 | -------------------------------------------------------------------------------- /test/empty-requirements/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/empty-requirements/requirements.txt -------------------------------------------------------------------------------- /test/no-requirements/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | try: 4 | from setuptools import setup 5 | except ImportError: 6 | from distutils.core import setup 7 | 8 | required = ['httpbin'] 9 | 10 | setup( 11 | name='haystack', 12 | version='0.0.1', 13 | description='Simple API for running external processes.', 14 | author='Kenneth Reitz', 15 | author_email='me@kennethreitz.com', 16 | install_requires=required, 17 | license='MIT', 18 | classifiers=( 19 | 'Development Status :: 5 - Production/Stable', 20 | 'Intended Audience :: Developers', 21 | 'Natural Language :: English', 22 | 'License :: OSI Approved :: MIT License', 23 | 'Programming Language :: Python', 24 | 'Programming Language :: Python :: 2.5', 25 | 'Programming Language :: Python :: 2.6', 26 | 'Programming Language :: Python :: 2.7', 27 | # 'Programming Language :: Python :: 3.0', 28 | # 'Programming Language :: Python :: 3.1', 29 | ), 30 | ) 31 | -------------------------------------------------------------------------------- /test/not-django/haystack/settings.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/not-django/haystack/settings.py -------------------------------------------------------------------------------- /test/not-django/manage.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/not-django/manage.py -------------------------------------------------------------------------------- /test/not-django/requirements.txt: -------------------------------------------------------------------------------- 1 | flask==0.8 -------------------------------------------------------------------------------- /test/not-python/Gemfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/test/not-python/Gemfile -------------------------------------------------------------------------------- /test/pylibmc/requirements.txt: -------------------------------------------------------------------------------- 1 | pylibmc 2 | psycopg2 -------------------------------------------------------------------------------- /test/simple-requirements/requirements.txt: -------------------------------------------------------------------------------- 1 | httpbin -------------------------------------------------------------------------------- /test/simple-runtime/requirements.txt: -------------------------------------------------------------------------------- 1 | requests==1.0.3 -------------------------------------------------------------------------------- /test/simple-runtime/runtime.txt: -------------------------------------------------------------------------------- 1 | python-2.7.3 -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/CONTRIBUTORS.txt: -------------------------------------------------------------------------------- 1 | ============ 2 | Contributors 3 | ============ 4 | 5 | * Alex Grönholm 6 | * Alice Bevan-McGregor 7 | * Arfrever Frehtes Taifersar Arahesis 8 | * Christophe Combelles 9 | * Daniel Stutzbach 10 | * Daniel Holth 11 | * Hanno Schlichting 12 | * Jannis Leidel 13 | * Jason R. Coombs 14 | * Jim Fulton 15 | * Jonathan Lange 16 | * Justin Azoff 17 | * Lennart Regebro 18 | * Marc Abramowitz 19 | * Martin von Löwis 20 | * Noufal Ibrahim 21 | * Pete Hollobon 22 | * Philip Jenvey 23 | * Reinout van Rees 24 | * Robert Myers 25 | * Stefan H. Holek 26 | * Tarek Ziadé 27 | * Toshio Kuratomi 28 | 29 | If you think you name is missing, please add it (alpha order by first name) 30 | 31 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/DEVGUIDE.txt: -------------------------------------------------------------------------------- 1 | ============================ 2 | Quick notes for contributors 3 | ============================ 4 | 5 | Distribute is using Mercurial. 6 | 7 | Grab the code at bitbucket:: 8 | 9 | $ hg clone https://bitbucket.org/tarek/distribute 10 | 11 | If you want to contribute changes, we recommend you fork the repository on 12 | bitbucket, commit the changes to your repository, and then make a pull request 13 | on bitbucket. If you make some changes, don't forget to: 14 | 15 | - add a note in CHANGES.txt 16 | 17 | And remember that 0.6 (the only development line) is only bug fixes, and the 18 | APIs should be fully backward compatible with Setuptools. 19 | 20 | You can run the tests via:: 21 | 22 | $ python setup.py test 23 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include setuptools *.py *.txt *.exe 2 | recursive-include tests *.py *.c *.pyx *.txt 3 | recursive-include setuptools/tests *.html 4 | recursive-include docs *.py *.txt *.conf *.css *.css_t Makefile indexsidebar.html 5 | recursive-include _markerlib *.py 6 | include *.py 7 | include *.txt 8 | include MANIFEST.in 9 | include launcher.c 10 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/_markerlib/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ast 3 | from _markerlib.markers import default_environment, compile, interpret 4 | except ImportError: 5 | if 'ast' in globals(): 6 | raise 7 | def default_environment(): 8 | return {} 9 | def compile(marker): 10 | def marker_fn(environment=None, override=None): 11 | # 'empty markers are True' heuristic won't install extra deps. 12 | return not marker.strip() 13 | marker_fn.__doc__ = marker 14 | return marker_fn 15 | def interpret(marker, environment=None, override=None): 16 | return compile(marker)() 17 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/_markerlib/markers.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Interpret PEP 345 environment markers. 3 | 4 | EXPR [in|==|!=|not in] EXPR [or|and] ... 5 | 6 | where EXPR belongs to any of those: 7 | 8 | python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) 9 | python_full_version = sys.version.split()[0] 10 | os.name = os.name 11 | sys.platform = sys.platform 12 | platform.version = platform.version() 13 | platform.machine = platform.machine() 14 | platform.python_implementation = platform.python_implementation() 15 | a free string, like '2.6', or 'win32' 16 | """ 17 | 18 | __all__ = ['default_environment', 'compile', 'interpret'] 19 | 20 | import ast 21 | import os 22 | import platform 23 | import sys 24 | import weakref 25 | 26 | _builtin_compile = compile 27 | 28 | try: 29 | from platform import python_implementation 30 | except ImportError: 31 | if os.name == "java": 32 | # Jython 2.5 has ast module, but not platform.python_implementation() function. 33 | def python_implementation(): 34 | return "Jython" 35 | else: 36 | raise 37 | 38 | 39 | # restricted set of variables 40 | _VARS = {'sys.platform': sys.platform, 41 | 'python_version': '%s.%s' % sys.version_info[:2], 42 | # FIXME parsing sys.platform is not reliable, but there is no other 43 | # way to get e.g. 2.7.2+, and the PEP is defined with sys.version 44 | 'python_full_version': sys.version.split(' ', 1)[0], 45 | 'os.name': os.name, 46 | 'platform.version': platform.version(), 47 | 'platform.machine': platform.machine(), 48 | 'platform.python_implementation': python_implementation(), 49 | 'extra': None # wheel extension 50 | } 51 | 52 | def default_environment(): 53 | """Return copy of default PEP 385 globals dictionary.""" 54 | return dict(_VARS) 55 | 56 | class ASTWhitelist(ast.NodeTransformer): 57 | def __init__(self, statement): 58 | self.statement = statement # for error messages 59 | 60 | ALLOWED = (ast.Compare, ast.BoolOp, ast.Attribute, ast.Name, ast.Load, ast.Str) 61 | # Bool operations 62 | ALLOWED += (ast.And, ast.Or) 63 | # Comparison operations 64 | ALLOWED += (ast.Eq, ast.Gt, ast.GtE, ast.In, ast.Is, ast.IsNot, ast.Lt, ast.LtE, ast.NotEq, ast.NotIn) 65 | 66 | def visit(self, node): 67 | """Ensure statement only contains allowed nodes.""" 68 | if not isinstance(node, self.ALLOWED): 69 | raise SyntaxError('Not allowed in environment markers.\n%s\n%s' % 70 | (self.statement, 71 | (' ' * node.col_offset) + '^')) 72 | return ast.NodeTransformer.visit(self, node) 73 | 74 | def visit_Attribute(self, node): 75 | """Flatten one level of attribute access.""" 76 | new_node = ast.Name("%s.%s" % (node.value.id, node.attr), node.ctx) 77 | return ast.copy_location(new_node, node) 78 | 79 | def parse_marker(marker): 80 | tree = ast.parse(marker, mode='eval') 81 | new_tree = ASTWhitelist(marker).generic_visit(tree) 82 | return new_tree 83 | 84 | def compile_marker(parsed_marker): 85 | return _builtin_compile(parsed_marker, '', 'eval', 86 | dont_inherit=True) 87 | 88 | _cache = weakref.WeakValueDictionary() 89 | 90 | def compile(marker): 91 | """Return compiled marker as a function accepting an environment dict.""" 92 | try: 93 | return _cache[marker] 94 | except KeyError: 95 | pass 96 | if not marker.strip(): 97 | def marker_fn(environment=None, override=None): 98 | """""" 99 | return True 100 | else: 101 | compiled_marker = compile_marker(parse_marker(marker)) 102 | def marker_fn(environment=None, override=None): 103 | """override updates environment""" 104 | if override is None: 105 | override = {} 106 | if environment is None: 107 | environment = default_environment() 108 | environment.update(override) 109 | return eval(compiled_marker, environment) 110 | marker_fn.__doc__ = marker 111 | _cache[marker] = marker_fn 112 | return _cache[marker] 113 | 114 | def interpret(marker, environment=None): 115 | return compile(marker)(environment) 116 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/distribute.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | CHANGES.txt 2 | CONTRIBUTORS.txt 3 | DEVGUIDE.txt 4 | MANIFEST.in 5 | README.txt 6 | distribute_setup.py 7 | easy_install.py 8 | launcher.c 9 | pkg_resources.py 10 | release.py 11 | setup.cfg 12 | setup.py 13 | site.py 14 | _markerlib/__init__.py 15 | _markerlib/markers.py 16 | distribute.egg-info/PKG-INFO 17 | distribute.egg-info/SOURCES.txt 18 | distribute.egg-info/dependency_links.txt 19 | distribute.egg-info/entry_points.txt 20 | distribute.egg-info/top_level.txt 21 | distribute.egg-info/zip-safe 22 | docs/Makefile 23 | docs/conf.py 24 | docs/easy_install.txt 25 | docs/index.txt 26 | docs/pkg_resources.txt 27 | docs/python3.txt 28 | docs/roadmap.txt 29 | docs/setuptools.txt 30 | docs/using.txt 31 | docs/_templates/indexsidebar.html 32 | docs/_theme/nature/theme.conf 33 | docs/_theme/nature/static/nature.css_t 34 | docs/_theme/nature/static/pygments.css 35 | docs/build/html/_sources/easy_install.txt 36 | docs/build/html/_sources/index.txt 37 | docs/build/html/_sources/pkg_resources.txt 38 | docs/build/html/_sources/python3.txt 39 | docs/build/html/_sources/roadmap.txt 40 | docs/build/html/_sources/setuptools.txt 41 | docs/build/html/_sources/using.txt 42 | docs/build/html/_static/basic.css 43 | docs/build/html/_static/nature.css 44 | docs/build/html/_static/pygments.css 45 | setuptools/__init__.py 46 | setuptools/archive_util.py 47 | setuptools/cli-32.exe 48 | setuptools/cli-64.exe 49 | setuptools/cli.exe 50 | setuptools/depends.py 51 | setuptools/dist.py 52 | setuptools/extension.py 53 | setuptools/gui-32.exe 54 | setuptools/gui-64.exe 55 | setuptools/gui.exe 56 | setuptools/package_index.py 57 | setuptools/sandbox.py 58 | setuptools/script template (dev).py 59 | setuptools/script template.py 60 | setuptools/command/__init__.py 61 | setuptools/command/alias.py 62 | setuptools/command/bdist_egg.py 63 | setuptools/command/bdist_rpm.py 64 | setuptools/command/bdist_wininst.py 65 | setuptools/command/build_ext.py 66 | setuptools/command/build_py.py 67 | setuptools/command/develop.py 68 | setuptools/command/easy_install.py 69 | setuptools/command/egg_info.py 70 | setuptools/command/install.py 71 | setuptools/command/install_egg_info.py 72 | setuptools/command/install_lib.py 73 | setuptools/command/install_scripts.py 74 | setuptools/command/register.py 75 | setuptools/command/rotate.py 76 | setuptools/command/saveopts.py 77 | setuptools/command/sdist.py 78 | setuptools/command/setopt.py 79 | setuptools/command/test.py 80 | setuptools/command/upload.py 81 | setuptools/command/upload_docs.py 82 | setuptools/tests/__init__.py 83 | setuptools/tests/doctest.py 84 | setuptools/tests/py26compat.py 85 | setuptools/tests/server.py 86 | setuptools/tests/test_bdist_egg.py 87 | setuptools/tests/test_build_ext.py 88 | setuptools/tests/test_develop.py 89 | setuptools/tests/test_dist_info.py 90 | setuptools/tests/test_easy_install.py 91 | setuptools/tests/test_markerlib.py 92 | setuptools/tests/test_packageindex.py 93 | setuptools/tests/test_resources.py 94 | setuptools/tests/test_sandbox.py 95 | setuptools/tests/test_sdist.py 96 | setuptools/tests/test_test.py 97 | setuptools/tests/test_upload_docs.py 98 | setuptools/tests/win_script_wrapper.txt 99 | setuptools/tests/indexes/test_links_priority/external.html 100 | setuptools/tests/indexes/test_links_priority/simple/foobar/index.html 101 | tests/api_tests.txt 102 | tests/install_test.py 103 | tests/manual_test.py 104 | tests/test_distribute_setup.py 105 | tests/shlib_test/hello.c 106 | tests/shlib_test/hello.pyx 107 | tests/shlib_test/hellolib.c 108 | tests/shlib_test/setup.py 109 | tests/shlib_test/test_hello.py -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/distribute.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/distribute.egg-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | [distutils.commands] 2 | bdist_rpm = setuptools.command.bdist_rpm:bdist_rpm 3 | rotate = setuptools.command.rotate:rotate 4 | develop = setuptools.command.develop:develop 5 | setopt = setuptools.command.setopt:setopt 6 | build_py = setuptools.command.build_py:build_py 7 | saveopts = setuptools.command.saveopts:saveopts 8 | egg_info = setuptools.command.egg_info:egg_info 9 | register = setuptools.command.register:register 10 | upload_docs = setuptools.command.upload_docs:upload_docs 11 | install_egg_info = setuptools.command.install_egg_info:install_egg_info 12 | alias = setuptools.command.alias:alias 13 | easy_install = setuptools.command.easy_install:easy_install 14 | install_scripts = setuptools.command.install_scripts:install_scripts 15 | bdist_wininst = setuptools.command.bdist_wininst:bdist_wininst 16 | bdist_egg = setuptools.command.bdist_egg:bdist_egg 17 | install = setuptools.command.install:install 18 | test = setuptools.command.test:test 19 | install_lib = setuptools.command.install_lib:install_lib 20 | build_ext = setuptools.command.build_ext:build_ext 21 | sdist = setuptools.command.sdist:sdist 22 | 23 | [egg_info.writers] 24 | dependency_links.txt = setuptools.command.egg_info:overwrite_arg 25 | requires.txt = setuptools.command.egg_info:write_requirements 26 | PKG-INFO = setuptools.command.egg_info:write_pkg_info 27 | eager_resources.txt = setuptools.command.egg_info:overwrite_arg 28 | top_level.txt = setuptools.command.egg_info:write_toplevel_names 29 | namespace_packages.txt = setuptools.command.egg_info:overwrite_arg 30 | entry_points.txt = setuptools.command.egg_info:write_entries 31 | depends.txt = setuptools.command.egg_info:warn_depends_obsolete 32 | 33 | [console_scripts] 34 | easy_install = setuptools.command.easy_install:main 35 | easy_install-2.7 = setuptools.command.easy_install:main 36 | 37 | [setuptools.file_finders] 38 | svn_cvs = setuptools.command.sdist:_default_revctrl 39 | 40 | [distutils.setup_keywords] 41 | dependency_links = setuptools.dist:assert_string_list 42 | entry_points = setuptools.dist:check_entry_points 43 | extras_require = setuptools.dist:check_extras 44 | use_2to3_exclude_fixers = setuptools.dist:assert_string_list 45 | package_data = setuptools.dist:check_package_data 46 | install_requires = setuptools.dist:check_requirements 47 | use_2to3 = setuptools.dist:assert_bool 48 | use_2to3_fixers = setuptools.dist:assert_string_list 49 | include_package_data = setuptools.dist:assert_bool 50 | exclude_package_data = setuptools.dist:check_package_data 51 | namespace_packages = setuptools.dist:check_nsp 52 | test_suite = setuptools.dist:check_test_suite 53 | eager_resources = setuptools.dist:assert_string_list 54 | zip_safe = setuptools.dist:assert_bool 55 | test_loader = setuptools.dist:check_importable 56 | packages = setuptools.dist:check_packages 57 | convert_2to3_doctests = setuptools.dist:assert_string_list 58 | tests_require = setuptools.dist:check_requirements 59 | 60 | [setuptools.installation] 61 | eggsecutable = setuptools.command.easy_install:bootstrap 62 | 63 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/distribute.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | _markerlib 2 | easy_install 3 | pkg_resources 4 | setuptools 5 | site 6 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/distribute.egg-info/zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | 9 | # Internal variables. 10 | PAPEROPT_a4 = -D latex_paper_size=a4 11 | PAPEROPT_letter = -D latex_paper_size=letter 12 | ALLSPHINXOPTS = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 13 | 14 | .PHONY: help clean html web pickle htmlhelp latex changes linkcheck 15 | 16 | help: 17 | @echo "Please use \`make ' where is one of" 18 | @echo " html to make standalone HTML files" 19 | @echo " pickle to make pickle files" 20 | @echo " json to make JSON files" 21 | @echo " htmlhelp to make HTML files and a HTML help project" 22 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 23 | @echo " changes to make an overview over all changed/added/deprecated items" 24 | @echo " linkcheck to check all external links for integrity" 25 | 26 | clean: 27 | -rm -rf build/* 28 | 29 | html: 30 | mkdir -p build/html build/doctrees 31 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) build/html 32 | @echo 33 | @echo "Build finished. The HTML pages are in build/html." 34 | 35 | pickle: 36 | mkdir -p build/pickle build/doctrees 37 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) build/pickle 38 | @echo 39 | @echo "Build finished; now you can process the pickle files." 40 | 41 | web: pickle 42 | 43 | json: 44 | mkdir -p build/json build/doctrees 45 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) build/json 46 | @echo 47 | @echo "Build finished; now you can process the JSON files." 48 | 49 | htmlhelp: 50 | mkdir -p build/htmlhelp build/doctrees 51 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) build/htmlhelp 52 | @echo 53 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 54 | ".hhp project file in build/htmlhelp." 55 | 56 | latex: 57 | mkdir -p build/latex build/doctrees 58 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex 59 | @echo 60 | @echo "Build finished; the LaTeX files are in build/latex." 61 | @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ 62 | "run these through (pdf)latex." 63 | 64 | changes: 65 | mkdir -p build/changes build/doctrees 66 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) build/changes 67 | @echo 68 | @echo "The overview file is in build/changes." 69 | 70 | linkcheck: 71 | mkdir -p build/linkcheck build/doctrees 72 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) build/linkcheck 73 | @echo 74 | @echo "Link check complete; look for any errors in the above output " \ 75 | "or in build/linkcheck/output.txt." 76 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/_templates/indexsidebar.html: -------------------------------------------------------------------------------- 1 |

Download

2 | 3 |

Current version: {{ version }}

4 |

Get Distribute from the Python Package Index 5 | 6 |

Questions? Suggestions? Contributions?

7 | 8 |

Visit the Distribute project page

9 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/_theme/nature/static/nature.css_t: -------------------------------------------------------------------------------- 1 | /** 2 | * Sphinx stylesheet -- default theme 3 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | */ 5 | 6 | @import url("basic.css"); 7 | 8 | /* -- page layout ----------------------------------------------------------- */ 9 | 10 | body { 11 | font-family: Arial, sans-serif; 12 | font-size: 100%; 13 | background-color: #111111; 14 | color: #555555; 15 | margin: 0; 16 | padding: 0; 17 | } 18 | 19 | div.documentwrapper { 20 | float: left; 21 | width: 100%; 22 | } 23 | 24 | div.bodywrapper { 25 | margin: 0 0 0 300px; 26 | } 27 | 28 | hr{ 29 | border: 1px solid #B1B4B6; 30 | } 31 | 32 | div.document { 33 | background-color: #fafafa; 34 | } 35 | 36 | div.body { 37 | background-color: #ffffff; 38 | color: #3E4349; 39 | padding: 1em 30px 30px 30px; 40 | font-size: 0.9em; 41 | } 42 | 43 | div.footer { 44 | color: #555; 45 | width: 100%; 46 | padding: 13px 0; 47 | text-align: center; 48 | font-size: 75%; 49 | } 50 | 51 | div.footer a { 52 | color: #444444; 53 | } 54 | 55 | div.related { 56 | background-color: #6BA81E; 57 | line-height: 36px; 58 | color: #ffffff; 59 | text-shadow: 0px 1px 0 #444444; 60 | font-size: 1.1em; 61 | } 62 | 63 | div.related a { 64 | color: #E2F3CC; 65 | } 66 | 67 | div.related .right { 68 | font-size: 0.9em; 69 | } 70 | 71 | div.sphinxsidebar { 72 | font-size: 0.9em; 73 | line-height: 1.5em; 74 | width: 300px; 75 | } 76 | 77 | div.sphinxsidebarwrapper{ 78 | padding: 20px 0; 79 | } 80 | 81 | div.sphinxsidebar h3, 82 | div.sphinxsidebar h4 { 83 | font-family: Arial, sans-serif; 84 | color: #222222; 85 | font-size: 1.2em; 86 | font-weight: bold; 87 | margin: 0; 88 | padding: 5px 10px; 89 | text-shadow: 1px 1px 0 white 90 | } 91 | 92 | div.sphinxsidebar h3 a { 93 | color: #444444; 94 | } 95 | 96 | div.sphinxsidebar p { 97 | color: #888888; 98 | padding: 5px 20px; 99 | margin: 0.5em 0px; 100 | } 101 | 102 | div.sphinxsidebar p.topless { 103 | } 104 | 105 | div.sphinxsidebar ul { 106 | margin: 10px 10px 10px 20px; 107 | padding: 0; 108 | color: #000000; 109 | } 110 | 111 | div.sphinxsidebar a { 112 | color: #444444; 113 | } 114 | 115 | div.sphinxsidebar a:hover { 116 | color: #E32E00; 117 | } 118 | 119 | div.sphinxsidebar input { 120 | border: 1px solid #cccccc; 121 | font-family: sans-serif; 122 | font-size: 1.1em; 123 | padding: 0.15em 0.3em; 124 | } 125 | 126 | div.sphinxsidebar input[type=text]{ 127 | margin-left: 20px; 128 | } 129 | 130 | /* -- body styles ----------------------------------------------------------- */ 131 | 132 | a { 133 | color: #005B81; 134 | text-decoration: none; 135 | } 136 | 137 | a:hover { 138 | color: #E32E00; 139 | } 140 | 141 | div.body h1, 142 | div.body h2, 143 | div.body h3, 144 | div.body h4, 145 | div.body h5, 146 | div.body h6 { 147 | font-family: Arial, sans-serif; 148 | font-weight: normal; 149 | color: #212224; 150 | margin: 30px 0px 10px 0px; 151 | padding: 5px 0 5px 0px; 152 | text-shadow: 0px 1px 0 white; 153 | border-bottom: 1px solid #C8D5E3; 154 | } 155 | 156 | div.body h1 { margin-top: 0; font-size: 200%; } 157 | div.body h2 { font-size: 150%; } 158 | div.body h3 { font-size: 120%; } 159 | div.body h4 { font-size: 110%; } 160 | div.body h5 { font-size: 100%; } 161 | div.body h6 { font-size: 100%; } 162 | 163 | a.headerlink { 164 | color: #c60f0f; 165 | font-size: 0.8em; 166 | padding: 0 4px 0 4px; 167 | text-decoration: none; 168 | } 169 | 170 | a.headerlink:hover { 171 | background-color: #c60f0f; 172 | color: white; 173 | } 174 | 175 | div.body p, div.body dd, div.body li { 176 | line-height: 1.8em; 177 | } 178 | 179 | div.admonition p.admonition-title + p { 180 | display: inline; 181 | } 182 | 183 | div.highlight{ 184 | background-color: white; 185 | } 186 | 187 | div.note { 188 | background-color: #eeeeee; 189 | border: 1px solid #cccccc; 190 | } 191 | 192 | div.seealso { 193 | background-color: #ffffcc; 194 | border: 1px solid #ffff66; 195 | } 196 | 197 | div.topic { 198 | background-color: #fafafa; 199 | border-width: 0; 200 | } 201 | 202 | div.warning { 203 | background-color: #ffe4e4; 204 | border: 1px solid #ff6666; 205 | } 206 | 207 | p.admonition-title { 208 | display: inline; 209 | } 210 | 211 | p.admonition-title:after { 212 | content: ":"; 213 | } 214 | 215 | pre { 216 | padding: 10px; 217 | background-color: #fafafa; 218 | color: #222222; 219 | line-height: 1.5em; 220 | font-size: 1.1em; 221 | margin: 1.5em 0 1.5em 0; 222 | -webkit-box-shadow: 0px 0px 4px #d8d8d8; 223 | -moz-box-shadow: 0px 0px 4px #d8d8d8; 224 | box-shadow: 0px 0px 4px #d8d8d8; 225 | } 226 | 227 | tt { 228 | color: #222222; 229 | padding: 1px 2px; 230 | font-size: 1.2em; 231 | font-family: monospace; 232 | } 233 | 234 | #table-of-contents ul { 235 | padding-left: 2em; 236 | } 237 | 238 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/_theme/nature/static/pygments.css: -------------------------------------------------------------------------------- 1 | .c { color: #999988; font-style: italic } /* Comment */ 2 | .k { font-weight: bold } /* Keyword */ 3 | .o { font-weight: bold } /* Operator */ 4 | .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 5 | .cp { color: #999999; font-weight: bold } /* Comment.preproc */ 6 | .c1 { color: #999988; font-style: italic } /* Comment.Single */ 7 | .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 8 | .ge { font-style: italic } /* Generic.Emph */ 9 | .gr { color: #aa0000 } /* Generic.Error */ 10 | .gh { color: #999999 } /* Generic.Heading */ 11 | .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 12 | .go { color: #111 } /* Generic.Output */ 13 | .gp { color: #555555 } /* Generic.Prompt */ 14 | .gs { font-weight: bold } /* Generic.Strong */ 15 | .gu { color: #aaaaaa } /* Generic.Subheading */ 16 | .gt { color: #aa0000 } /* Generic.Traceback */ 17 | .kc { font-weight: bold } /* Keyword.Constant */ 18 | .kd { font-weight: bold } /* Keyword.Declaration */ 19 | .kp { font-weight: bold } /* Keyword.Pseudo */ 20 | .kr { font-weight: bold } /* Keyword.Reserved */ 21 | .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 22 | .m { color: #009999 } /* Literal.Number */ 23 | .s { color: #bb8844 } /* Literal.String */ 24 | .na { color: #008080 } /* Name.Attribute */ 25 | .nb { color: #999999 } /* Name.Builtin */ 26 | .nc { color: #445588; font-weight: bold } /* Name.Class */ 27 | .no { color: #ff99ff } /* Name.Constant */ 28 | .ni { color: #800080 } /* Name.Entity */ 29 | .ne { color: #990000; font-weight: bold } /* Name.Exception */ 30 | .nf { color: #990000; font-weight: bold } /* Name.Function */ 31 | .nn { color: #555555 } /* Name.Namespace */ 32 | .nt { color: #000080 } /* Name.Tag */ 33 | .nv { color: purple } /* Name.Variable */ 34 | .ow { font-weight: bold } /* Operator.Word */ 35 | .mf { color: #009999 } /* Literal.Number.Float */ 36 | .mh { color: #009999 } /* Literal.Number.Hex */ 37 | .mi { color: #009999 } /* Literal.Number.Integer */ 38 | .mo { color: #009999 } /* Literal.Number.Oct */ 39 | .sb { color: #bb8844 } /* Literal.String.Backtick */ 40 | .sc { color: #bb8844 } /* Literal.String.Char */ 41 | .sd { color: #bb8844 } /* Literal.String.Doc */ 42 | .s2 { color: #bb8844 } /* Literal.String.Double */ 43 | .se { color: #bb8844 } /* Literal.String.Escape */ 44 | .sh { color: #bb8844 } /* Literal.String.Heredoc */ 45 | .si { color: #bb8844 } /* Literal.String.Interpol */ 46 | .sx { color: #bb8844 } /* Literal.String.Other */ 47 | .sr { color: #808000 } /* Literal.String.Regex */ 48 | .s1 { color: #bb8844 } /* Literal.String.Single */ 49 | .ss { color: #bb8844 } /* Literal.String.Symbol */ 50 | .bp { color: #999999 } /* Name.Builtin.Pseudo */ 51 | .vc { color: #ff99ff } /* Name.Variable.Class */ 52 | .vg { color: #ff99ff } /* Name.Variable.Global */ 53 | .vi { color: #ff99ff } /* Name.Variable.Instance */ 54 | .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/_theme/nature/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = nature.css 4 | pygments_style = tango 5 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/build/html/_sources/index.txt: -------------------------------------------------------------------------------- 1 | Welcome to Distribute's documentation! 2 | ====================================== 3 | 4 | `Distribute` is a fork of the `Setuptools` project. 5 | 6 | Distribute is intended to replace Setuptools as the standard method for 7 | working with Python module distributions. 8 | 9 | For those who may wonder why they should switch to Distribute over Setuptools, it’s quite simple: 10 | 11 | - Distribute is a drop-in replacement for Setuptools 12 | - The code is actively maintained, and has over 10 commiters 13 | - Distribute offers Python 3 support ! 14 | 15 | Documentation content: 16 | 17 | .. toctree:: 18 | :maxdepth: 2 19 | 20 | roadmap 21 | python3 22 | using 23 | setuptools 24 | easy_install 25 | pkg_resources 26 | 27 | 28 | .. image:: http://python-distribute.org/pip_distribute.png 29 | 30 | Design done by Idan Gazit (http://pixane.com) - License: cc-by-3.0 31 | 32 | Copy & paste:: 33 | 34 | curl -O http://python-distribute.org/distribute_setup.py 35 | python distribute_setup.py 36 | easy_install pip -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/build/html/_sources/roadmap.txt: -------------------------------------------------------------------------------- 1 | ======= 2 | Roadmap 3 | ======= 4 | 5 | Distribute has two branches: 6 | 7 | - 0.6.x : provides a Setuptools-0.6cX compatible version 8 | - 0.7.x : will provide a refactoring 9 | 10 | 0.6.x 11 | ===== 12 | 13 | Not "much" is going to happen here, we want this branch to be helpful 14 | to the community *today* by addressing the 40-or-so bugs 15 | that were found in Setuptools and never fixed. This is eventually 16 | happen soon because its development is 17 | fast : there are up to 5 commiters that are working on it very often 18 | (and the number grows weekly.) 19 | 20 | The biggest issue with this branch is that it is providing the same 21 | packages and modules setuptools does, and this 22 | requires some bootstrapping work where we make sure once Distribute is 23 | installed, all Distribution that requires Setuptools 24 | will continue to work. This is done by faking the metadata of 25 | Setuptools 0.6c9. That's the only way we found to do this. 26 | 27 | There's one major thing though: thanks to the work of Lennart, Alex, 28 | Martin, this branch supports Python 3, 29 | which is great to have to speed up Py3 adoption. 30 | 31 | The goal of the 0.6.x is to remove as much bugs as we can, and try if 32 | possible to remove the patches done 33 | on Distutils. We will support 0.6.x maintenance for years and we will 34 | promote its usage everywhere instead of 35 | Setuptools. 36 | 37 | Some new commands are added there, when they are helpful and don't 38 | interact with the rest. I am thinking 39 | about "upload_docs" that let you upload documentation to PyPI. The 40 | goal is to move it to Distutils 41 | at some point, if the documentation feature of PyPI stays and starts to be used. 42 | 43 | 0.7.x 44 | ===== 45 | 46 | We've started to refactor Distribute with this roadmap in mind (and 47 | no, as someone said, it's not vaporware, 48 | we've done a lot already) 49 | 50 | - 0.7.x can be installed and used with 0.6.x 51 | 52 | - easy_install is going to be deprecated ! use Pip ! 53 | 54 | - the version system will be deprecated, in favor of the one in Distutils 55 | 56 | - no more Distutils monkey-patch that happens once you use the code 57 | (things like 'from distutils import cmd; cmd.Command = CustomCommand') 58 | 59 | - no more custom site.py (that is: if something misses in Python's 60 | site.py we'll add it there instead of patching it) 61 | 62 | - no more namespaced packages system, if PEP 382 (namespaces package 63 | support) makes it to 2.7 64 | 65 | - The code is splitted in many packages and might be distributed under 66 | several distributions. 67 | 68 | - distribute.resources: that's the old pkg_resources, but 69 | reorganized in clean, pep-8 modules. This package will 70 | only contain the query APIs and will focus on being PEP 376 71 | compatible. We will promote its usage and see if Pip wants 72 | to use it as a basis. 73 | It will probably shrink a lot though, once the stdlib provides PEP 376 support. 74 | 75 | - distribute.entrypoints: that's the old pkg_resources entry points 76 | system, but on its own. it uses distribute.resources 77 | 78 | - distribute.index: that's package_index and a few other things. 79 | everything required to interact with PyPI. We will promote 80 | its usage and see if Pip wants to use it as a basis. 81 | 82 | - distribute.core (might be renamed to main): that's everything 83 | else, and uses the other packages. 84 | 85 | Goal: A first release before (or when) Python 2.7 / 3.2 is out. 86 | 87 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/build/html/_sources/using.txt: -------------------------------------------------------------------------------- 1 | ================================ 2 | Using Distribute in your project 3 | ================================ 4 | 5 | To use Distribute in your project, the recommended way is to ship 6 | `distribute_setup.py` alongside your `setup.py` script and call 7 | it at the very begining of `setup.py` like this:: 8 | 9 | from distribute_setup import use_setuptools 10 | use_setuptools() 11 | 12 | Another way is to add ``Distribute`` in the ``install_requires`` option:: 13 | 14 | from setuptools import setup 15 | 16 | setup(... 17 | install_requires=['distribute'] 18 | ) 19 | 20 | 21 | XXX to be finished 22 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/build/html/_static/nature.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Sphinx stylesheet -- default theme 3 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 | */ 5 | 6 | @import url("basic.css"); 7 | 8 | /* -- page layout ----------------------------------------------------------- */ 9 | 10 | body { 11 | font-family: Arial, sans-serif; 12 | font-size: 100%; 13 | background-color: #111111; 14 | color: #555555; 15 | margin: 0; 16 | padding: 0; 17 | } 18 | 19 | div.documentwrapper { 20 | float: left; 21 | width: 100%; 22 | } 23 | 24 | div.bodywrapper { 25 | margin: 0 0 0 300px; 26 | } 27 | 28 | hr{ 29 | border: 1px solid #B1B4B6; 30 | } 31 | 32 | div.document { 33 | background-color: #fafafa; 34 | } 35 | 36 | div.body { 37 | background-color: #ffffff; 38 | color: #3E4349; 39 | padding: 1em 30px 30px 30px; 40 | font-size: 0.9em; 41 | } 42 | 43 | div.footer { 44 | color: #555; 45 | width: 100%; 46 | padding: 13px 0; 47 | text-align: center; 48 | font-size: 75%; 49 | } 50 | 51 | div.footer a { 52 | color: #444444; 53 | } 54 | 55 | div.related { 56 | background-color: #6BA81E; 57 | line-height: 36px; 58 | color: #ffffff; 59 | text-shadow: 0px 1px 0 #444444; 60 | font-size: 1.1em; 61 | } 62 | 63 | div.related a { 64 | color: #E2F3CC; 65 | } 66 | 67 | div.related .right { 68 | font-size: 0.9em; 69 | } 70 | 71 | div.sphinxsidebar { 72 | font-size: 0.9em; 73 | line-height: 1.5em; 74 | width: 300px; 75 | } 76 | 77 | div.sphinxsidebarwrapper{ 78 | padding: 20px 0; 79 | } 80 | 81 | div.sphinxsidebar h3, 82 | div.sphinxsidebar h4 { 83 | font-family: Arial, sans-serif; 84 | color: #222222; 85 | font-size: 1.2em; 86 | font-weight: bold; 87 | margin: 0; 88 | padding: 5px 10px; 89 | text-shadow: 1px 1px 0 white 90 | } 91 | 92 | div.sphinxsidebar h3 a { 93 | color: #444444; 94 | } 95 | 96 | div.sphinxsidebar p { 97 | color: #888888; 98 | padding: 5px 20px; 99 | margin: 0.5em 0px; 100 | } 101 | 102 | div.sphinxsidebar p.topless { 103 | } 104 | 105 | div.sphinxsidebar ul { 106 | margin: 10px 10px 10px 20px; 107 | padding: 0; 108 | color: #000000; 109 | } 110 | 111 | div.sphinxsidebar a { 112 | color: #444444; 113 | } 114 | 115 | div.sphinxsidebar a:hover { 116 | color: #E32E00; 117 | } 118 | 119 | div.sphinxsidebar input { 120 | border: 1px solid #cccccc; 121 | font-family: sans-serif; 122 | font-size: 1.1em; 123 | padding: 0.15em 0.3em; 124 | } 125 | 126 | div.sphinxsidebar input[type=text]{ 127 | margin-left: 20px; 128 | } 129 | 130 | /* -- body styles ----------------------------------------------------------- */ 131 | 132 | a { 133 | color: #005B81; 134 | text-decoration: none; 135 | } 136 | 137 | a:hover { 138 | color: #E32E00; 139 | } 140 | 141 | div.body h1, 142 | div.body h2, 143 | div.body h3, 144 | div.body h4, 145 | div.body h5, 146 | div.body h6 { 147 | font-family: Arial, sans-serif; 148 | font-weight: normal; 149 | color: #212224; 150 | margin: 30px 0px 10px 0px; 151 | padding: 5px 0 5px 0px; 152 | text-shadow: 0px 1px 0 white; 153 | border-bottom: 1px solid #C8D5E3; 154 | } 155 | 156 | div.body h1 { margin-top: 0; font-size: 200%; } 157 | div.body h2 { font-size: 150%; } 158 | div.body h3 { font-size: 120%; } 159 | div.body h4 { font-size: 110%; } 160 | div.body h5 { font-size: 100%; } 161 | div.body h6 { font-size: 100%; } 162 | 163 | a.headerlink { 164 | color: #c60f0f; 165 | font-size: 0.8em; 166 | padding: 0 4px 0 4px; 167 | text-decoration: none; 168 | } 169 | 170 | a.headerlink:hover { 171 | background-color: #c60f0f; 172 | color: white; 173 | } 174 | 175 | div.body p, div.body dd, div.body li { 176 | line-height: 1.8em; 177 | } 178 | 179 | div.admonition p.admonition-title + p { 180 | display: inline; 181 | } 182 | 183 | div.highlight{ 184 | background-color: white; 185 | } 186 | 187 | div.note { 188 | background-color: #eeeeee; 189 | border: 1px solid #cccccc; 190 | } 191 | 192 | div.seealso { 193 | background-color: #ffffcc; 194 | border: 1px solid #ffff66; 195 | } 196 | 197 | div.topic { 198 | background-color: #fafafa; 199 | border-width: 0; 200 | } 201 | 202 | div.warning { 203 | background-color: #ffe4e4; 204 | border: 1px solid #ff6666; 205 | } 206 | 207 | p.admonition-title { 208 | display: inline; 209 | } 210 | 211 | p.admonition-title:after { 212 | content: ":"; 213 | } 214 | 215 | pre { 216 | padding: 10px; 217 | background-color: #fafafa; 218 | color: #222222; 219 | line-height: 1.5em; 220 | font-size: 1.1em; 221 | margin: 1.5em 0 1.5em 0; 222 | -webkit-box-shadow: 0px 0px 4px #d8d8d8; 223 | -moz-box-shadow: 0px 0px 4px #d8d8d8; 224 | box-shadow: 0px 0px 4px #d8d8d8; 225 | } 226 | 227 | tt { 228 | color: #222222; 229 | padding: 1px 2px; 230 | font-size: 1.2em; 231 | font-family: monospace; 232 | } 233 | 234 | #table-of-contents ul { 235 | padding-left: 2em; 236 | } 237 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/build/html/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .c { color: #999988; font-style: italic } /* Comment */ 2 | .k { font-weight: bold } /* Keyword */ 3 | .o { font-weight: bold } /* Operator */ 4 | .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 5 | .cp { color: #999999; font-weight: bold } /* Comment.preproc */ 6 | .c1 { color: #999988; font-style: italic } /* Comment.Single */ 7 | .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 8 | .ge { font-style: italic } /* Generic.Emph */ 9 | .gr { color: #aa0000 } /* Generic.Error */ 10 | .gh { color: #999999 } /* Generic.Heading */ 11 | .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 12 | .go { color: #111 } /* Generic.Output */ 13 | .gp { color: #555555 } /* Generic.Prompt */ 14 | .gs { font-weight: bold } /* Generic.Strong */ 15 | .gu { color: #aaaaaa } /* Generic.Subheading */ 16 | .gt { color: #aa0000 } /* Generic.Traceback */ 17 | .kc { font-weight: bold } /* Keyword.Constant */ 18 | .kd { font-weight: bold } /* Keyword.Declaration */ 19 | .kp { font-weight: bold } /* Keyword.Pseudo */ 20 | .kr { font-weight: bold } /* Keyword.Reserved */ 21 | .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 22 | .m { color: #009999 } /* Literal.Number */ 23 | .s { color: #bb8844 } /* Literal.String */ 24 | .na { color: #008080 } /* Name.Attribute */ 25 | .nb { color: #999999 } /* Name.Builtin */ 26 | .nc { color: #445588; font-weight: bold } /* Name.Class */ 27 | .no { color: #ff99ff } /* Name.Constant */ 28 | .ni { color: #800080 } /* Name.Entity */ 29 | .ne { color: #990000; font-weight: bold } /* Name.Exception */ 30 | .nf { color: #990000; font-weight: bold } /* Name.Function */ 31 | .nn { color: #555555 } /* Name.Namespace */ 32 | .nt { color: #000080 } /* Name.Tag */ 33 | .nv { color: purple } /* Name.Variable */ 34 | .ow { font-weight: bold } /* Operator.Word */ 35 | .mf { color: #009999 } /* Literal.Number.Float */ 36 | .mh { color: #009999 } /* Literal.Number.Hex */ 37 | .mi { color: #009999 } /* Literal.Number.Integer */ 38 | .mo { color: #009999 } /* Literal.Number.Oct */ 39 | .sb { color: #bb8844 } /* Literal.String.Backtick */ 40 | .sc { color: #bb8844 } /* Literal.String.Char */ 41 | .sd { color: #bb8844 } /* Literal.String.Doc */ 42 | .s2 { color: #bb8844 } /* Literal.String.Double */ 43 | .se { color: #bb8844 } /* Literal.String.Escape */ 44 | .sh { color: #bb8844 } /* Literal.String.Heredoc */ 45 | .si { color: #bb8844 } /* Literal.String.Interpol */ 46 | .sx { color: #bb8844 } /* Literal.String.Other */ 47 | .sr { color: #808000 } /* Literal.String.Regex */ 48 | .s1 { color: #bb8844 } /* Literal.String.Single */ 49 | .ss { color: #bb8844 } /* Literal.String.Symbol */ 50 | .bp { color: #999999 } /* Name.Builtin.Pseudo */ 51 | .vc { color: #ff99ff } /* Name.Variable.Class */ 52 | .vg { color: #ff99ff } /* Name.Variable.Global */ 53 | .vi { color: #ff99ff } /* Name.Variable.Instance */ 54 | .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/index.txt: -------------------------------------------------------------------------------- 1 | Welcome to Distribute's documentation! 2 | ====================================== 3 | 4 | `Distribute` is a fork of the `Setuptools` project. 5 | 6 | Distribute is intended to replace Setuptools as the standard method for 7 | working with Python module distributions. 8 | 9 | For those who may wonder why they should switch to Distribute over Setuptools, it’s quite simple: 10 | 11 | - Distribute is a drop-in replacement for Setuptools 12 | - The code is actively maintained, and has over 10 commiters 13 | - Distribute offers Python 3 support ! 14 | 15 | Documentation content: 16 | 17 | .. toctree:: 18 | :maxdepth: 2 19 | 20 | roadmap 21 | python3 22 | using 23 | setuptools 24 | easy_install 25 | pkg_resources 26 | 27 | 28 | .. image:: http://python-distribute.org/pip_distribute.png 29 | 30 | Design done by Idan Gazit (http://pixane.com) - License: cc-by-3.0 31 | 32 | Copy & paste:: 33 | 34 | curl -O http://python-distribute.org/distribute_setup.py 35 | python distribute_setup.py 36 | easy_install pip -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/roadmap.txt: -------------------------------------------------------------------------------- 1 | ======= 2 | Roadmap 3 | ======= 4 | 5 | Distribute has two branches: 6 | 7 | - 0.6.x : provides a Setuptools-0.6cX compatible version 8 | - 0.7.x : will provide a refactoring 9 | 10 | 0.6.x 11 | ===== 12 | 13 | Not "much" is going to happen here, we want this branch to be helpful 14 | to the community *today* by addressing the 40-or-so bugs 15 | that were found in Setuptools and never fixed. This is eventually 16 | happen soon because its development is 17 | fast : there are up to 5 commiters that are working on it very often 18 | (and the number grows weekly.) 19 | 20 | The biggest issue with this branch is that it is providing the same 21 | packages and modules setuptools does, and this 22 | requires some bootstrapping work where we make sure once Distribute is 23 | installed, all Distribution that requires Setuptools 24 | will continue to work. This is done by faking the metadata of 25 | Setuptools 0.6c9. That's the only way we found to do this. 26 | 27 | There's one major thing though: thanks to the work of Lennart, Alex, 28 | Martin, this branch supports Python 3, 29 | which is great to have to speed up Py3 adoption. 30 | 31 | The goal of the 0.6.x is to remove as much bugs as we can, and try if 32 | possible to remove the patches done 33 | on Distutils. We will support 0.6.x maintenance for years and we will 34 | promote its usage everywhere instead of 35 | Setuptools. 36 | 37 | Some new commands are added there, when they are helpful and don't 38 | interact with the rest. I am thinking 39 | about "upload_docs" that let you upload documentation to PyPI. The 40 | goal is to move it to Distutils 41 | at some point, if the documentation feature of PyPI stays and starts to be used. 42 | 43 | 0.7.x 44 | ===== 45 | 46 | We've started to refactor Distribute with this roadmap in mind (and 47 | no, as someone said, it's not vaporware, 48 | we've done a lot already) 49 | 50 | - 0.7.x can be installed and used with 0.6.x 51 | 52 | - easy_install is going to be deprecated ! use Pip ! 53 | 54 | - the version system will be deprecated, in favor of the one in Distutils 55 | 56 | - no more Distutils monkey-patch that happens once you use the code 57 | (things like 'from distutils import cmd; cmd.Command = CustomCommand') 58 | 59 | - no more custom site.py (that is: if something misses in Python's 60 | site.py we'll add it there instead of patching it) 61 | 62 | - no more namespaced packages system, if PEP 382 (namespaces package 63 | support) makes it to 2.7 64 | 65 | - The code is splitted in many packages and might be distributed under 66 | several distributions. 67 | 68 | - distribute.resources: that's the old pkg_resources, but 69 | reorganized in clean, pep-8 modules. This package will 70 | only contain the query APIs and will focus on being PEP 376 71 | compatible. We will promote its usage and see if Pip wants 72 | to use it as a basis. 73 | It will probably shrink a lot though, once the stdlib provides PEP 376 support. 74 | 75 | - distribute.entrypoints: that's the old pkg_resources entry points 76 | system, but on its own. it uses distribute.resources 77 | 78 | - distribute.index: that's package_index and a few other things. 79 | everything required to interact with PyPI. We will promote 80 | its usage and see if Pip wants to use it as a basis. 81 | 82 | - distribute.core (might be renamed to main): that's everything 83 | else, and uses the other packages. 84 | 85 | Goal: A first release before (or when) Python 2.7 / 3.2 is out. 86 | 87 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/docs/using.txt: -------------------------------------------------------------------------------- 1 | ================================ 2 | Using Distribute in your project 3 | ================================ 4 | 5 | To use Distribute in your project, the recommended way is to ship 6 | `distribute_setup.py` alongside your `setup.py` script and call 7 | it at the very begining of `setup.py` like this:: 8 | 9 | from distribute_setup import use_setuptools 10 | use_setuptools() 11 | 12 | Another way is to add ``Distribute`` in the ``install_requires`` option:: 13 | 14 | from setuptools import setup 15 | 16 | setup(... 17 | install_requires=['distribute'] 18 | ) 19 | 20 | 21 | XXX to be finished 22 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/easy_install.py: -------------------------------------------------------------------------------- 1 | """Run the EasyInstall command""" 2 | 3 | if __name__ == '__main__': 4 | from setuptools.command.easy_install import main 5 | main() 6 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/release.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | Script to fully automate the release process. Requires Python 2.6+ 5 | with sphinx installed and the 'hg' command on the path. 6 | """ 7 | 8 | from __future__ import print_function 9 | 10 | import subprocess 11 | import shutil 12 | import os 13 | import sys 14 | import urllib2 15 | import getpass 16 | import collections 17 | 18 | try: 19 | import keyring 20 | except Exception: 21 | pass 22 | 23 | VERSION = '0.6.36' 24 | 25 | def get_next_version(): 26 | digits = map(int, VERSION.split('.')) 27 | digits[-1] += 1 28 | return '.'.join(map(str, digits)) 29 | 30 | NEXT_VERSION = get_next_version() 31 | 32 | files_with_versions = ('docs/conf.py', 'setup.py', 'release.py', 33 | 'README.txt', 'distribute_setup.py') 34 | 35 | def get_repo_name(): 36 | """ 37 | Get the repo name from the hgrc default path. 38 | """ 39 | default = subprocess.check_output('hg paths default').strip() 40 | parts = default.split('/') 41 | if parts[-1] == '': 42 | parts.pop() 43 | return '/'.join(parts[-2:]) 44 | 45 | def get_mercurial_creds(system='https://bitbucket.org', username=None): 46 | """ 47 | Return named tuple of username,password in much the same way that 48 | Mercurial would (from the keyring). 49 | """ 50 | # todo: consider getting this from .hgrc 51 | username = username or getpass.getuser() 52 | keyring_username = '@@'.join((username, system)) 53 | system = 'Mercurial' 54 | password = ( 55 | keyring.get_password(system, keyring_username) 56 | if 'keyring' in globals() 57 | else None 58 | ) 59 | if not password: 60 | password = getpass.getpass() 61 | Credential = collections.namedtuple('Credential', 'username password') 62 | return Credential(username, password) 63 | 64 | def add_milestone_and_version(version=NEXT_VERSION): 65 | auth = 'Basic ' + ':'.join(get_mercurial_creds()).encode('base64').strip() 66 | headers = { 67 | 'Authorization': auth, 68 | } 69 | base = 'https://api.bitbucket.org' 70 | for type in 'milestones', 'versions': 71 | url = (base + '/1.0/repositories/{repo}/issues/{type}' 72 | .format(repo = get_repo_name(), type=type)) 73 | req = urllib2.Request(url = url, headers = headers, 74 | data='name='+version) 75 | try: 76 | urllib2.urlopen(req) 77 | except urllib2.HTTPError as e: 78 | print(e.fp.read()) 79 | 80 | def bump_versions(): 81 | list(map(bump_version, files_with_versions)) 82 | 83 | def bump_version(filename): 84 | with open(filename, 'rb') as f: 85 | lines = [line.replace(VERSION, NEXT_VERSION) for line in f] 86 | with open(filename, 'wb') as f: 87 | f.writelines(lines) 88 | 89 | def do_release(): 90 | assert all(map(os.path.exists, files_with_versions)), ( 91 | "Expected file(s) missing") 92 | 93 | assert has_sphinx(), "You must have Sphinx installed to release" 94 | 95 | res = raw_input('Have you read through the SCM changelog and ' 96 | 'confirmed the changelog is current for releasing {VERSION}? ' 97 | .format(**globals())) 98 | if not res.lower().startswith('y'): 99 | print("Please do that") 100 | raise SystemExit(1) 101 | 102 | print("Travis-CI tests: http://travis-ci.org/#!/jaraco/distribute") 103 | res = raw_input('Have you or has someone verified that the tests ' 104 | 'pass on this revision? ') 105 | if not res.lower().startswith('y'): 106 | print("Please do that") 107 | raise SystemExit(2) 108 | 109 | subprocess.check_call(['hg', 'tag', VERSION]) 110 | 111 | subprocess.check_call(['hg', 'update', VERSION]) 112 | 113 | has_docs = build_docs() 114 | if os.path.isdir('./dist'): 115 | shutil.rmtree('./dist') 116 | cmd = [sys.executable, 'setup.py', '-q', 'egg_info', '-RD', '-b', '', 117 | 'sdist', 'register', 'upload'] 118 | if has_docs: 119 | cmd.append('upload_docs') 120 | subprocess.check_call(cmd) 121 | upload_bootstrap_script() 122 | 123 | # update to the tip for the next operation 124 | subprocess.check_call(['hg', 'update']) 125 | 126 | # we just tagged the current version, bump for the next release. 127 | bump_versions() 128 | subprocess.check_call(['hg', 'ci', '-m', 129 | 'Bumped to {NEXT_VERSION} in preparation for next ' 130 | 'release.'.format(**globals())]) 131 | 132 | # push the changes 133 | subprocess.check_call(['hg', 'push']) 134 | 135 | add_milestone_and_version() 136 | 137 | def has_sphinx(): 138 | try: 139 | devnull = open(os.path.devnull, 'wb') 140 | subprocess.Popen(['sphinx-build', '--version'], stdout=devnull, 141 | stderr=subprocess.STDOUT).wait() 142 | except Exception: 143 | return False 144 | return True 145 | 146 | def build_docs(): 147 | if not os.path.isdir('docs'): 148 | return 149 | if os.path.isdir('docs/build'): 150 | shutil.rmtree('docs/build') 151 | subprocess.check_call([ 152 | 'sphinx-build', 153 | '-b', 'html', 154 | '-d', 'build/doctrees', 155 | '.', 156 | 'build/html', 157 | ], 158 | cwd='docs') 159 | return True 160 | 161 | def upload_bootstrap_script(): 162 | scp_command = 'pscp' if sys.platform.startswith('win') else 'scp' 163 | try: 164 | subprocess.check_call([scp_command, 'distribute_setup.py', 165 | 'pypi@ziade.org:python-distribute.org/']) 166 | except: 167 | print("Unable to upload bootstrap script. Ask Tarek to do it.") 168 | 169 | if __name__ == '__main__': 170 | do_release() 171 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setup.cfg: -------------------------------------------------------------------------------- 1 | [egg_info] 2 | tag_build = 3 | tag_svn_revision = 0 4 | tag_date = 0 5 | 6 | [aliases] 7 | release = egg_info -RDb '' 8 | source = register sdist binary 9 | binary = bdist_egg upload --show-response 10 | 11 | [build_sphinx] 12 | source-dir = docs/ 13 | build-dir = docs/build 14 | all_files = 1 15 | 16 | [upload_docs] 17 | upload-dir = docs/build/html 18 | 19 | [sdist] 20 | formats = gztar 21 | 22 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/__init__.py: -------------------------------------------------------------------------------- 1 | """Extensions to the 'distutils' for large or complex distributions""" 2 | from setuptools.extension import Extension, Library 3 | from setuptools.dist import Distribution, Feature, _get_unpatched 4 | import distutils.core, setuptools.command 5 | from setuptools.depends import Require 6 | from distutils.core import Command as _Command 7 | from distutils.util import convert_path 8 | import os 9 | import sys 10 | 11 | __version__ = '0.6' 12 | __all__ = [ 13 | 'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require', 14 | 'find_packages' 15 | ] 16 | 17 | # This marker is used to simplify the process that checks is the 18 | # setuptools package was installed by the Setuptools project 19 | # or by the Distribute project, in case Setuptools creates 20 | # a distribution with the same version. 21 | # 22 | # The distribute_setup script for instance, will check if this 23 | # attribute is present to decide whether to reinstall the package 24 | # or not. 25 | _distribute = True 26 | 27 | bootstrap_install_from = None 28 | 29 | # If we run 2to3 on .py files, should we also convert docstrings? 30 | # Default: yes; assume that we can detect doctests reliably 31 | run_2to3_on_doctests = True 32 | # Standard package names for fixer packages 33 | lib2to3_fixer_packages = ['lib2to3.fixes'] 34 | 35 | def find_packages(where='.', exclude=()): 36 | """Return a list all Python packages found within directory 'where' 37 | 38 | 'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it 39 | will be converted to the appropriate local path syntax. 'exclude' is a 40 | sequence of package names to exclude; '*' can be used as a wildcard in the 41 | names, such that 'foo.*' will exclude all subpackages of 'foo' (but not 42 | 'foo' itself). 43 | """ 44 | out = [] 45 | stack=[(convert_path(where), '')] 46 | while stack: 47 | where,prefix = stack.pop(0) 48 | for name in os.listdir(where): 49 | fn = os.path.join(where,name) 50 | if ('.' not in name and os.path.isdir(fn) and 51 | os.path.isfile(os.path.join(fn,'__init__.py')) 52 | ): 53 | out.append(prefix+name); stack.append((fn,prefix+name+'.')) 54 | for pat in list(exclude)+['ez_setup', 'distribute_setup']: 55 | from fnmatch import fnmatchcase 56 | out = [item for item in out if not fnmatchcase(item,pat)] 57 | return out 58 | 59 | setup = distutils.core.setup 60 | 61 | _Command = _get_unpatched(_Command) 62 | 63 | class Command(_Command): 64 | __doc__ = _Command.__doc__ 65 | 66 | command_consumes_arguments = False 67 | 68 | def __init__(self, dist, **kw): 69 | # Add support for keyword arguments 70 | _Command.__init__(self,dist) 71 | for k,v in kw.items(): 72 | setattr(self,k,v) 73 | 74 | def reinitialize_command(self, command, reinit_subcommands=0, **kw): 75 | cmd = _Command.reinitialize_command(self, command, reinit_subcommands) 76 | for k,v in kw.items(): 77 | setattr(cmd,k,v) # update command with keywords 78 | return cmd 79 | 80 | import distutils.core 81 | distutils.core.Command = Command # we can't patch distutils.cmd, alas 82 | 83 | def findall(dir = os.curdir): 84 | """Find all files under 'dir' and return the list of full filenames 85 | (relative to 'dir'). 86 | """ 87 | all_files = [] 88 | for base, dirs, files in os.walk(dir): 89 | if base==os.curdir or base.startswith(os.curdir+os.sep): 90 | base = base[2:] 91 | if base: 92 | files = [os.path.join(base, f) for f in files] 93 | all_files.extend(filter(os.path.isfile, files)) 94 | return all_files 95 | 96 | import distutils.filelist 97 | distutils.filelist.findall = findall # fix findall bug in distutils. 98 | 99 | # sys.dont_write_bytecode was introduced in Python 2.6. 100 | if ((hasattr(sys, "dont_write_bytecode") and sys.dont_write_bytecode) or 101 | (not hasattr(sys, "dont_write_bytecode") and os.environ.get("PYTHONDONTWRITEBYTECODE"))): 102 | _dont_write_bytecode = True 103 | else: 104 | _dont_write_bytecode = False 105 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/cli-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/vendor/distribute-0.6.36/setuptools/cli-32.exe -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/cli-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/vendor/distribute-0.6.36/setuptools/cli-64.exe -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/cli.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/vendor/distribute-0.6.36/setuptools/cli.exe -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/__init__.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop', 3 | 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts', 4 | 'sdist', 'setopt', 'test', 'upload', 'install_egg_info', 'install_scripts', 5 | 'register', 'bdist_wininst', 'upload_docs', 6 | ] 7 | 8 | from setuptools.command import install_scripts 9 | import sys 10 | 11 | if sys.version>='2.5': 12 | # In Python 2.5 and above, distutils includes its own upload command 13 | __all__.remove('upload') 14 | 15 | from distutils.command.bdist import bdist 16 | 17 | if 'egg' not in bdist.format_commands: 18 | bdist.format_command['egg'] = ('bdist_egg', "Python .egg file") 19 | bdist.format_commands.append('egg') 20 | 21 | del bdist, sys 22 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/alias.py: -------------------------------------------------------------------------------- 1 | import distutils, os 2 | from setuptools import Command 3 | from distutils.util import convert_path 4 | from distutils import log 5 | from distutils.errors import * 6 | from setuptools.command.setopt import edit_config, option_base, config_file 7 | 8 | def shquote(arg): 9 | """Quote an argument for later parsing by shlex.split()""" 10 | for c in '"', "'", "\\", "#": 11 | if c in arg: return repr(arg) 12 | if arg.split()<>[arg]: 13 | return repr(arg) 14 | return arg 15 | 16 | 17 | class alias(option_base): 18 | """Define a shortcut that invokes one or more commands""" 19 | 20 | description = "define a shortcut to invoke one or more commands" 21 | command_consumes_arguments = True 22 | 23 | user_options = [ 24 | ('remove', 'r', 'remove (unset) the alias'), 25 | ] + option_base.user_options 26 | 27 | boolean_options = option_base.boolean_options + ['remove'] 28 | 29 | def initialize_options(self): 30 | option_base.initialize_options(self) 31 | self.args = None 32 | self.remove = None 33 | 34 | def finalize_options(self): 35 | option_base.finalize_options(self) 36 | if self.remove and len(self.args)<>1: 37 | raise DistutilsOptionError( 38 | "Must specify exactly one argument (the alias name) when " 39 | "using --remove" 40 | ) 41 | 42 | def run(self): 43 | aliases = self.distribution.get_option_dict('aliases') 44 | 45 | if not self.args: 46 | print "Command Aliases" 47 | print "---------------" 48 | for alias in aliases: 49 | print "setup.py alias", format_alias(alias, aliases) 50 | return 51 | 52 | elif len(self.args)==1: 53 | alias, = self.args 54 | if self.remove: 55 | command = None 56 | elif alias in aliases: 57 | print "setup.py alias", format_alias(alias, aliases) 58 | return 59 | else: 60 | print "No alias definition found for %r" % alias 61 | return 62 | else: 63 | alias = self.args[0] 64 | command = ' '.join(map(shquote,self.args[1:])) 65 | 66 | edit_config(self.filename, {'aliases': {alias:command}}, self.dry_run) 67 | 68 | 69 | def format_alias(name, aliases): 70 | source, command = aliases[name] 71 | if source == config_file('global'): 72 | source = '--global-config ' 73 | elif source == config_file('user'): 74 | source = '--user-config ' 75 | elif source == config_file('local'): 76 | source = '' 77 | else: 78 | source = '--filename=%r' % source 79 | return source+name+' '+command 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/bdist_rpm.py: -------------------------------------------------------------------------------- 1 | # This is just a kludge so that bdist_rpm doesn't guess wrong about the 2 | # distribution name and version, if the egg_info command is going to alter 3 | # them, another kludge to allow you to build old-style non-egg RPMs, and 4 | # finally, a kludge to track .rpm files for uploading when run on Python <2.5. 5 | 6 | from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm 7 | import sys, os 8 | 9 | class bdist_rpm(_bdist_rpm): 10 | 11 | def initialize_options(self): 12 | _bdist_rpm.initialize_options(self) 13 | self.no_egg = None 14 | 15 | if sys.version<"2.5": 16 | # Track for uploading any .rpm file(s) moved to self.dist_dir 17 | def move_file(self, src, dst, level=1): 18 | _bdist_rpm.move_file(self, src, dst, level) 19 | if dst==self.dist_dir and src.endswith('.rpm'): 20 | getattr(self.distribution,'dist_files',[]).append( 21 | ('bdist_rpm', 22 | src.endswith('.src.rpm') and 'any' or sys.version[:3], 23 | os.path.join(dst, os.path.basename(src))) 24 | ) 25 | 26 | def run(self): 27 | self.run_command('egg_info') # ensure distro name is up-to-date 28 | _bdist_rpm.run(self) 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | def _make_spec_file(self): 43 | version = self.distribution.get_version() 44 | rpmversion = version.replace('-','_') 45 | spec = _bdist_rpm._make_spec_file(self) 46 | line23 = '%define version '+version 47 | line24 = '%define version '+rpmversion 48 | spec = [ 49 | line.replace( 50 | "Source0: %{name}-%{version}.tar", 51 | "Source0: %{name}-%{unmangled_version}.tar" 52 | ).replace( 53 | "setup.py install ", 54 | "setup.py install --single-version-externally-managed " 55 | ).replace( 56 | "%setup", 57 | "%setup -n %{name}-%{unmangled_version}" 58 | ).replace(line23,line24) 59 | for line in spec 60 | ] 61 | spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) 62 | return spec 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/bdist_wininst.py: -------------------------------------------------------------------------------- 1 | from distutils.command.bdist_wininst import bdist_wininst as _bdist_wininst 2 | import os, sys 3 | 4 | class bdist_wininst(_bdist_wininst): 5 | 6 | def create_exe(self, arcname, fullname, bitmap=None): 7 | _bdist_wininst.create_exe(self, arcname, fullname, bitmap) 8 | dist_files = getattr(self.distribution, 'dist_files', []) 9 | 10 | if self.target_version: 11 | installer_name = os.path.join(self.dist_dir, 12 | "%s.win32-py%s.exe" % 13 | (fullname, self.target_version)) 14 | pyversion = self.target_version 15 | 16 | # fix 2.5 bdist_wininst ignoring --target-version spec 17 | bad = ('bdist_wininst','any',installer_name) 18 | if bad in dist_files: 19 | dist_files.remove(bad) 20 | else: 21 | installer_name = os.path.join(self.dist_dir, 22 | "%s.win32.exe" % fullname) 23 | pyversion = 'any' 24 | good = ('bdist_wininst', pyversion, installer_name) 25 | if good not in dist_files: 26 | dist_files.append(good) 27 | 28 | def reinitialize_command (self, command, reinit_subcommands=0): 29 | cmd = self.distribution.reinitialize_command( 30 | command, reinit_subcommands) 31 | if command in ('install', 'install_lib'): 32 | cmd.install_lib = None # work around distutils bug 33 | return cmd 34 | 35 | def run(self): 36 | self._is_running = True 37 | try: 38 | _bdist_wininst.run(self) 39 | finally: 40 | self._is_running = False 41 | 42 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/install.py: -------------------------------------------------------------------------------- 1 | import setuptools, sys, glob 2 | from distutils.command.install import install as _install 3 | from distutils.errors import DistutilsArgError 4 | 5 | class install(_install): 6 | """Use easy_install to install the package, w/dependencies""" 7 | 8 | user_options = _install.user_options + [ 9 | ('old-and-unmanageable', None, "Try not to use this!"), 10 | ('single-version-externally-managed', None, 11 | "used by system package builders to create 'flat' eggs"), 12 | ] 13 | boolean_options = _install.boolean_options + [ 14 | 'old-and-unmanageable', 'single-version-externally-managed', 15 | ] 16 | new_commands = [ 17 | ('install_egg_info', lambda self: True), 18 | ('install_scripts', lambda self: True), 19 | ] 20 | _nc = dict(new_commands) 21 | 22 | def initialize_options(self): 23 | _install.initialize_options(self) 24 | self.old_and_unmanageable = None 25 | self.single_version_externally_managed = None 26 | self.no_compile = None # make DISTUTILS_DEBUG work right! 27 | 28 | def finalize_options(self): 29 | _install.finalize_options(self) 30 | if self.root: 31 | self.single_version_externally_managed = True 32 | elif self.single_version_externally_managed: 33 | if not self.root and not self.record: 34 | raise DistutilsArgError( 35 | "You must specify --record or --root when building system" 36 | " packages" 37 | ) 38 | 39 | def handle_extra_path(self): 40 | if self.root or self.single_version_externally_managed: 41 | # explicit backward-compatibility mode, allow extra_path to work 42 | return _install.handle_extra_path(self) 43 | 44 | # Ignore extra_path when installing an egg (or being run by another 45 | # command without --root or --single-version-externally-managed 46 | self.path_file = None 47 | self.extra_dirs = '' 48 | 49 | 50 | def run(self): 51 | # Explicit request for old-style install? Just do it 52 | if self.old_and_unmanageable or self.single_version_externally_managed: 53 | return _install.run(self) 54 | 55 | # Attempt to detect whether we were called from setup() or by another 56 | # command. If we were called by setup(), our caller will be the 57 | # 'run_command' method in 'distutils.dist', and *its* caller will be 58 | # the 'run_commands' method. If we were called any other way, our 59 | # immediate caller *might* be 'run_command', but it won't have been 60 | # called by 'run_commands'. This is slightly kludgy, but seems to 61 | # work. 62 | # 63 | caller = sys._getframe(2) 64 | caller_module = caller.f_globals.get('__name__','') 65 | caller_name = caller.f_code.co_name 66 | 67 | if caller_module != 'distutils.dist' or caller_name!='run_commands': 68 | # We weren't called from the command line or setup(), so we 69 | # should run in backward-compatibility mode to support bdist_* 70 | # commands. 71 | _install.run(self) 72 | else: 73 | self.do_egg_install() 74 | 75 | 76 | 77 | 78 | 79 | 80 | def do_egg_install(self): 81 | 82 | easy_install = self.distribution.get_command_class('easy_install') 83 | 84 | cmd = easy_install( 85 | self.distribution, args="x", root=self.root, record=self.record, 86 | ) 87 | cmd.ensure_finalized() # finalize before bdist_egg munges install cmd 88 | cmd.always_copy_from = '.' # make sure local-dir eggs get installed 89 | 90 | # pick up setup-dir .egg files only: no .egg-info 91 | cmd.package_index.scan(glob.glob('*.egg')) 92 | 93 | self.run_command('bdist_egg') 94 | args = [self.distribution.get_command_obj('bdist_egg').egg_output] 95 | 96 | if setuptools.bootstrap_install_from: 97 | # Bootstrap self-installation of setuptools 98 | args.insert(0, setuptools.bootstrap_install_from) 99 | 100 | cmd.args = args 101 | cmd.run() 102 | setuptools.bootstrap_install_from = None 103 | 104 | # XXX Python 3.1 doesn't see _nc if this is inside the class 105 | install.sub_commands = [ 106 | cmd for cmd in _install.sub_commands if cmd[0] not in install._nc 107 | ] + install.new_commands 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | # 125 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/install_egg_info.py: -------------------------------------------------------------------------------- 1 | from setuptools import Command 2 | from setuptools.archive_util import unpack_archive 3 | from distutils import log, dir_util 4 | import os, shutil, pkg_resources 5 | 6 | class install_egg_info(Command): 7 | """Install an .egg-info directory for the package""" 8 | 9 | description = "Install an .egg-info directory for the package" 10 | 11 | user_options = [ 12 | ('install-dir=', 'd', "directory to install to"), 13 | ] 14 | 15 | def initialize_options(self): 16 | self.install_dir = None 17 | 18 | def finalize_options(self): 19 | self.set_undefined_options('install_lib',('install_dir','install_dir')) 20 | ei_cmd = self.get_finalized_command("egg_info") 21 | basename = pkg_resources.Distribution( 22 | None, None, ei_cmd.egg_name, ei_cmd.egg_version 23 | ).egg_name()+'.egg-info' 24 | self.source = ei_cmd.egg_info 25 | self.target = os.path.join(self.install_dir, basename) 26 | self.outputs = [self.target] 27 | 28 | def run(self): 29 | self.run_command('egg_info') 30 | target = self.target 31 | if os.path.isdir(self.target) and not os.path.islink(self.target): 32 | dir_util.remove_tree(self.target, dry_run=self.dry_run) 33 | elif os.path.exists(self.target): 34 | self.execute(os.unlink,(self.target,),"Removing "+self.target) 35 | if not self.dry_run: 36 | pkg_resources.ensure_directory(self.target) 37 | self.execute(self.copytree, (), 38 | "Copying %s to %s" % (self.source, self.target) 39 | ) 40 | self.install_namespaces() 41 | 42 | def get_outputs(self): 43 | return self.outputs 44 | 45 | def copytree(self): 46 | # Copy the .egg-info tree to site-packages 47 | def skimmer(src,dst): 48 | # filter out source-control directories; note that 'src' is always 49 | # a '/'-separated path, regardless of platform. 'dst' is a 50 | # platform-specific path. 51 | for skip in '.svn/','CVS/': 52 | if src.startswith(skip) or '/'+skip in src: 53 | return None 54 | self.outputs.append(dst) 55 | log.debug("Copying %s to %s", src, dst) 56 | return dst 57 | unpack_archive(self.source, self.target, skimmer) 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | def install_namespaces(self): 84 | nsp = self._get_all_ns_packages() 85 | if not nsp: return 86 | filename,ext = os.path.splitext(self.target) 87 | filename += '-nspkg.pth'; self.outputs.append(filename) 88 | log.info("Installing %s",filename) 89 | if not self.dry_run: 90 | f = open(filename,'wt') 91 | for pkg in nsp: 92 | # ensure pkg is not a unicode string under Python 2.7 93 | pkg = str(pkg) 94 | pth = tuple(pkg.split('.')) 95 | trailer = '\n' 96 | if '.' in pkg: 97 | trailer = ( 98 | "; m and setattr(sys.modules[%r], %r, m)\n" 99 | % ('.'.join(pth[:-1]), pth[-1]) 100 | ) 101 | f.write( 102 | "import sys,types,os; " 103 | "p = os.path.join(sys._getframe(1).f_locals['sitedir'], " 104 | "*%(pth)r); " 105 | "ie = os.path.exists(os.path.join(p,'__init__.py')); " 106 | "m = not ie and " 107 | "sys.modules.setdefault(%(pkg)r,types.ModuleType(%(pkg)r)); " 108 | "mp = (m or []) and m.__dict__.setdefault('__path__',[]); " 109 | "(p not in mp) and mp.append(p)%(trailer)s" 110 | % locals() 111 | ) 112 | f.close() 113 | 114 | def _get_all_ns_packages(self): 115 | nsp = {} 116 | for pkg in self.distribution.namespace_packages or []: 117 | pkg = pkg.split('.') 118 | while pkg: 119 | nsp['.'.join(pkg)] = 1 120 | pkg.pop() 121 | nsp=list(nsp) 122 | nsp.sort() # set up shorter names first 123 | return nsp 124 | 125 | 126 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/install_lib.py: -------------------------------------------------------------------------------- 1 | from distutils.command.install_lib import install_lib as _install_lib 2 | import os 3 | 4 | class install_lib(_install_lib): 5 | """Don't add compiled flags to filenames of non-Python files""" 6 | 7 | def _bytecode_filenames (self, py_filenames): 8 | bytecode_files = [] 9 | for py_file in py_filenames: 10 | if not py_file.endswith('.py'): 11 | continue 12 | if self.compile: 13 | bytecode_files.append(py_file + "c") 14 | if self.optimize > 0: 15 | bytecode_files.append(py_file + "o") 16 | 17 | return bytecode_files 18 | 19 | def run(self): 20 | self.build() 21 | outfiles = self.install() 22 | if outfiles is not None: 23 | # always compile, in case we have any extension stubs to deal with 24 | self.byte_compile(outfiles) 25 | 26 | def get_exclusions(self): 27 | exclude = {} 28 | nsp = self.distribution.namespace_packages 29 | 30 | if (nsp and self.get_finalized_command('install') 31 | .single_version_externally_managed 32 | ): 33 | for pkg in nsp: 34 | parts = pkg.split('.') 35 | while parts: 36 | pkgdir = os.path.join(self.install_dir, *parts) 37 | for f in '__init__.py', '__init__.pyc', '__init__.pyo': 38 | exclude[os.path.join(pkgdir,f)] = 1 39 | parts.pop() 40 | return exclude 41 | 42 | def copy_tree( 43 | self, infile, outfile, 44 | preserve_mode=1, preserve_times=1, preserve_symlinks=0, level=1 45 | ): 46 | assert preserve_mode and preserve_times and not preserve_symlinks 47 | exclude = self.get_exclusions() 48 | 49 | if not exclude: 50 | return _install_lib.copy_tree(self, infile, outfile) 51 | 52 | # Exclude namespace package __init__.py* files from the output 53 | 54 | from setuptools.archive_util import unpack_directory 55 | from distutils import log 56 | 57 | outfiles = [] 58 | 59 | def pf(src, dst): 60 | if dst in exclude: 61 | log.warn("Skipping installation of %s (namespace package)",dst) 62 | return False 63 | 64 | log.info("copying %s -> %s", src, os.path.dirname(dst)) 65 | outfiles.append(dst) 66 | return dst 67 | 68 | unpack_directory(infile, outfile, pf) 69 | return outfiles 70 | 71 | def get_outputs(self): 72 | outputs = _install_lib.get_outputs(self) 73 | exclude = self.get_exclusions() 74 | if exclude: 75 | return [f for f in outputs if f not in exclude] 76 | return outputs 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/install_scripts.py: -------------------------------------------------------------------------------- 1 | from distutils.command.install_scripts import install_scripts \ 2 | as _install_scripts 3 | from pkg_resources import Distribution, PathMetadata, ensure_directory 4 | import os 5 | from distutils import log 6 | 7 | class install_scripts(_install_scripts): 8 | """Do normal script install, plus any egg_info wrapper scripts""" 9 | 10 | def initialize_options(self): 11 | _install_scripts.initialize_options(self) 12 | self.no_ep = False 13 | 14 | def run(self): 15 | from setuptools.command.easy_install import get_script_args 16 | from setuptools.command.easy_install import sys_executable 17 | 18 | self.run_command("egg_info") 19 | if self.distribution.scripts: 20 | _install_scripts.run(self) # run first to set up self.outfiles 21 | else: 22 | self.outfiles = [] 23 | if self.no_ep: 24 | # don't install entry point scripts into .egg file! 25 | return 26 | 27 | ei_cmd = self.get_finalized_command("egg_info") 28 | dist = Distribution( 29 | ei_cmd.egg_base, PathMetadata(ei_cmd.egg_base, ei_cmd.egg_info), 30 | ei_cmd.egg_name, ei_cmd.egg_version, 31 | ) 32 | bs_cmd = self.get_finalized_command('build_scripts') 33 | executable = getattr(bs_cmd,'executable',sys_executable) 34 | is_wininst = getattr( 35 | self.get_finalized_command("bdist_wininst"), '_is_running', False 36 | ) 37 | for args in get_script_args(dist, executable, is_wininst): 38 | self.write_script(*args) 39 | 40 | def write_script(self, script_name, contents, mode="t", *ignored): 41 | """Write an executable file to the scripts directory""" 42 | from setuptools.command.easy_install import chmod, current_umask 43 | log.info("Installing %s script to %s", script_name, self.install_dir) 44 | target = os.path.join(self.install_dir, script_name) 45 | self.outfiles.append(target) 46 | 47 | mask = current_umask() 48 | if not self.dry_run: 49 | ensure_directory(target) 50 | f = open(target,"w"+mode) 51 | f.write(contents) 52 | f.close() 53 | chmod(target, 0777-mask) 54 | 55 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/register.py: -------------------------------------------------------------------------------- 1 | from distutils.command.register import register as _register 2 | 3 | class register(_register): 4 | __doc__ = _register.__doc__ 5 | 6 | def run(self): 7 | # Make sure that we are using valid current name/version info 8 | self.run_command('egg_info') 9 | _register.run(self) 10 | 11 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/rotate.py: -------------------------------------------------------------------------------- 1 | import distutils, os 2 | from setuptools import Command 3 | from distutils.util import convert_path 4 | from distutils import log 5 | from distutils.errors import * 6 | 7 | class rotate(Command): 8 | """Delete older distributions""" 9 | 10 | description = "delete older distributions, keeping N newest files" 11 | user_options = [ 12 | ('match=', 'm', "patterns to match (required)"), 13 | ('dist-dir=', 'd', "directory where the distributions are"), 14 | ('keep=', 'k', "number of matching distributions to keep"), 15 | ] 16 | 17 | boolean_options = [] 18 | 19 | def initialize_options(self): 20 | self.match = None 21 | self.dist_dir = None 22 | self.keep = None 23 | 24 | def finalize_options(self): 25 | if self.match is None: 26 | raise DistutilsOptionError( 27 | "Must specify one or more (comma-separated) match patterns " 28 | "(e.g. '.zip' or '.egg')" 29 | ) 30 | if self.keep is None: 31 | raise DistutilsOptionError("Must specify number of files to keep") 32 | try: 33 | self.keep = int(self.keep) 34 | except ValueError: 35 | raise DistutilsOptionError("--keep must be an integer") 36 | if isinstance(self.match, basestring): 37 | self.match = [ 38 | convert_path(p.strip()) for p in self.match.split(',') 39 | ] 40 | self.set_undefined_options('bdist',('dist_dir', 'dist_dir')) 41 | 42 | def run(self): 43 | self.run_command("egg_info") 44 | from glob import glob 45 | for pattern in self.match: 46 | pattern = self.distribution.get_name()+'*'+pattern 47 | files = glob(os.path.join(self.dist_dir,pattern)) 48 | files = [(os.path.getmtime(f),f) for f in files] 49 | files.sort() 50 | files.reverse() 51 | 52 | log.info("%d file(s) matching %s", len(files), pattern) 53 | files = files[self.keep:] 54 | for (t,f) in files: 55 | log.info("Deleting %s", f) 56 | if not self.dry_run: 57 | os.unlink(f) 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/command/saveopts.py: -------------------------------------------------------------------------------- 1 | import distutils, os 2 | from setuptools import Command 3 | from setuptools.command.setopt import edit_config, option_base 4 | 5 | class saveopts(option_base): 6 | """Save command-line options to a file""" 7 | 8 | description = "save supplied options to setup.cfg or other config file" 9 | 10 | def run(self): 11 | dist = self.distribution 12 | commands = dist.command_options.keys() 13 | settings = {} 14 | 15 | for cmd in commands: 16 | 17 | if cmd=='saveopts': 18 | continue # don't save our own options! 19 | 20 | for opt,(src,val) in dist.get_option_dict(cmd).items(): 21 | if src=="command line": 22 | settings.setdefault(cmd,{})[opt] = val 23 | 24 | edit_config(self.filename, settings, self.dry_run) 25 | 26 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/extension.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import distutils.core 3 | import distutils.extension 4 | 5 | from setuptools.dist import _get_unpatched 6 | 7 | _Extension = _get_unpatched(distutils.core.Extension) 8 | 9 | def have_pyrex(): 10 | """ 11 | Return True if Cython or Pyrex can be imported. 12 | """ 13 | pyrex_impls = 'Cython.Distutils.build_ext', 'Pyrex.Distutils.build_ext' 14 | for pyrex_impl in pyrex_impls: 15 | try: 16 | # from (pyrex_impl) import build_ext 17 | __import__(pyrex_impl, fromlist=['build_ext']).build_ext 18 | return True 19 | except Exception: 20 | pass 21 | return False 22 | 23 | 24 | class Extension(_Extension): 25 | """Extension that uses '.c' files in place of '.pyx' files""" 26 | 27 | def __init__(self, *args, **kw): 28 | _Extension.__init__(self, *args, **kw) 29 | if not have_pyrex(): 30 | self._convert_pyx_sources_to_c() 31 | 32 | def _convert_pyx_sources_to_c(self): 33 | "convert .pyx extensions to .c" 34 | def pyx_to_c(source): 35 | if source.endswith('.pyx'): 36 | source = source[:-4] + '.c' 37 | return source 38 | self.sources = map(pyx_to_c, self.sources) 39 | 40 | class Library(Extension): 41 | """Just like a regular Extension, but built as a library instead""" 42 | 43 | distutils.core.Extension = Extension 44 | distutils.extension.Extension = Extension 45 | if 'distutils.command.build_ext' in sys.modules: 46 | sys.modules['distutils.command.build_ext'].Extension = Extension 47 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/gui-32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/vendor/distribute-0.6.36/setuptools/gui-32.exe -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/gui-64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/vendor/distribute-0.6.36/setuptools/gui-64.exe -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/gui.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethjiang/heroku-buildpack-python-libffi/392172ca646b8226e931596f62e21e25c3f26cf9/vendor/distribute-0.6.36/setuptools/gui.exe -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/script template (dev).py: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = """%(spec)r""" 3 | from pkg_resources import require; require("""%(spec)r""") 4 | del require 5 | __file__ = """%(dev_path)r""" 6 | execfile(__file__) 7 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/script template.py: -------------------------------------------------------------------------------- 1 | # EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r 2 | __requires__ = """%(spec)r""" 3 | import pkg_resources 4 | pkg_resources.run_script("""%(spec)r""", """%(script_name)r""") 5 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/indexes/test_links_priority/external.html: -------------------------------------------------------------------------------- 1 | 2 | bad old link 3 | 4 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/indexes/test_links_priority/simple/foobar/index.html: -------------------------------------------------------------------------------- 1 | 2 | foobar-0.1.tar.gz
3 | external homepage
4 | 5 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/py26compat.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | 3 | try: 4 | # provide skipIf for Python 2.4-2.6 5 | skipIf = unittest.skipIf 6 | except AttributeError: 7 | def skipIf(condition, reason): 8 | def skipper(func): 9 | def skip(*args, **kwargs): 10 | return 11 | if condition: 12 | return skip 13 | return func 14 | return skipper 15 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/server.py: -------------------------------------------------------------------------------- 1 | """Basic http server for tests to simulate PyPI or custom indexes 2 | """ 3 | import urllib2 4 | import sys 5 | import time 6 | import threading 7 | import BaseHTTPServer 8 | from BaseHTTPServer import HTTPServer 9 | from SimpleHTTPServer import SimpleHTTPRequestHandler 10 | 11 | class IndexServer(HTTPServer): 12 | """Basic single-threaded http server simulating a package index 13 | 14 | You can use this server in unittest like this:: 15 | s = IndexServer() 16 | s.start() 17 | index_url = s.base_url() + 'mytestindex' 18 | # do some test requests to the index 19 | # The index files should be located in setuptools/tests/indexes 20 | s.stop() 21 | """ 22 | def __init__(self, server_address=('', 0), 23 | RequestHandlerClass=SimpleHTTPRequestHandler): 24 | HTTPServer.__init__(self, server_address, RequestHandlerClass) 25 | self._run = True 26 | 27 | def serve(self): 28 | while self._run: 29 | self.handle_request() 30 | 31 | def start(self): 32 | self.thread = threading.Thread(target=self.serve) 33 | self.thread.start() 34 | 35 | def stop(self): 36 | "Stop the server" 37 | 38 | # Let the server finish the last request and wait for a new one. 39 | time.sleep(0.1) 40 | 41 | # self.shutdown is not supported on python < 2.6, so just 42 | # set _run to false, and make a request, causing it to 43 | # terminate. 44 | self._run = False 45 | url = 'http://127.0.0.1:%(server_port)s/' % vars(self) 46 | try: 47 | if sys.version_info >= (2, 6): 48 | urllib2.urlopen(url, timeout=5) 49 | else: 50 | urllib2.urlopen(url) 51 | except urllib2.URLError: 52 | # ignore any errors; all that's important is the request 53 | pass 54 | self.thread.join() 55 | 56 | def base_url(self): 57 | port = self.server_port 58 | return 'http://127.0.0.1:%s/setuptools/tests/indexes/' % port 59 | 60 | class RequestRecorder(BaseHTTPServer.BaseHTTPRequestHandler): 61 | def do_GET(self): 62 | requests = vars(self.server).setdefault('requests', []) 63 | requests.append(self) 64 | self.send_response(200, 'OK') 65 | 66 | class MockServer(HTTPServer, threading.Thread): 67 | """ 68 | A simple HTTP Server that records the requests made to it. 69 | """ 70 | def __init__(self, server_address=('', 0), 71 | RequestHandlerClass=RequestRecorder): 72 | HTTPServer.__init__(self, server_address, RequestHandlerClass) 73 | threading.Thread.__init__(self) 74 | self.setDaemon(True) 75 | self.requests = [] 76 | 77 | def run(self): 78 | self.serve_forever() 79 | 80 | def url(self): 81 | return 'http://localhost:%(server_port)s/' % vars(self) 82 | url = property(url) 83 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_bdist_egg.py: -------------------------------------------------------------------------------- 1 | """develop tests 2 | """ 3 | import sys 4 | import os, re, shutil, tempfile, unittest 5 | import tempfile 6 | import site 7 | from StringIO import StringIO 8 | 9 | from distutils.errors import DistutilsError 10 | from setuptools.command.bdist_egg import bdist_egg 11 | from setuptools.command import easy_install as easy_install_pkg 12 | from setuptools.dist import Distribution 13 | 14 | SETUP_PY = """\ 15 | from setuptools import setup 16 | 17 | setup(name='foo', py_modules=['hi']) 18 | """ 19 | 20 | class TestDevelopTest(unittest.TestCase): 21 | 22 | def setUp(self): 23 | self.dir = tempfile.mkdtemp() 24 | self.old_cwd = os.getcwd() 25 | os.chdir(self.dir) 26 | f = open('setup.py', 'w') 27 | f.write(SETUP_PY) 28 | f.close() 29 | f = open('hi.py', 'w') 30 | f.write('1\n') 31 | f.close() 32 | if sys.version >= "2.6": 33 | self.old_base = site.USER_BASE 34 | site.USER_BASE = tempfile.mkdtemp() 35 | self.old_site = site.USER_SITE 36 | site.USER_SITE = tempfile.mkdtemp() 37 | 38 | def tearDown(self): 39 | os.chdir(self.old_cwd) 40 | shutil.rmtree(self.dir) 41 | if sys.version >= "2.6": 42 | shutil.rmtree(site.USER_BASE) 43 | shutil.rmtree(site.USER_SITE) 44 | site.USER_BASE = self.old_base 45 | site.USER_SITE = self.old_site 46 | 47 | def test_bdist_egg(self): 48 | dist = Distribution(dict( 49 | script_name='setup.py', 50 | script_args=['bdist_egg'], 51 | name='foo', 52 | py_modules=['hi'] 53 | )) 54 | os.makedirs(os.path.join('build', 'src')) 55 | old_stdout = sys.stdout 56 | sys.stdout = o = StringIO() 57 | try: 58 | dist.parse_command_line() 59 | dist.run_commands() 60 | finally: 61 | sys.stdout = old_stdout 62 | 63 | # let's see if we got our egg link at the right place 64 | [content] = os.listdir('dist') 65 | self.assertTrue(re.match('foo-0.0.0-py[23].\d.egg$', content)) 66 | 67 | def test_suite(): 68 | return unittest.makeSuite(TestDevelopTest) 69 | 70 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_build_ext.py: -------------------------------------------------------------------------------- 1 | """build_ext tests 2 | """ 3 | import os, shutil, tempfile, unittest 4 | from distutils.command.build_ext import build_ext as distutils_build_ext 5 | from setuptools.command.build_ext import build_ext 6 | from setuptools.dist import Distribution 7 | 8 | class TestBuildExtTest(unittest.TestCase): 9 | 10 | def test_get_ext_filename(self): 11 | # setuptools needs to give back the same 12 | # result than distutils, even if the fullname 13 | # is not in ext_map 14 | dist = Distribution() 15 | cmd = build_ext(dist) 16 | cmd.ext_map['foo/bar'] = '' 17 | res = cmd.get_ext_filename('foo') 18 | wanted = distutils_build_ext.get_ext_filename(cmd, 'foo') 19 | assert res == wanted 20 | 21 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_develop.py: -------------------------------------------------------------------------------- 1 | """develop tests 2 | """ 3 | import sys 4 | import os, shutil, tempfile, unittest 5 | import tempfile 6 | import site 7 | from StringIO import StringIO 8 | 9 | from distutils.errors import DistutilsError 10 | from setuptools.command.develop import develop 11 | from setuptools.command import easy_install as easy_install_pkg 12 | from setuptools.dist import Distribution 13 | 14 | SETUP_PY = """\ 15 | from setuptools import setup 16 | 17 | setup(name='foo', 18 | packages=['foo'], 19 | use_2to3=True, 20 | ) 21 | """ 22 | 23 | INIT_PY = """print "foo" 24 | """ 25 | 26 | class TestDevelopTest(unittest.TestCase): 27 | 28 | def setUp(self): 29 | if sys.version < "2.6" or hasattr(sys, 'real_prefix'): 30 | return 31 | 32 | # Directory structure 33 | self.dir = tempfile.mkdtemp() 34 | os.mkdir(os.path.join(self.dir, 'foo')) 35 | # setup.py 36 | setup = os.path.join(self.dir, 'setup.py') 37 | f = open(setup, 'w') 38 | f.write(SETUP_PY) 39 | f.close() 40 | self.old_cwd = os.getcwd() 41 | # foo/__init__.py 42 | init = os.path.join(self.dir, 'foo', '__init__.py') 43 | f = open(init, 'w') 44 | f.write(INIT_PY) 45 | f.close() 46 | 47 | os.chdir(self.dir) 48 | self.old_base = site.USER_BASE 49 | site.USER_BASE = tempfile.mkdtemp() 50 | self.old_site = site.USER_SITE 51 | site.USER_SITE = tempfile.mkdtemp() 52 | 53 | def tearDown(self): 54 | if sys.version < "2.6" or hasattr(sys, 'real_prefix'): 55 | return 56 | 57 | os.chdir(self.old_cwd) 58 | shutil.rmtree(self.dir) 59 | shutil.rmtree(site.USER_BASE) 60 | shutil.rmtree(site.USER_SITE) 61 | site.USER_BASE = self.old_base 62 | site.USER_SITE = self.old_site 63 | 64 | def test_develop(self): 65 | if sys.version < "2.6" or hasattr(sys, 'real_prefix'): 66 | return 67 | dist = Distribution( 68 | dict(name='foo', 69 | packages=['foo'], 70 | use_2to3=True, 71 | version='0.0', 72 | )) 73 | dist.script_name = 'setup.py' 74 | cmd = develop(dist) 75 | cmd.user = 1 76 | cmd.ensure_finalized() 77 | cmd.install_dir = site.USER_SITE 78 | cmd.user = 1 79 | old_stdout = sys.stdout 80 | #sys.stdout = StringIO() 81 | try: 82 | cmd.run() 83 | finally: 84 | sys.stdout = old_stdout 85 | 86 | # let's see if we got our egg link at the right place 87 | content = os.listdir(site.USER_SITE) 88 | content.sort() 89 | self.assertEqual(content, ['easy-install.pth', 'foo.egg-link']) 90 | 91 | # Check that we are using the right code. 92 | egg_link_file = open(os.path.join(site.USER_SITE, 'foo.egg-link'), 'rt') 93 | path = egg_link_file.read().split()[0].strip() 94 | egg_link_file.close() 95 | init_file = open(os.path.join(path, 'foo', '__init__.py'), 'rt') 96 | init = init_file.read().strip() 97 | init_file.close() 98 | if sys.version < "3": 99 | self.assertEqual(init, 'print "foo"') 100 | else: 101 | self.assertEqual(init, 'print("foo")') 102 | 103 | def notest_develop_with_setup_requires(self): 104 | 105 | wanted = ("Could not find suitable distribution for " 106 | "Requirement.parse('I-DONT-EXIST')") 107 | old_dir = os.getcwd() 108 | os.chdir(self.dir) 109 | try: 110 | try: 111 | dist = Distribution({'setup_requires': ['I_DONT_EXIST']}) 112 | except DistutilsError, e: 113 | error = str(e) 114 | if error == wanted: 115 | pass 116 | finally: 117 | os.chdir(old_dir) 118 | 119 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_dist_info.py: -------------------------------------------------------------------------------- 1 | """Test .dist-info style distributions. 2 | """ 3 | import os 4 | import shutil 5 | import tempfile 6 | import unittest 7 | import textwrap 8 | 9 | try: 10 | import ast 11 | except: 12 | pass 13 | 14 | import pkg_resources 15 | 16 | from setuptools.tests.py26compat import skipIf 17 | 18 | def DALS(s): 19 | "dedent and left-strip" 20 | return textwrap.dedent(s).lstrip() 21 | 22 | class TestDistInfo(unittest.TestCase): 23 | 24 | def test_distinfo(self): 25 | dists = {} 26 | for d in pkg_resources.find_distributions(self.tmpdir): 27 | dists[d.project_name] = d 28 | 29 | assert len(dists) == 2, dists 30 | 31 | unversioned = dists['UnversionedDistribution'] 32 | versioned = dists['VersionedDistribution'] 33 | 34 | assert versioned.version == '2.718' # from filename 35 | assert unversioned.version == '0.3' # from METADATA 36 | 37 | @skipIf('ast' not in globals(), 38 | "ast is used to test conditional dependencies (Python >= 2.6)") 39 | def test_conditional_dependencies(self): 40 | requires = [pkg_resources.Requirement.parse('splort==4'), 41 | pkg_resources.Requirement.parse('quux>=1.1')] 42 | 43 | for d in pkg_resources.find_distributions(self.tmpdir): 44 | self.assertEqual(d.requires(), requires[:1]) 45 | self.assertEqual(d.requires(extras=('baz',)), requires) 46 | self.assertEqual(d.extras, ['baz']) 47 | 48 | def setUp(self): 49 | self.tmpdir = tempfile.mkdtemp() 50 | versioned = os.path.join(self.tmpdir, 51 | 'VersionedDistribution-2.718.dist-info') 52 | os.mkdir(versioned) 53 | metadata_file = open(os.path.join(versioned, 'METADATA'), 'w+') 54 | metadata_file.write(DALS( 55 | """ 56 | Metadata-Version: 1.2 57 | Name: VersionedDistribution 58 | Requires-Dist: splort (4) 59 | Provides-Extra: baz 60 | Requires-Dist: quux (>=1.1); extra == 'baz' 61 | """)) 62 | metadata_file.close() 63 | 64 | unversioned = os.path.join(self.tmpdir, 65 | 'UnversionedDistribution.dist-info') 66 | os.mkdir(unversioned) 67 | metadata_file = open(os.path.join(unversioned, 'METADATA'), 'w+') 68 | metadata_file.write(DALS( 69 | """ 70 | Metadata-Version: 1.2 71 | Name: UnversionedDistribution 72 | Version: 0.3 73 | Requires-Dist: splort (==4) 74 | Provides-Extra: baz 75 | Requires-Dist: quux (>=1.1); extra == 'baz' 76 | """)) 77 | metadata_file.close() 78 | 79 | def tearDown(self): 80 | shutil.rmtree(self.tmpdir) 81 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_markerlib.py: -------------------------------------------------------------------------------- 1 | import os 2 | import unittest 3 | from setuptools.tests.py26compat import skipIf 4 | 5 | try: 6 | import ast 7 | except ImportError: 8 | pass 9 | 10 | class TestMarkerlib(unittest.TestCase): 11 | 12 | @skipIf('ast' not in globals(), 13 | "ast not available (Python < 2.6?)") 14 | def test_markers(self): 15 | from _markerlib import interpret, default_environment, compile 16 | 17 | os_name = os.name 18 | 19 | self.assertTrue(interpret("")) 20 | 21 | self.assertTrue(interpret("os.name != 'buuuu'")) 22 | self.assertTrue(interpret("python_version > '1.0'")) 23 | self.assertTrue(interpret("python_version < '5.0'")) 24 | self.assertTrue(interpret("python_version <= '5.0'")) 25 | self.assertTrue(interpret("python_version >= '1.0'")) 26 | self.assertTrue(interpret("'%s' in os.name" % os_name)) 27 | self.assertTrue(interpret("'buuuu' not in os.name")) 28 | 29 | self.assertFalse(interpret("os.name == 'buuuu'")) 30 | self.assertFalse(interpret("python_version < '1.0'")) 31 | self.assertFalse(interpret("python_version > '5.0'")) 32 | self.assertFalse(interpret("python_version >= '5.0'")) 33 | self.assertFalse(interpret("python_version <= '1.0'")) 34 | self.assertFalse(interpret("'%s' not in os.name" % os_name)) 35 | self.assertFalse(interpret("'buuuu' in os.name and python_version >= '5.0'")) 36 | 37 | environment = default_environment() 38 | environment['extra'] = 'test' 39 | self.assertTrue(interpret("extra == 'test'", environment)) 40 | self.assertFalse(interpret("extra == 'doc'", environment)) 41 | 42 | def raises_nameError(): 43 | try: 44 | interpret("python.version == '42'") 45 | except NameError: 46 | pass 47 | else: 48 | raise Exception("Expected NameError") 49 | 50 | raises_nameError() 51 | 52 | def raises_syntaxError(): 53 | try: 54 | interpret("(x for x in (4,))") 55 | except SyntaxError: 56 | pass 57 | else: 58 | raise Exception("Expected SyntaxError") 59 | 60 | raises_syntaxError() 61 | 62 | statement = "python_version == '5'" 63 | self.assertEqual(compile(statement).__doc__, statement) 64 | 65 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_sandbox.py: -------------------------------------------------------------------------------- 1 | """develop tests 2 | """ 3 | import sys 4 | import os 5 | import shutil 6 | import unittest 7 | import tempfile 8 | 9 | from setuptools.sandbox import DirectorySandbox, SandboxViolation 10 | 11 | def has_win32com(): 12 | """ 13 | Run this to determine if the local machine has win32com, and if it 14 | does, include additional tests. 15 | """ 16 | if not sys.platform.startswith('win32'): 17 | return False 18 | try: 19 | mod = __import__('win32com') 20 | except ImportError: 21 | return False 22 | return True 23 | 24 | class TestSandbox(unittest.TestCase): 25 | 26 | def setUp(self): 27 | self.dir = tempfile.mkdtemp() 28 | 29 | def tearDown(self): 30 | shutil.rmtree(self.dir) 31 | 32 | def test_devnull(self): 33 | if sys.version < '2.4': 34 | return 35 | sandbox = DirectorySandbox(self.dir) 36 | sandbox.run(self._file_writer(os.devnull)) 37 | 38 | def _file_writer(path): 39 | def do_write(): 40 | f = open(path, 'w') 41 | f.write('xxx') 42 | f.close() 43 | return do_write 44 | 45 | _file_writer = staticmethod(_file_writer) 46 | 47 | if has_win32com(): 48 | def test_win32com(self): 49 | """ 50 | win32com should not be prevented from caching COM interfaces 51 | in gen_py. 52 | """ 53 | import win32com 54 | gen_py = win32com.__gen_path__ 55 | target = os.path.join(gen_py, 'test_write') 56 | sandbox = DirectorySandbox(self.dir) 57 | try: 58 | try: 59 | sandbox.run(self._file_writer(target)) 60 | except SandboxViolation: 61 | self.fail("Could not create gen_py file due to SandboxViolation") 62 | finally: 63 | if os.path.exists(target): os.remove(target) 64 | 65 | if __name__ == '__main__': 66 | unittest.main() 67 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_test.py: -------------------------------------------------------------------------------- 1 | # -*- coding: UTF-8 -*- 2 | 3 | """develop tests 4 | """ 5 | import sys 6 | import os, shutil, tempfile, unittest 7 | import tempfile 8 | import site 9 | from StringIO import StringIO 10 | 11 | from distutils.errors import DistutilsError 12 | from setuptools.command.test import test 13 | from setuptools.command import easy_install as easy_install_pkg 14 | from setuptools.dist import Distribution 15 | 16 | SETUP_PY = """\ 17 | from setuptools import setup 18 | 19 | setup(name='foo', 20 | packages=['name', 'name.space', 'name.space.tests'], 21 | namespace_packages=['name'], 22 | test_suite='name.space.tests.test_suite', 23 | ) 24 | """ 25 | 26 | NS_INIT = """# -*- coding: Latin-1 -*- 27 | # Söme Arbiträry Ünicode to test Issüé 310 28 | try: 29 | __import__('pkg_resources').declare_namespace(__name__) 30 | except ImportError: 31 | from pkgutil import extend_path 32 | __path__ = extend_path(__path__, __name__) 33 | """ 34 | # Make sure this is Latin-1 binary, before writing: 35 | if sys.version_info < (3,): 36 | NS_INIT = NS_INIT.decode('UTF-8') 37 | NS_INIT = NS_INIT.encode('Latin-1') 38 | 39 | TEST_PY = """import unittest 40 | 41 | class TestTest(unittest.TestCase): 42 | def test_test(self): 43 | print "Foo" # Should fail under Python 3 unless 2to3 is used 44 | 45 | test_suite = unittest.makeSuite(TestTest) 46 | """ 47 | 48 | class TestTestTest(unittest.TestCase): 49 | 50 | def setUp(self): 51 | if sys.version < "2.6" or hasattr(sys, 'real_prefix'): 52 | return 53 | 54 | # Directory structure 55 | self.dir = tempfile.mkdtemp() 56 | os.mkdir(os.path.join(self.dir, 'name')) 57 | os.mkdir(os.path.join(self.dir, 'name', 'space')) 58 | os.mkdir(os.path.join(self.dir, 'name', 'space', 'tests')) 59 | # setup.py 60 | setup = os.path.join(self.dir, 'setup.py') 61 | f = open(setup, 'wt') 62 | f.write(SETUP_PY) 63 | f.close() 64 | self.old_cwd = os.getcwd() 65 | # name/__init__.py 66 | init = os.path.join(self.dir, 'name', '__init__.py') 67 | f = open(init, 'wb') 68 | f.write(NS_INIT) 69 | f.close() 70 | # name/space/__init__.py 71 | init = os.path.join(self.dir, 'name', 'space', '__init__.py') 72 | f = open(init, 'wt') 73 | f.write('#empty\n') 74 | f.close() 75 | # name/space/tests/__init__.py 76 | init = os.path.join(self.dir, 'name', 'space', 'tests', '__init__.py') 77 | f = open(init, 'wt') 78 | f.write(TEST_PY) 79 | f.close() 80 | 81 | os.chdir(self.dir) 82 | self.old_base = site.USER_BASE 83 | site.USER_BASE = tempfile.mkdtemp() 84 | self.old_site = site.USER_SITE 85 | site.USER_SITE = tempfile.mkdtemp() 86 | 87 | def tearDown(self): 88 | if sys.version < "2.6" or hasattr(sys, 'real_prefix'): 89 | return 90 | 91 | os.chdir(self.old_cwd) 92 | shutil.rmtree(self.dir) 93 | shutil.rmtree(site.USER_BASE) 94 | shutil.rmtree(site.USER_SITE) 95 | site.USER_BASE = self.old_base 96 | site.USER_SITE = self.old_site 97 | 98 | def test_test(self): 99 | if sys.version < "2.6" or hasattr(sys, 'real_prefix'): 100 | return 101 | 102 | dist = Distribution(dict( 103 | name='foo', 104 | packages=['name', 'name.space', 'name.space.tests'], 105 | namespace_packages=['name'], 106 | test_suite='name.space.tests.test_suite', 107 | use_2to3=True, 108 | )) 109 | dist.script_name = 'setup.py' 110 | cmd = test(dist) 111 | cmd.user = 1 112 | cmd.ensure_finalized() 113 | cmd.install_dir = site.USER_SITE 114 | cmd.user = 1 115 | old_stdout = sys.stdout 116 | sys.stdout = StringIO() 117 | try: 118 | try: # try/except/finally doesn't work in Python 2.4, so we need nested try-statements. 119 | cmd.run() 120 | except SystemExit: # The test runner calls sys.exit, stop that making an error. 121 | pass 122 | finally: 123 | sys.stdout = old_stdout 124 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/setuptools/tests/test_upload_docs.py: -------------------------------------------------------------------------------- 1 | """build_ext tests 2 | """ 3 | import sys, os, shutil, tempfile, unittest, site, zipfile 4 | from setuptools.command.upload_docs import upload_docs 5 | from setuptools.dist import Distribution 6 | 7 | SETUP_PY = """\ 8 | from setuptools import setup 9 | 10 | setup(name='foo') 11 | """ 12 | 13 | class TestUploadDocsTest(unittest.TestCase): 14 | def setUp(self): 15 | self.dir = tempfile.mkdtemp() 16 | setup = os.path.join(self.dir, 'setup.py') 17 | f = open(setup, 'w') 18 | f.write(SETUP_PY) 19 | f.close() 20 | self.old_cwd = os.getcwd() 21 | os.chdir(self.dir) 22 | 23 | self.upload_dir = os.path.join(self.dir, 'build') 24 | os.mkdir(self.upload_dir) 25 | 26 | # A test document. 27 | f = open(os.path.join(self.upload_dir, 'index.html'), 'w') 28 | f.write("Hello world.") 29 | f.close() 30 | 31 | # An empty folder. 32 | os.mkdir(os.path.join(self.upload_dir, 'empty')) 33 | 34 | if sys.version >= "2.6": 35 | self.old_base = site.USER_BASE 36 | site.USER_BASE = upload_docs.USER_BASE = tempfile.mkdtemp() 37 | self.old_site = site.USER_SITE 38 | site.USER_SITE = upload_docs.USER_SITE = tempfile.mkdtemp() 39 | 40 | def tearDown(self): 41 | os.chdir(self.old_cwd) 42 | shutil.rmtree(self.dir) 43 | if sys.version >= "2.6": 44 | shutil.rmtree(site.USER_BASE) 45 | shutil.rmtree(site.USER_SITE) 46 | site.USER_BASE = self.old_base 47 | site.USER_SITE = self.old_site 48 | 49 | def test_create_zipfile(self): 50 | # Test to make sure zipfile creation handles common cases. 51 | # This explicitly includes a folder containing an empty folder. 52 | 53 | dist = Distribution() 54 | 55 | cmd = upload_docs(dist) 56 | cmd.upload_dir = self.upload_dir 57 | cmd.target_dir = self.upload_dir 58 | tmp_dir = tempfile.mkdtemp() 59 | tmp_file = os.path.join(tmp_dir, 'foo.zip') 60 | try: 61 | zip_file = cmd.create_zipfile(tmp_file) 62 | 63 | assert zipfile.is_zipfile(tmp_file) 64 | 65 | zip_file = zipfile.ZipFile(tmp_file) # woh... 66 | 67 | assert zip_file.namelist() == ['index.html'] 68 | 69 | zip_file.close() 70 | finally: 71 | shutil.rmtree(tmp_dir) 72 | 73 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/site.py: -------------------------------------------------------------------------------- 1 | def __boot(): 2 | import sys, os, os.path 3 | PYTHONPATH = os.environ.get('PYTHONPATH') 4 | if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): 5 | PYTHONPATH = [] 6 | else: 7 | PYTHONPATH = PYTHONPATH.split(os.pathsep) 8 | 9 | pic = getattr(sys,'path_importer_cache',{}) 10 | stdpath = sys.path[len(PYTHONPATH):] 11 | mydir = os.path.dirname(__file__) 12 | #print "searching",stdpath,sys.path 13 | 14 | for item in stdpath: 15 | if item==mydir or not item: 16 | continue # skip if current dir. on Windows, or my own directory 17 | importer = pic.get(item) 18 | if importer is not None: 19 | loader = importer.find_module('site') 20 | if loader is not None: 21 | # This should actually reload the current module 22 | loader.load_module('site') 23 | break 24 | else: 25 | try: 26 | import imp # Avoid import loop in Python >= 3.3 27 | stream, path, descr = imp.find_module('site',[item]) 28 | except ImportError: 29 | continue 30 | if stream is None: 31 | continue 32 | try: 33 | # This should actually reload the current module 34 | imp.load_module('site',stream,path,descr) 35 | finally: 36 | stream.close() 37 | break 38 | else: 39 | raise ImportError("Couldn't find the real 'site' module") 40 | 41 | #print "loaded", __file__ 42 | 43 | known_paths = dict([(makepath(item)[1],1) for item in sys.path]) # 2.2 comp 44 | 45 | oldpos = getattr(sys,'__egginsert',0) # save old insertion position 46 | sys.__egginsert = 0 # and reset the current one 47 | 48 | for item in PYTHONPATH: 49 | addsitedir(item) 50 | 51 | sys.__egginsert += oldpos # restore effective old position 52 | 53 | d,nd = makepath(stdpath[0]) 54 | insert_at = None 55 | new_path = [] 56 | 57 | for item in sys.path: 58 | p,np = makepath(item) 59 | 60 | if np==nd and insert_at is None: 61 | # We've hit the first 'system' path entry, so added entries go here 62 | insert_at = len(new_path) 63 | 64 | if np in known_paths or insert_at is None: 65 | new_path.append(item) 66 | else: 67 | # new path after the insert point, back-insert it 68 | new_path.insert(insert_at, item) 69 | insert_at += 1 70 | 71 | sys.path[:] = new_path 72 | 73 | if __name__=='site': 74 | __boot() 75 | del __boot 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/install_test.py: -------------------------------------------------------------------------------- 1 | import urllib2 2 | import sys 3 | import os 4 | 5 | if os.path.exists('distribute_setup.py'): 6 | print 'distribute_setup.py exists in the current dir, aborting' 7 | sys.exit(2) 8 | 9 | print '**** Starting Test' 10 | print '\n\n' 11 | 12 | is_jython = sys.platform.startswith('java') 13 | if is_jython: 14 | import subprocess 15 | 16 | print 'Downloading bootstrap' 17 | file = urllib2.urlopen('http://nightly.ziade.org/distribute_setup.py') 18 | f = open('distribute_setup.py', 'w') 19 | f.write(file.read()) 20 | f.close() 21 | 22 | # running it 23 | args = [sys.executable] + ['distribute_setup.py'] 24 | if is_jython: 25 | res = subprocess.call(args) 26 | else: 27 | res = os.spawnv(os.P_WAIT, sys.executable, args) 28 | 29 | if res != 0: 30 | print '**** Test failed, please send me the output at tarek@ziade.org' 31 | os.remove('distribute_setup.py') 32 | sys.exit(2) 33 | 34 | # now checking if Distribute is installed 35 | script = """\ 36 | import sys 37 | try: 38 | import setuptools 39 | except ImportError: 40 | sys.exit(0) 41 | 42 | sys.exit(hasattr(setuptools, "_distribute")) 43 | """ 44 | 45 | root = 'script' 46 | seed = 0 47 | script_name = '%s%d.py' % (root, seed) 48 | 49 | while os.path.exists(script_name): 50 | seed += 1 51 | script_name = '%s%d.py' % (root, seed) 52 | 53 | f = open(script_name, 'w') 54 | try: 55 | f.write(script) 56 | finally: 57 | f.close() 58 | 59 | try: 60 | args = [sys.executable] + [script_name] 61 | if is_jython: 62 | res = subprocess.call(args) 63 | else: 64 | res = os.spawnv(os.P_WAIT, sys.executable, args) 65 | 66 | print '\n\n' 67 | if res: 68 | print '**** Test is OK' 69 | else: 70 | print '**** Test failed, please send me the output at tarek@ziade.org' 71 | finally: 72 | if os.path.exists(script_name): 73 | os.remove(script_name) 74 | os.remove('distribute_setup.py') 75 | 76 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/manual_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import sys 3 | 4 | if sys.version_info[0] >= 3: 5 | raise NotImplementedError('Py3 not supported in this test yet') 6 | 7 | import os 8 | import shutil 9 | import tempfile 10 | from distutils.command.install import INSTALL_SCHEMES 11 | from string import Template 12 | from urllib2 import urlopen 13 | 14 | try: 15 | import subprocess 16 | def _system_call(*args): 17 | assert subprocess.call(args) == 0 18 | except ImportError: 19 | # Python 2.3 20 | def _system_call(*args): 21 | # quoting arguments if windows 22 | if sys.platform == 'win32': 23 | def quote(arg): 24 | if ' ' in arg: 25 | return '"%s"' % arg 26 | return arg 27 | args = [quote(arg) for arg in args] 28 | assert os.system(' '.join(args)) == 0 29 | 30 | def tempdir(func): 31 | def _tempdir(*args, **kwargs): 32 | test_dir = tempfile.mkdtemp() 33 | old_dir = os.getcwd() 34 | os.chdir(test_dir) 35 | try: 36 | return func(*args, **kwargs) 37 | finally: 38 | os.chdir(old_dir) 39 | shutil.rmtree(test_dir) 40 | return _tempdir 41 | 42 | SIMPLE_BUILDOUT = """\ 43 | [buildout] 44 | 45 | parts = eggs 46 | 47 | [eggs] 48 | recipe = zc.recipe.egg 49 | 50 | eggs = 51 | extensions 52 | """ 53 | 54 | BOOTSTRAP = 'http://python-distribute.org/bootstrap.py' 55 | PYVER = sys.version.split()[0][:3] 56 | DEV_URL = 'http://bitbucket.org/tarek/distribute/get/0.6-maintenance.zip#egg=distribute-dev' 57 | 58 | _VARS = {'base': '.', 59 | 'py_version_short': PYVER} 60 | 61 | if sys.platform == 'win32': 62 | PURELIB = INSTALL_SCHEMES['nt']['purelib'] 63 | else: 64 | PURELIB = INSTALL_SCHEMES['unix_prefix']['purelib'] 65 | 66 | 67 | @tempdir 68 | def test_virtualenv(): 69 | """virtualenv with distribute""" 70 | purelib = os.path.abspath(Template(PURELIB).substitute(**_VARS)) 71 | _system_call('virtualenv', '--no-site-packages', '.', '--distribute') 72 | _system_call('bin/easy_install', 'distribute==dev') 73 | # linux specific 74 | site_pkg = os.listdir(purelib) 75 | site_pkg.sort() 76 | assert 'distribute' in site_pkg[0] 77 | easy_install = os.path.join(purelib, 'easy-install.pth') 78 | with open(easy_install) as f: 79 | res = f.read() 80 | assert 'distribute' in res 81 | assert 'setuptools' not in res 82 | 83 | @tempdir 84 | def test_full(): 85 | """virtualenv + pip + buildout""" 86 | _system_call('virtualenv', '--no-site-packages', '.') 87 | _system_call('bin/easy_install', '-q', 'distribute==dev') 88 | _system_call('bin/easy_install', '-qU', 'distribute==dev') 89 | _system_call('bin/easy_install', '-q', 'pip') 90 | _system_call('bin/pip', 'install', '-q', 'zc.buildout') 91 | 92 | with open('buildout.cfg', 'w') as f: 93 | f.write(SIMPLE_BUILDOUT) 94 | 95 | with open('bootstrap.py', 'w') as f: 96 | f.write(urlopen(BOOTSTRAP).read()) 97 | 98 | _system_call('bin/python', 'bootstrap.py', '--distribute') 99 | _system_call('bin/buildout', '-q') 100 | eggs = os.listdir('eggs') 101 | eggs.sort() 102 | assert len(eggs) == 3 103 | assert eggs[0].startswith('distribute') 104 | assert eggs[1:] == ['extensions-0.3-py2.6.egg', 105 | 'zc.recipe.egg-1.2.2-py2.6.egg'] 106 | 107 | if __name__ == '__main__': 108 | test_virtualenv() 109 | test_full() 110 | 111 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/shlib_test/hello.pyx: -------------------------------------------------------------------------------- 1 | cdef extern char *get_hello_msg() 2 | 3 | def hello(): 4 | return get_hello_msg() 5 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/shlib_test/hellolib.c: -------------------------------------------------------------------------------- 1 | extern char* get_hello_msg() { 2 | return "Hello, world!"; 3 | } 4 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/shlib_test/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, Extension, Library 2 | 3 | setup( 4 | name="shlib_test", 5 | ext_modules = [ 6 | Library("hellolib", ["hellolib.c"]), 7 | Extension("hello", ["hello.pyx"], libraries=["hellolib"]) 8 | ], 9 | test_suite="test_hello.HelloWorldTest", 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/shlib_test/test_hello.py: -------------------------------------------------------------------------------- 1 | from unittest import TestCase 2 | 3 | class HelloWorldTest(TestCase): 4 | def testHelloMsg(self): 5 | from hello import hello 6 | self.assertEqual(hello(), "Hello, world!") 7 | 8 | -------------------------------------------------------------------------------- /vendor/distribute-0.6.36/tests/test_distribute_setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import tempfile 4 | import unittest 5 | import shutil 6 | import copy 7 | 8 | CURDIR = os.path.abspath(os.path.dirname(__file__)) 9 | TOPDIR = os.path.split(CURDIR)[0] 10 | sys.path.insert(0, TOPDIR) 11 | 12 | from distribute_setup import (use_setuptools, _build_egg, _python_cmd, 13 | _do_download, _install, DEFAULT_URL, 14 | DEFAULT_VERSION) 15 | import distribute_setup 16 | 17 | class TestSetup(unittest.TestCase): 18 | 19 | def urlopen(self, url): 20 | return open(self.tarball) 21 | 22 | def setUp(self): 23 | self.old_sys_path = copy.copy(sys.path) 24 | self.cwd = os.getcwd() 25 | self.tmpdir = tempfile.mkdtemp() 26 | os.chdir(TOPDIR) 27 | _python_cmd("setup.py", "-q", "egg_info", "-RDb", "''", "sdist", 28 | "--dist-dir", "%s" % self.tmpdir) 29 | tarball = os.listdir(self.tmpdir)[0] 30 | self.tarball = os.path.join(self.tmpdir, tarball) 31 | import urllib2 32 | urllib2.urlopen = self.urlopen 33 | 34 | def tearDown(self): 35 | shutil.rmtree(self.tmpdir) 36 | os.chdir(self.cwd) 37 | sys.path = copy.copy(self.old_sys_path) 38 | 39 | def test_build_egg(self): 40 | # making it an egg 41 | egg = _build_egg(self.tarball, self.tmpdir) 42 | 43 | # now trying to import it 44 | sys.path[0] = egg 45 | import setuptools 46 | self.assertTrue(setuptools.__file__.startswith(egg)) 47 | 48 | def test_do_download(self): 49 | tmpdir = tempfile.mkdtemp() 50 | _do_download(DEFAULT_VERSION, DEFAULT_URL, tmpdir, 1) 51 | import setuptools 52 | self.assertTrue(setuptools.bootstrap_install_from.startswith(tmpdir)) 53 | 54 | def test_install(self): 55 | def _faked(*args): 56 | return True 57 | distribute_setup.python_cmd = _faked 58 | _install(self.tarball) 59 | 60 | def test_use_setuptools(self): 61 | self.assertEqual(use_setuptools(), None) 62 | 63 | # make sure fake_setuptools is not called by default 64 | import pkg_resources 65 | del pkg_resources._distribute 66 | def fake_setuptools(*args): 67 | raise AssertionError 68 | 69 | pkg_resources._fake_setuptools = fake_setuptools 70 | use_setuptools() 71 | 72 | if __name__ == '__main__': 73 | unittest.main() 74 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | Alex Grönholm 2 | Alex Morega 3 | Alexandre Conrad 4 | Andrey Bulgakov 5 | Antti Kaihola 6 | Armin Ronacher 7 | Aziz Köksal 8 | Ben Rosser 9 | Brian Rosner 10 | Carl Meyer 11 | Chris McDonough 12 | Christian Oudard 13 | Clay McClure 14 | Cody Soyland 15 | Daniel Holth 16 | Dave Abrahams 17 | David (d1b) 18 | Dmitry Gladkov 19 | Donald Stufft 20 | Francesco 21 | Geoffrey Lehée 22 | Georgi Valkov 23 | Hugo Lopes Tavares 24 | Ian Bicking 25 | Igor Sobreira 26 | Ionel Maries Cristian 27 | Jakub Vysoky 28 | James Cleveland 29 | Jannis Leidel 30 | Jay Graves 31 | John-Scott Atlakson 32 | Jon Parise 33 | Jonas Nockert 34 | Josh Bronson 35 | Kamal Bin Mustafa 36 | Kelsey Hightower 37 | Kenneth Belitzky 38 | Kumar McMillan 39 | Luke Macken 40 | Masklinn 41 | Marc Abramowitz 42 | Marcus Smith 43 | Markus Hametner 44 | Matt Maker 45 | Maxime R. 46 | Miguel Araujo 47 | Nick Stenning 48 | Nowell Strite 49 | Oliver Tonnhofer 50 | Olivier Girardot 51 | Patrick Jenkins 52 | Paul Moore 53 | Paul Nasrat 54 | Paul Oswald 55 | Paul van der Linden 56 | Peter Waller 57 | Phil Whelan 58 | Piet Delport 59 | Przemek Wrzos 60 | Qiangning Hong 61 | Rafael Caricio 62 | Rene Dudfield 63 | Roey Berman 64 | Ronny Pfannschmidt 65 | Rory McCann 66 | Simon Cross 67 | Stavros Korokithakis 68 | Thomas Fenzl 69 | Thomas Johansson 70 | Vinay Sajip 71 | Vitaly Babiy 72 | W Trevor King 73 | Wil Tan 74 | Hsiaoming Yang 75 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2013 The pip developers (see AUTHORS.txt file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | 23 | License for Bundle of CA Root Certificates (pip/cacert.pem) 24 | =========================================================== 25 | 26 | This library is free software; you can redistribute it and/or 27 | modify it under the terms of the GNU Lesser General Public 28 | License as published by the Free Software Foundation; either 29 | version 2.1 of the License, or (at your option) any later version. 30 | 31 | This library is distributed in the hope that it will be useful, 32 | but WITHOUT ANY WARRANTY; without even the implied warranty of 33 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 34 | Lesser General Public License for more details. 35 | 36 | You should have received a copy of the GNU Lesser General Public 37 | License along with this library; if not, write to the Free Software 38 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 39 | 02110-1301 40 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include AUTHORS.txt 2 | include LICENSE.txt 3 | include CHANGES.txt 4 | include PROJECT.txt 5 | include pip/cacert.pem 6 | recursive-include docs *.txt 7 | recursive-include docs *.html 8 | recursive-exclude docs/_build *.txt 9 | prune docs/_build/_sources 10 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/PROJECT.txt: -------------------------------------------------------------------------------- 1 | Project Info 2 | ============ 3 | 4 | * Project Page: https://github.com/pypa/pip 5 | * Bug Tracking: https://github.com/pypa/pip/issues 6 | * Mailing list: http://groups.google.com/group/python-virtualenv 7 | * Docs: http://www.pip-installer.org 8 | * IRC: #pip. 9 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/README.rst: -------------------------------------------------------------------------------- 1 | pip 2 | === 3 | 4 | .. image:: https://secure.travis-ci.org/pypa/pip.png?branch=develop 5 | :target: http://travis-ci.org/pypa/pip 6 | 7 | For documentation, see http://www.pip-installer.org 8 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/configuration.txt: -------------------------------------------------------------------------------- 1 | .. _`Configuration`: 2 | 3 | Configuration 4 | ================= 5 | 6 | Config file 7 | ------------ 8 | 9 | pip allows you to set all command line option defaults in a standard ini 10 | style config file. 11 | 12 | The names and locations of the configuration files vary slightly across 13 | platforms. 14 | 15 | * On Unix and Mac OS X the configuration file is: :file:`$HOME/.pip/pip.conf` 16 | * On Windows, the configuration file is: :file:`%HOME%\\pip\\pip.ini` 17 | 18 | You can set a custom path location for the config file using the environment variable ``PIP_CONFIG_FILE``. 19 | 20 | The names of the settings are derived from the long command line option, e.g. 21 | if you want to use a different package index (``--index-url``) and set the 22 | HTTP timeout (``--default-timeout``) to 60 seconds your config file would 23 | look like this: 24 | 25 | .. code-block:: ini 26 | 27 | [global] 28 | timeout = 60 29 | index-url = http://download.zope.org/ppix 30 | 31 | Each subcommand can be configured optionally in its own section so that every 32 | global setting with the same name will be overridden; e.g. decreasing the 33 | ``timeout`` to ``10`` seconds when running the `freeze` 34 | (`Freezing Requirements <./#freezing-requirements>`_) command and using 35 | ``60`` seconds for all other commands is possible with: 36 | 37 | .. code-block:: ini 38 | 39 | [global] 40 | timeout = 60 41 | 42 | [freeze] 43 | timeout = 10 44 | 45 | 46 | Boolean options like ``--ignore-installed`` or ``--no-dependencies`` can be 47 | set like this: 48 | 49 | .. code-block:: ini 50 | 51 | [install] 52 | ignore-installed = true 53 | no-dependencies = yes 54 | 55 | Appending options like ``--find-links`` can be written on multiple lines: 56 | 57 | .. code-block:: ini 58 | 59 | [global] 60 | find-links = 61 | http://download.example.com 62 | 63 | [install] 64 | find-links = 65 | http://mirror1.example.com 66 | http://mirror2.example.com 67 | 68 | 69 | Environment Variables 70 | --------------------- 71 | 72 | pip's command line options can be set with 73 | environment variables using the format ``PIP_`` . Dashes (``-``) have to replaced with underscores (``_``). 74 | 75 | For example, to set the default timeout:: 76 | 77 | export PIP_DEFAULT_TIMEOUT=60 78 | 79 | This is the same as passing the option to pip directly:: 80 | 81 | pip --default-timeout=60 [...] 82 | 83 | To set options that can be set multiple times on the command line, just add spaces in between values. For example:: 84 | 85 | export PIP_FIND_LINKS="http://mirror1.example.com http://mirror2.example.com" 86 | 87 | is the same as calling:: 88 | 89 | pip install --find-links=http://mirror1.example.com --find-links=http://mirror2.example.com 90 | 91 | 92 | Config Precedence 93 | ----------------- 94 | 95 | Command line options have precedence over environment variables, which have precedence over the config file. 96 | 97 | Within the config file, command specific sections have precedence over the global section. 98 | 99 | Examples: 100 | 101 | - ``--host=foo`` overrides ``PIP_HOST=foo`` 102 | - ``PIP_HOST=foo`` overrides a config file with ``[global] host = foo`` 103 | - A command specific section in the config file ``[] host = bar`` 104 | overrides the option with same name in the ``[global]`` config file section 105 | 106 | 107 | Command Completion 108 | ------------------ 109 | 110 | pip comes with support for command line completion in bash and zsh. 111 | 112 | To setup for bash:: 113 | 114 | $ pip completion --bash >> ~/.profile 115 | 116 | To setup for zsh:: 117 | 118 | $ pip completion --zsh >> ~/.zprofile 119 | 120 | Alternatively, you can use the result of the ``completion`` command 121 | directly with the eval function of you shell, e.g. by adding the following to your startup file:: 122 | 123 | eval "`pip completion --bash`" 124 | 125 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/development.txt: -------------------------------------------------------------------------------- 1 | =========== 2 | Development 3 | =========== 4 | 5 | Pull Requests 6 | ============= 7 | 8 | Submit Pull Requests against the `develop` branch. 9 | 10 | Provide a good description of what you're doing and why. 11 | 12 | Provide tests that cover your changes and try to run the tests locally first. 13 | 14 | Automated Testing 15 | ================= 16 | 17 | All pull requests and merges to 'develop' branch are tested in `Travis `_ 18 | based on our `.travis.yml file `_. 19 | 20 | Usually, a link to your specific travis build appears in pull requests, but if not, 21 | you can find it on our `travis pull requests page `_ 22 | 23 | The only way to trigger Travis to run again for a pull request, is to submit another change to the pull branch. 24 | 25 | We also have Jenkins CI that runs regularly for certain python versions on windows and centos. 26 | 27 | Running tests 28 | ============= 29 | 30 | OS Requirements: subversion, bazaar, git, and mercurial. 31 | 32 | Python Requirements: nose, virtualenv, scripttest, and mock 33 | 34 | Ways to run the tests locally: 35 | 36 | :: 37 | 38 | $ python setup.py test # Using the setuptools test plugin 39 | $ nosetests # Using nosetests directly 40 | $ tox # Using tox against pip's tox.ini 41 | 42 | 43 | Getting Involved 44 | ================ 45 | 46 | The pip project welcomes help in the following ways: 47 | 48 | - Making Pull Requests for code, tests, or docs. 49 | - Commenting on open issues and pull requests. 50 | - Helping to answer questions on the mailing list. 51 | 52 | If you want to become an official maintainer, start by helping out. 53 | 54 | Later, when you think you're ready, get in touch with one of the maintainers, 55 | and they will initiate a vote. 56 | 57 | Release Process 58 | =============== 59 | 60 | This process includes virtualenv, since pip releases necessitate a virtualenv release. 61 | 62 | :/: refers to the old and new versions of pip. 63 | :/: refers to the old and new versions of virtualenv. 64 | 65 | 1. Upgrade distribute, if needed: 66 | 67 | #. Upgrade distribute in ``virtualenv:develop`` using the :ref:`Refresh virtualenv` process. 68 | #. Create a pull request against ``pip:develop`` with a modified ``.travis.yml`` file that installs virtualenv from ``virtualenv:develop``, to confirm the travis builds are still passing. 69 | 70 | 2. Create Release branches: 71 | 72 | #. Create ``pip:`` branch. 73 | #. In ``pip:develop``, change ``pip.version`` to '.post1'. 74 | #. Create ``virtualenv:`` branch. 75 | #. In ``virtualenv:develop``, change ``virtualenv.version`` to '.post1'. 76 | 77 | 3. Prepare "rcX": 78 | 79 | #. In ``pip:``, change ``pip.version`` to 'rcX', and tag with 'rcX'. 80 | #. Build a pip sdist from ``pip:``, and build it into ``virtualenv:`` using the :ref:`Refresh virtualenv` process. 81 | #. In ``virtualenv:``, change ``virtualenv.version`` to 'rcX', and tag with 'rcX'. 82 | 83 | 4. Announce ``pip-rcX`` and ``virtualenv-rcX`` with the :ref:`RC Install Instructions` and elicit feedback. 84 | 85 | 5. Apply fixes to 'rcX': 86 | 87 | #. Apply fixes to ``pip:`` and ``virtualenv:`` 88 | #. Periodically merge fixes to ``pip:develop`` and ``virtualenv:develop`` 89 | 90 | 6. Repeat #4 thru #6 if needed. 91 | 92 | 7. Final Release: 93 | 94 | #. In ``pip:``, change ``pip.version`` to '', and tag with ''. 95 | #. Merge ``pip:`` to ``pip:master``. 96 | #. Build a pip sdist from ``pip:``, and load it into ``virtualenv:`` using the :ref:`Refresh virtualenv` process. 97 | #. Merge ``vitualenv:`` to ``virtualenv:develop``. 98 | #. In ``virtualenv:``, change ``virtualenv.version`` to '', and tag with ''. 99 | #. Merge ``virtualenv:`` to ``virtualenv:master`` 100 | #. Build and upload pip and virtualenv sdists to PyPI. 101 | 102 | .. _`Refresh virtualenv`: 103 | 104 | Refresh virtualenv 105 | ++++++++++++++++++ 106 | 107 | #. Set the embedded versions of pip, distribute and setuptools in ``bin/refresh-support-files.py`` 108 | #. Additionally, set the version of distribute in ``virtualenv_embedded/distribute_setup.py``, and setuptools in ``virtualenv_embedded/ez_setup.py`` 109 | #. Run ``bin/refresh-support-files.py`` to download the latest versions. 110 | When specifying a beta of pip not on pypi, the last part of this script will fail. In this case, the pip sdist needs to be placed manually into ``virtualenv_support``. 111 | #. Run ``bin/rebuild-script.py`` to rebuild virtualenv based on the latest versions. 112 | 113 | 114 | .. _`RC Install Instructions`: 115 | 116 | RC Install Instructions 117 | +++++++++++++++++++++++ 118 | 119 | #. Download and unpack ``https://github.com/pypa/virtualenv/archive/rcX.tar.gz`` 120 | #. Run: ``python virtualenv-rcX/virtualenv.py myVE`` 121 | #. ``myVE/bin/pip`` will be the rcX version of pip. 122 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/index.txt: -------------------------------------------------------------------------------- 1 | pip 2 | === 3 | 4 | A tool for installing and managing Python packages. 5 | 6 | `Mailing list `_ ``|`` 7 | `Issues `_ ``|`` 8 | `Github `_ ``|`` 9 | `PyPI `_ ``|`` 10 | irc:#pip 11 | 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | 16 | quickstart 17 | installing 18 | usage 19 | cookbook 20 | logic 21 | configuration 22 | other-tools 23 | development 24 | news 25 | 26 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/installing.txt: -------------------------------------------------------------------------------- 1 | .. _`Installation`: 2 | 3 | Installation 4 | ============ 5 | 6 | .. warning:: 7 | 8 | Prior to version 1.3, pip did not use SSL for downloading packages from PyPI, and thus left 9 | users more vulnerable to security threats. We advise installing at least version 1.3. 10 | If you're using `virtualenv `_ to install pip, we advise installing 11 | at least version 1.9, which contains pip version 1.3. 12 | 13 | 14 | Python & OS Support 15 | ------------------- 16 | 17 | pip works with CPython versions 2.5, 2.6, 2.7, 3.1, 3.2, 3.3 and also pypy. 18 | 19 | pip works on Unix/Linux, OS X, and Windows. 20 | 21 | 22 | Using virtualenv 23 | ---------------- 24 | 25 | The easiest way to install and use pip is with `virtualenv 26 | `_, since every virtualenv has pip (and it's dependencies) installed into it 27 | automatically. 28 | 29 | This does not require root access or modify your system Python 30 | installation. For instance:: 31 | 32 | $ virtualenv my_env 33 | $ . my_env/bin/activate 34 | (my_env)$ pip install SomePackage 35 | 36 | When used in this manner, pip will only affect the active virtual environment. 37 | 38 | See the `virtualenv installation instructions `_. 39 | 40 | Installing Globally 41 | ------------------- 42 | 43 | pip can be installed globally in order to manage global packages. 44 | Often this requires the installation to be performed as root. 45 | 46 | .. warning:: 47 | 48 | We advise against using `easy_install `_ to install pip, because easy_install 49 | does not download from PyPI over SSL, so the installation might be insecure. 50 | Since pip can then be used to install packages (which execute code on 51 | your computer), it is better to go through a trusted path. 52 | 53 | 54 | Requirements 55 | ++++++++++++ 56 | 57 | pip requires either `setuptools `_ 58 | or `distribute `_. 59 | 60 | See the `Distribute Install Instructions `_ or the 61 | `Setuptools Install Instructions `_ 62 | 63 | If installing pip using a linux package manager, these requirements will be installed for you. 64 | 65 | .. warning:: 66 | 67 | If you are using Python 3.X you **must** use distribute; setuptools doesn't 68 | support Python 3.X. 69 | 70 | 71 | Using get-pip 72 | +++++++++++++ 73 | 74 | After installing the requirements: 75 | 76 | :: 77 | 78 | $ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py 79 | $ [sudo] python get-pip.py 80 | 81 | 82 | Installing from source 83 | ++++++++++++++++++++++ 84 | 85 | After installing the requirements: 86 | 87 | :: 88 | 89 | $ curl -O https://pypi.python.org/packages/source/p/pip/pip-X.X.tar.gz 90 | $ tar xvfz pip-X.X.tar.gz 91 | $ cd pip-X.X 92 | $ [sudo] python setup.py install 93 | 94 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/news.txt: -------------------------------------------------------------------------------- 1 | ======== 2 | News 3 | ======== 4 | 5 | Next Release 6 | ============ 7 | 8 | Beta and final releases of 1.3 are planned for Feb 2013. 9 | 10 | 11 | .. include:: ../CHANGES.txt 12 | 13 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/other-tools.txt: -------------------------------------------------------------------------------- 1 | =================== 2 | Other tools 3 | =================== 4 | 5 | virtualenv 6 | ---------- 7 | 8 | pip is most nutritious when used with `virtualenv 9 | `__. One of the reasons pip 10 | doesn't install "multi-version" eggs is that virtualenv removes much of the need 11 | for it. Because pip is installed by virtualenv, just use 12 | ``path/to/my/environment/bin/pip`` to install things into that 13 | specific environment. 14 | 15 | To tell pip to only run if there is a virtualenv currently activated, 16 | and to bail if not, use:: 17 | 18 | export PIP_REQUIRE_VIRTUALENV=true 19 | 20 | 21 | easy_install 22 | ------------ 23 | 24 | pip was originally written to improve on `easy_install `_ in the following ways: 25 | 26 | * All packages are downloaded before installation. Partially-completed 27 | installation doesn't occur as a result. 28 | 29 | * Care is taken to present useful output on the console. 30 | 31 | * The reasons for actions are kept track of. For instance, if a package is 32 | being installed, pip keeps track of why that package was required. 33 | 34 | * Error messages should be useful. 35 | 36 | * The code is relatively concise and cohesive, making it easier to use 37 | programmatically. 38 | 39 | * Packages don't have to be installed as egg archives, they can be installed 40 | flat (while keeping the egg metadata). 41 | 42 | * Native support for other version control systems (Git, Mercurial and Bazaar) 43 | 44 | * Uninstallation of packages. 45 | 46 | * Simple to define fixed sets of requirements and reliably reproduce a 47 | set of packages. 48 | 49 | pip doesn't do everything that easy_install does. Specifically: 50 | 51 | * It cannot install from eggs. It only installs from source. (In the 52 | future it would be good if it could install binaries from Windows ``.exe`` 53 | or ``.msi`` -- binary install on other platforms is not a priority.) 54 | 55 | * It is incompatible with some packages that extensively customize distutils 56 | or setuptools in their ``setup.py`` files. 57 | 58 | 59 | buildout 60 | -------- 61 | 62 | If you are using `zc.buildout 63 | `_ you should look at 64 | `gp.recipe.pip `_ as an 65 | option to use pip and virtualenv in your buildouts. 66 | 67 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/docs/quickstart.txt: -------------------------------------------------------------------------------- 1 | 2 | Quickstart 3 | ========== 4 | 5 | Install a package: 6 | 7 | :: 8 | 9 | $ pip install SomePackage==1.0 10 | [...] 11 | Successfully installed SomePackage 12 | 13 | Show what files were installed: 14 | 15 | :: 16 | 17 | $ pip show --files SomePackage 18 | Name: SomePackage 19 | Version: 1.0 20 | Location: /my/env/lib/pythonx.x/site-packages 21 | Files: 22 | ../somepackage/__init__.py 23 | [...] 24 | 25 | List what packages are outdated: 26 | 27 | :: 28 | 29 | $ pip list --outdated 30 | SomePackage (Current: 1.0 Latest: 2.0) 31 | 32 | Upgrade a package: 33 | 34 | :: 35 | 36 | $ pip install --upgrade SomePackage 37 | [...] 38 | Found existing installation: SomePackage 1.0 39 | Uninstalling SomePackage: 40 | Successfully uninstalled SomePackage 41 | Running setup.py install for SomePackage 42 | Successfully installed SomePackage 43 | 44 | Uninstall a package: 45 | 46 | :: 47 | 48 | $ pip uninstall SomePackage 49 | Uninstalling SomePackage: 50 | /my/env/lib/pythonx.x/site-packages/somepackage 51 | Proceed (y/n)? y 52 | Successfully uninstalled SomePackage 53 | 54 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/__main__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from .runner import run 3 | 4 | if __name__ == '__main__': 5 | exit = run() 6 | if exit: 7 | sys.exit(exit) 8 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/backwardcompat/__init__.py: -------------------------------------------------------------------------------- 1 | """Stuff that differs in different Python versions""" 2 | 3 | import os 4 | import imp 5 | import sys 6 | import site 7 | 8 | __all__ = ['WindowsError'] 9 | 10 | uses_pycache = hasattr(imp, 'cache_from_source') 11 | 12 | 13 | class NeverUsedException(Exception): 14 | """this exception should never be raised""" 15 | 16 | try: 17 | WindowsError = WindowsError 18 | except NameError: 19 | WindowsError = NeverUsedException 20 | 21 | try: 22 | #new in Python 3.3 23 | PermissionError = PermissionError 24 | except NameError: 25 | PermissionError = NeverUsedException 26 | 27 | console_encoding = sys.__stdout__.encoding 28 | 29 | if sys.version_info >= (3,): 30 | from io import StringIO, BytesIO 31 | from functools import reduce 32 | from urllib.error import URLError, HTTPError 33 | from queue import Queue, Empty 34 | from urllib.request import url2pathname 35 | from urllib.request import urlretrieve 36 | from email import message as emailmessage 37 | import urllib.parse as urllib 38 | import urllib.request as urllib2 39 | import configparser as ConfigParser 40 | import xmlrpc.client as xmlrpclib 41 | import urllib.parse as urlparse 42 | import http.client as httplib 43 | 44 | def cmp(a, b): 45 | return (a > b) - (a < b) 46 | 47 | def b(s): 48 | return s.encode('utf-8') 49 | 50 | def u(s): 51 | return s.decode('utf-8') 52 | 53 | def console_to_str(s): 54 | try: 55 | return s.decode(console_encoding) 56 | except UnicodeDecodeError: 57 | return s.decode('utf_8') 58 | 59 | def fwrite(f, s): 60 | f.buffer.write(b(s)) 61 | 62 | bytes = bytes 63 | string_types = (str,) 64 | raw_input = input 65 | else: 66 | from cStringIO import StringIO 67 | from urllib2 import URLError, HTTPError 68 | from Queue import Queue, Empty 69 | from urllib import url2pathname, urlretrieve 70 | from email import Message as emailmessage 71 | import urllib 72 | import urllib2 73 | import urlparse 74 | import ConfigParser 75 | import xmlrpclib 76 | import httplib 77 | 78 | def b(s): 79 | return s 80 | 81 | def u(s): 82 | return s 83 | 84 | def console_to_str(s): 85 | return s 86 | 87 | def fwrite(f, s): 88 | f.write(s) 89 | 90 | bytes = str 91 | string_types = (basestring,) 92 | reduce = reduce 93 | cmp = cmp 94 | raw_input = raw_input 95 | BytesIO = StringIO 96 | 97 | 98 | from distutils.sysconfig import get_python_lib, get_python_version 99 | 100 | #site.USER_SITE was created in py2.6 101 | user_site = getattr(site, 'USER_SITE', None) 102 | 103 | 104 | def product(*args, **kwds): 105 | # product('ABCD', 'xy') --> Ax Ay Bx By Cx Cy Dx Dy 106 | # product(range(2), repeat=3) --> 000 001 010 011 100 101 110 111 107 | pools = list(map(tuple, args)) * kwds.get('repeat', 1) 108 | result = [[]] 109 | for pool in pools: 110 | result = [x + [y] for x in result for y in pool] 111 | for prod in result: 112 | yield tuple(prod) 113 | 114 | 115 | def home_lib(home): 116 | """Return the lib dir under the 'home' installation scheme""" 117 | if hasattr(sys, 'pypy_version_info'): 118 | lib = 'site-packages' 119 | else: 120 | lib = os.path.join('lib', 'python') 121 | return os.path.join(home, lib) 122 | 123 | 124 | ## py25 has no builtin ssl module 125 | ## only >=py32 has ssl.match_hostname and ssl.CertificateError 126 | try: 127 | import ssl 128 | try: 129 | from ssl import match_hostname, CertificateError 130 | except ImportError: 131 | from pip.backwardcompat.ssl_match_hostname import match_hostname, CertificateError 132 | except ImportError: 133 | ssl = None 134 | 135 | 136 | # patch for py25 socket to work with http://pypi.python.org/pypi/ssl/ 137 | import socket 138 | if not hasattr(socket, 'create_connection'): # for Python 2.5 139 | # monkey-patch socket module 140 | from pip.backwardcompat.socket_create_connection import create_connection 141 | socket.create_connection = create_connection 142 | 143 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/backwardcompat/socket_create_connection.py: -------------------------------------------------------------------------------- 1 | """ 2 | patch for py25 socket to work with http://pypi.python.org/pypi/ssl/ 3 | copy-paste from py2.6 stdlib socket.py 4 | https://gist.github.com/zed/1347055 5 | """ 6 | import socket 7 | import sys 8 | 9 | _GLOBAL_DEFAULT_TIMEOUT = getattr(socket, '_GLOBAL_DEFAULT_TIMEOUT', object()) 10 | def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, 11 | source_address=None): 12 | """Connect to *address* and return the socket object. 13 | 14 | Convenience function. Connect to *address* (a 2-tuple ``(host, 15 | port)``) and return the socket object. Passing the optional 16 | *timeout* parameter will set the timeout on the socket instance 17 | before attempting to connect. If no *timeout* is supplied, the 18 | global default timeout setting returned by :func:`getdefaulttimeout` 19 | is used. 20 | """ 21 | 22 | host, port = address 23 | err = None 24 | for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): 25 | af, socktype, proto, canonname, sa = res 26 | sock = None 27 | try: 28 | sock = socket.socket(af, socktype, proto) 29 | if timeout is not _GLOBAL_DEFAULT_TIMEOUT: 30 | sock.settimeout(timeout) 31 | if source_address: 32 | sock.bind(source_address) 33 | sock.connect(sa) 34 | return sock 35 | 36 | except socket.error: 37 | err = sys.exc_info()[1] 38 | if sock is not None: 39 | sock.close() 40 | 41 | if err is not None: 42 | raise err 43 | else: 44 | raise socket.error("getaddrinfo returns an empty list") 45 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/backwardcompat/ssl_match_hostname.py: -------------------------------------------------------------------------------- 1 | """The match_hostname() function from Python 3.2, essential when using SSL.""" 2 | 3 | import re 4 | 5 | __version__ = '3.2a3' 6 | 7 | class CertificateError(ValueError): 8 | pass 9 | 10 | def _dnsname_to_pat(dn): 11 | pats = [] 12 | for frag in dn.split(r'.'): 13 | if frag == '*': 14 | # When '*' is a fragment by itself, it matches a non-empty dotless 15 | # fragment. 16 | pats.append('[^.]+') 17 | else: 18 | # Otherwise, '*' matches any dotless fragment. 19 | frag = re.escape(frag) 20 | pats.append(frag.replace(r'\*', '[^.]*')) 21 | return re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) 22 | 23 | def match_hostname(cert, hostname): 24 | """Verify that *cert* (in decoded format as returned by 25 | SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 rules 26 | are mostly followed, but IP addresses are not accepted for *hostname*. 27 | 28 | CertificateError is raised on failure. On success, the function 29 | returns nothing. 30 | """ 31 | if not cert: 32 | raise ValueError("empty or no certificate") 33 | dnsnames = [] 34 | san = cert.get('subjectAltName', ()) 35 | for key, value in san: 36 | if key == 'DNS': 37 | if _dnsname_to_pat(value).match(hostname): 38 | return 39 | dnsnames.append(value) 40 | if not san: 41 | # The subject is only checked when subjectAltName is empty 42 | for sub in cert.get('subject', ()): 43 | for key, value in sub: 44 | # XXX according to RFC 2818, the most specific Common Name 45 | # must be used. 46 | if key == 'commonName': 47 | if _dnsname_to_pat(value).match(hostname): 48 | return 49 | dnsnames.append(value) 50 | if len(dnsnames) > 1: 51 | raise CertificateError("hostname %r " 52 | "doesn't match either of %s" 53 | % (hostname, ', '.join(map(repr, dnsnames)))) 54 | elif len(dnsnames) == 1: 55 | raise CertificateError("hostname %r " 56 | "doesn't match %r" 57 | % (hostname, dnsnames[0])) 58 | else: 59 | raise CertificateError("no appropriate commonName or " 60 | "subjectAltName fields were found") 61 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/cmdoptions.py: -------------------------------------------------------------------------------- 1 | """shared options and groups""" 2 | from optparse import make_option, OptionGroup 3 | 4 | 5 | def make_option_group(group, parser): 6 | """ 7 | Return an OptionGroup object 8 | group -- assumed to be dict with 'name' and 'options' keys 9 | parser -- an optparse Parser 10 | """ 11 | option_group = OptionGroup(parser, group['name']) 12 | for option in group['options']: 13 | option_group.add_option(option) 14 | return option_group 15 | 16 | ########### 17 | # options # 18 | ########### 19 | 20 | index_url = make_option( 21 | '-i', '--index-url', '--pypi-url', 22 | dest='index_url', 23 | metavar='URL', 24 | default='https://pypi.python.org/simple/', 25 | help='Base URL of Python Package Index (default %default).') 26 | 27 | extra_index_url = make_option( 28 | '--extra-index-url', 29 | dest='extra_index_urls', 30 | metavar='URL', 31 | action='append', 32 | default=[], 33 | help='Extra URLs of package indexes to use in addition to --index-url.') 34 | 35 | no_index = make_option( 36 | '--no-index', 37 | dest='no_index', 38 | action='store_true', 39 | default=False, 40 | help='Ignore package index (only looking at --find-links URLs instead).') 41 | 42 | find_links = make_option( 43 | '-f', '--find-links', 44 | dest='find_links', 45 | action='append', 46 | default=[], 47 | metavar='url', 48 | help="If a url or path to an html file, then parse for links to archives. If a local path or file:// url that's a directory, then look for archives in the directory listing.") 49 | 50 | use_mirrors = make_option( 51 | '-M', '--use-mirrors', 52 | dest='use_mirrors', 53 | action='store_true', 54 | default=False, 55 | help='Use the PyPI mirrors as a fallback in case the main index is down.') 56 | 57 | mirrors = make_option( 58 | '--mirrors', 59 | dest='mirrors', 60 | metavar='URL', 61 | action='append', 62 | default=[], 63 | help='Specific mirror URLs to query when --use-mirrors is used.') 64 | 65 | 66 | ########## 67 | # groups # 68 | ########## 69 | 70 | index_group = { 71 | 'name': 'Package Index Options', 72 | 'options': [ 73 | index_url, 74 | extra_index_url, 75 | no_index, 76 | find_links, 77 | use_mirrors, 78 | mirrors 79 | ] 80 | } 81 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Package containing all pip commands 3 | """ 4 | 5 | 6 | from pip.commands.bundle import BundleCommand 7 | from pip.commands.completion import CompletionCommand 8 | from pip.commands.freeze import FreezeCommand 9 | from pip.commands.help import HelpCommand 10 | from pip.commands.list import ListCommand 11 | from pip.commands.search import SearchCommand 12 | from pip.commands.show import ShowCommand 13 | from pip.commands.install import InstallCommand 14 | from pip.commands.uninstall import UninstallCommand 15 | from pip.commands.unzip import UnzipCommand 16 | from pip.commands.zip import ZipCommand 17 | 18 | 19 | commands = { 20 | BundleCommand.name: BundleCommand, 21 | CompletionCommand.name: CompletionCommand, 22 | FreezeCommand.name: FreezeCommand, 23 | HelpCommand.name: HelpCommand, 24 | SearchCommand.name: SearchCommand, 25 | ShowCommand.name: ShowCommand, 26 | InstallCommand.name: InstallCommand, 27 | UninstallCommand.name: UninstallCommand, 28 | UnzipCommand.name: UnzipCommand, 29 | ZipCommand.name: ZipCommand, 30 | ListCommand.name: ListCommand, 31 | } 32 | 33 | 34 | commands_order = [ 35 | InstallCommand, 36 | UninstallCommand, 37 | FreezeCommand, 38 | ListCommand, 39 | ShowCommand, 40 | SearchCommand, 41 | ZipCommand, 42 | UnzipCommand, 43 | BundleCommand, 44 | HelpCommand, 45 | ] 46 | 47 | 48 | def get_summaries(ignore_hidden=True, ordered=True): 49 | """Yields sorted (command name, command summary) tuples.""" 50 | 51 | if ordered: 52 | cmditems = _sort_commands(commands, commands_order) 53 | else: 54 | cmditems = commands.items() 55 | 56 | for name, command_class in cmditems: 57 | if ignore_hidden and command_class.hidden: 58 | continue 59 | 60 | yield (name, command_class.summary) 61 | 62 | 63 | def get_similar_commands(name): 64 | """Command name auto-correct.""" 65 | from difflib import get_close_matches 66 | 67 | close_commands = get_close_matches(name, commands.keys()) 68 | 69 | if close_commands: 70 | guess = close_commands[0] 71 | else: 72 | guess = False 73 | 74 | return guess 75 | 76 | 77 | def _sort_commands(cmddict, order): 78 | def keyfn(key): 79 | try: 80 | return order.index(key[1]) 81 | except ValueError: 82 | # unordered items should come last 83 | return 0xff 84 | 85 | return sorted(cmddict.items(), key=keyfn) 86 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/bundle.py: -------------------------------------------------------------------------------- 1 | from pip.locations import build_prefix, src_prefix 2 | from pip.util import display_path, backup_dir 3 | from pip.log import logger 4 | from pip.exceptions import InstallationError 5 | from pip.commands.install import InstallCommand 6 | 7 | 8 | class BundleCommand(InstallCommand): 9 | """Create pybundles (archives containing multiple packages).""" 10 | name = 'bundle' 11 | usage = """ 12 | %prog [options] .pybundle ...""" 13 | summary = 'Create pybundles.' 14 | bundle = True 15 | 16 | def __init__(self, *args, **kw): 17 | super(BundleCommand, self).__init__(*args, **kw) 18 | # bundle uses different default source and build dirs 19 | build_opt = self.parser.get_option("--build") 20 | build_opt.default = backup_dir(build_prefix, '-bundle') 21 | src_opt = self.parser.get_option("--src") 22 | src_opt.default = backup_dir(src_prefix, '-bundle') 23 | self.parser.set_defaults(**{ 24 | src_opt.dest: src_opt.default, 25 | build_opt.dest: build_opt.default, 26 | }) 27 | 28 | def run(self, options, args): 29 | if not args: 30 | raise InstallationError('You must give a bundle filename') 31 | # We have to get everything when creating a bundle: 32 | options.ignore_installed = True 33 | logger.notify('Putting temporary build files in %s and source/develop files in %s' 34 | % (display_path(options.build_dir), display_path(options.src_dir))) 35 | self.bundle_filename = args.pop(0) 36 | requirement_set = super(BundleCommand, self).run(options, args) 37 | return requirement_set 38 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/completion.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from pip.basecommand import Command 3 | 4 | BASE_COMPLETION = """ 5 | # pip %(shell)s completion start%(script)s# pip %(shell)s completion end 6 | """ 7 | 8 | COMPLETION_SCRIPTS = { 9 | 'bash': """ 10 | _pip_completion() 11 | { 12 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ 13 | COMP_CWORD=$COMP_CWORD \\ 14 | PIP_AUTO_COMPLETE=1 $1 ) ) 15 | } 16 | complete -o default -F _pip_completion pip 17 | """, 'zsh': """ 18 | function _pip_completion { 19 | local words cword 20 | read -Ac words 21 | read -cn cword 22 | reply=( $( COMP_WORDS="$words[*]" \\ 23 | COMP_CWORD=$(( cword-1 )) \\ 24 | PIP_AUTO_COMPLETE=1 $words[1] ) ) 25 | } 26 | compctl -K _pip_completion pip 27 | """} 28 | 29 | 30 | class CompletionCommand(Command): 31 | """A helper command to be used for command completion.""" 32 | name = 'completion' 33 | summary = 'A helper command to be used for command completion' 34 | hidden = True 35 | 36 | def __init__(self, *args, **kw): 37 | super(CompletionCommand, self).__init__(*args, **kw) 38 | self.parser.add_option( 39 | '--bash', '-b', 40 | action='store_const', 41 | const='bash', 42 | dest='shell', 43 | help='Emit completion code for bash') 44 | self.parser.add_option( 45 | '--zsh', '-z', 46 | action='store_const', 47 | const='zsh', 48 | dest='shell', 49 | help='Emit completion code for zsh') 50 | 51 | def run(self, options, args): 52 | """Prints the completion code of the given shell""" 53 | shells = COMPLETION_SCRIPTS.keys() 54 | shell_options = ['--' + shell for shell in sorted(shells)] 55 | if options.shell in shells: 56 | script = COMPLETION_SCRIPTS.get(options.shell, '') 57 | print(BASE_COMPLETION % {'script': script, 'shell': options.shell}) 58 | else: 59 | sys.stderr.write('ERROR: You must pass %s\n' % ' or '.join(shell_options)) 60 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/freeze.py: -------------------------------------------------------------------------------- 1 | import re 2 | import sys 3 | import pkg_resources 4 | import pip 5 | from pip.req import InstallRequirement 6 | from pip.log import logger 7 | from pip.basecommand import Command 8 | from pip.util import get_installed_distributions 9 | 10 | 11 | class FreezeCommand(Command): 12 | """Output installed packages in requirements format.""" 13 | name = 'freeze' 14 | usage = """ 15 | %prog [options]""" 16 | summary = 'Output installed packages in requirements format.' 17 | 18 | def __init__(self, *args, **kw): 19 | super(FreezeCommand, self).__init__(*args, **kw) 20 | 21 | self.cmd_opts.add_option( 22 | '-r', '--requirement', 23 | dest='requirement', 24 | action='store', 25 | default=None, 26 | metavar='file', 27 | help="Use the order in the given requirements file and it's comments when generating output.") 28 | self.cmd_opts.add_option( 29 | '-f', '--find-links', 30 | dest='find_links', 31 | action='append', 32 | default=[], 33 | metavar='URL', 34 | help='URL for finding packages, which will be added to the output.') 35 | self.cmd_opts.add_option( 36 | '-l', '--local', 37 | dest='local', 38 | action='store_true', 39 | default=False, 40 | help='If in a virtualenv that has global access, do not output globally-installed packages.') 41 | 42 | self.parser.insert_option_group(0, self.cmd_opts) 43 | 44 | def setup_logging(self): 45 | logger.move_stdout_to_stderr() 46 | 47 | def run(self, options, args): 48 | requirement = options.requirement 49 | find_links = options.find_links or [] 50 | local_only = options.local 51 | ## FIXME: Obviously this should be settable: 52 | find_tags = False 53 | skip_match = None 54 | 55 | skip_regex = options.skip_requirements_regex 56 | if skip_regex: 57 | skip_match = re.compile(skip_regex) 58 | 59 | dependency_links = [] 60 | 61 | f = sys.stdout 62 | 63 | for dist in pkg_resources.working_set: 64 | if dist.has_metadata('dependency_links.txt'): 65 | dependency_links.extend(dist.get_metadata_lines('dependency_links.txt')) 66 | for link in find_links: 67 | if '#egg=' in link: 68 | dependency_links.append(link) 69 | for link in find_links: 70 | f.write('-f %s\n' % link) 71 | installations = {} 72 | for dist in get_installed_distributions(local_only=local_only): 73 | req = pip.FrozenRequirement.from_dist(dist, dependency_links, find_tags=find_tags) 74 | installations[req.name] = req 75 | if requirement: 76 | req_f = open(requirement) 77 | for line in req_f: 78 | if not line.strip() or line.strip().startswith('#'): 79 | f.write(line) 80 | continue 81 | if skip_match and skip_match.search(line): 82 | f.write(line) 83 | continue 84 | elif line.startswith('-e') or line.startswith('--editable'): 85 | if line.startswith('-e'): 86 | line = line[2:].strip() 87 | else: 88 | line = line[len('--editable'):].strip().lstrip('=') 89 | line_req = InstallRequirement.from_editable(line, default_vcs=options.default_vcs) 90 | elif (line.startswith('-r') or line.startswith('--requirement') 91 | or line.startswith('-Z') or line.startswith('--always-unzip') 92 | or line.startswith('-f') or line.startswith('-i') 93 | or line.startswith('--extra-index-url') 94 | or line.startswith('--find-links') 95 | or line.startswith('--index-url')): 96 | f.write(line) 97 | continue 98 | else: 99 | line_req = InstallRequirement.from_line(line) 100 | if not line_req.name: 101 | logger.notify("Skipping line because it's not clear what it would install: %s" 102 | % line.strip()) 103 | logger.notify(" (add #egg=PackageName to the URL to avoid this warning)") 104 | continue 105 | if line_req.name not in installations: 106 | logger.warn("Requirement file contains %s, but that package is not installed" 107 | % line.strip()) 108 | continue 109 | f.write(str(installations[line_req.name])) 110 | del installations[line_req.name] 111 | f.write('## The following requirements were added by pip --freeze:\n') 112 | for installation in sorted(installations.values(), key=lambda x: x.name): 113 | f.write(str(installation)) 114 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/help.py: -------------------------------------------------------------------------------- 1 | from pip.basecommand import Command, SUCCESS 2 | from pip.exceptions import CommandError 3 | 4 | 5 | class HelpCommand(Command): 6 | """Show help for commands""" 7 | name = 'help' 8 | usage = """ 9 | %prog """ 10 | summary = 'Show help for commands.' 11 | 12 | def run(self, options, args): 13 | from pip.commands import commands, get_similar_commands 14 | 15 | try: 16 | # 'pip help' with no args is handled by pip.__init__.parseopt() 17 | cmd_name = args[0] # the command we need help for 18 | except IndexError: 19 | return SUCCESS 20 | 21 | if cmd_name not in commands: 22 | guess = get_similar_commands(cmd_name) 23 | 24 | msg = ['unknown command "%s"' % cmd_name] 25 | if guess: 26 | msg.append('maybe you meant "%s"' % guess) 27 | 28 | raise CommandError(' - '.join(msg)) 29 | 30 | command = commands[cmd_name](self.main_parser) # instantiate 31 | command.parser.print_help() 32 | 33 | return SUCCESS 34 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/search.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import textwrap 3 | import pkg_resources 4 | import pip.download 5 | from pip.basecommand import Command, SUCCESS 6 | from pip.util import get_terminal_size 7 | from pip.log import logger 8 | from pip.backwardcompat import xmlrpclib, reduce, cmp 9 | from pip.exceptions import CommandError 10 | from pip.status_codes import NO_MATCHES_FOUND 11 | from distutils.version import StrictVersion, LooseVersion 12 | 13 | 14 | class SearchCommand(Command): 15 | """Search for PyPI packages whose name or summary contains .""" 16 | name = 'search' 17 | usage = """ 18 | %prog [options] """ 19 | summary = 'Search PyPI for packages.' 20 | 21 | def __init__(self, *args, **kw): 22 | super(SearchCommand, self).__init__(*args, **kw) 23 | self.cmd_opts.add_option( 24 | '--index', 25 | dest='index', 26 | metavar='URL', 27 | default='https://pypi.python.org/pypi', 28 | help='Base URL of Python Package Index (default %default)') 29 | 30 | self.parser.insert_option_group(0, self.cmd_opts) 31 | 32 | def run(self, options, args): 33 | if not args: 34 | raise CommandError('Missing required argument (search query).') 35 | query = args 36 | index_url = options.index 37 | 38 | pypi_hits = self.search(query, index_url) 39 | hits = transform_hits(pypi_hits) 40 | 41 | terminal_width = None 42 | if sys.stdout.isatty(): 43 | terminal_width = get_terminal_size()[0] 44 | 45 | print_results(hits, terminal_width=terminal_width) 46 | if pypi_hits: 47 | return SUCCESS 48 | return NO_MATCHES_FOUND 49 | 50 | def search(self, query, index_url): 51 | pypi = xmlrpclib.ServerProxy(index_url, pip.download.xmlrpclib_transport) 52 | hits = pypi.search({'name': query, 'summary': query}, 'or') 53 | return hits 54 | 55 | 56 | def transform_hits(hits): 57 | """ 58 | The list from pypi is really a list of versions. We want a list of 59 | packages with the list of versions stored inline. This converts the 60 | list from pypi into one we can use. 61 | """ 62 | packages = {} 63 | for hit in hits: 64 | name = hit['name'] 65 | summary = hit['summary'] 66 | version = hit['version'] 67 | score = hit['_pypi_ordering'] 68 | if score is None: 69 | score = 0 70 | 71 | if name not in packages.keys(): 72 | packages[name] = {'name': name, 'summary': summary, 'versions': [version], 'score': score} 73 | else: 74 | packages[name]['versions'].append(version) 75 | 76 | # if this is the highest version, replace summary and score 77 | if version == highest_version(packages[name]['versions']): 78 | packages[name]['summary'] = summary 79 | packages[name]['score'] = score 80 | 81 | # each record has a unique name now, so we will convert the dict into a list sorted by score 82 | package_list = sorted(packages.values(), key=lambda x: x['score'], reverse=True) 83 | return package_list 84 | 85 | 86 | def print_results(hits, name_column_width=25, terminal_width=None): 87 | installed_packages = [p.project_name for p in pkg_resources.working_set] 88 | for hit in hits: 89 | name = hit['name'] 90 | summary = hit['summary'] or '' 91 | if terminal_width is not None: 92 | # wrap and indent summary to fit terminal 93 | summary = textwrap.wrap(summary, terminal_width - name_column_width - 5) 94 | summary = ('\n' + ' ' * (name_column_width + 3)).join(summary) 95 | line = '%s - %s' % (name.ljust(name_column_width), summary) 96 | try: 97 | logger.notify(line) 98 | if name in installed_packages: 99 | dist = pkg_resources.get_distribution(name) 100 | logger.indent += 2 101 | try: 102 | latest = highest_version(hit['versions']) 103 | if dist.version == latest: 104 | logger.notify('INSTALLED: %s (latest)' % dist.version) 105 | else: 106 | logger.notify('INSTALLED: %s' % dist.version) 107 | logger.notify('LATEST: %s' % latest) 108 | finally: 109 | logger.indent -= 2 110 | except UnicodeEncodeError: 111 | pass 112 | 113 | 114 | def compare_versions(version1, version2): 115 | try: 116 | return cmp(StrictVersion(version1), StrictVersion(version2)) 117 | # in case of abnormal version number, fall back to LooseVersion 118 | except ValueError: 119 | pass 120 | try: 121 | return cmp(LooseVersion(version1), LooseVersion(version2)) 122 | except TypeError: 123 | # certain LooseVersion comparions raise due to unorderable types, 124 | # fallback to string comparison 125 | return cmp([str(v) for v in LooseVersion(version1).version], 126 | [str(v) for v in LooseVersion(version2).version]) 127 | 128 | 129 | def highest_version(versions): 130 | return reduce((lambda v1, v2: compare_versions(v1, v2) == 1 and v1 or v2), versions) 131 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/show.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pkg_resources 3 | from pip.basecommand import Command 4 | from pip.log import logger 5 | 6 | 7 | class ShowCommand(Command): 8 | """Show information about one or more installed packages.""" 9 | name = 'show' 10 | usage = """ 11 | %prog [options] ...""" 12 | summary = 'Show information about installed packages.' 13 | 14 | def __init__(self, *args, **kw): 15 | super(ShowCommand, self).__init__(*args, **kw) 16 | self.cmd_opts.add_option( 17 | '-f', '--files', 18 | dest='files', 19 | action='store_true', 20 | default=False, 21 | help='Show the full list of installed files for each package.') 22 | 23 | self.parser.insert_option_group(0, self.cmd_opts) 24 | 25 | def run(self, options, args): 26 | if not args: 27 | logger.warn('ERROR: Please provide a package name or names.') 28 | return 29 | query = args 30 | 31 | results = search_packages_info(query) 32 | print_results(results, options.files) 33 | 34 | 35 | def search_packages_info(query): 36 | """ 37 | Gather details from installed distributions. Print distribution name, 38 | version, location, and installed files. Installed files requires a 39 | pip generated 'installed-files.txt' in the distributions '.egg-info' 40 | directory. 41 | """ 42 | installed_packages = dict( 43 | [(p.project_name.lower(), p) for p in pkg_resources.working_set]) 44 | for name in query: 45 | normalized_name = name.lower() 46 | if normalized_name in installed_packages: 47 | dist = installed_packages[normalized_name] 48 | package = { 49 | 'name': dist.project_name, 50 | 'version': dist.version, 51 | 'location': dist.location, 52 | 'requires': [dep.project_name for dep in dist.requires()], 53 | } 54 | filelist = os.path.join( 55 | dist.location, 56 | dist.egg_name() + '.egg-info', 57 | 'installed-files.txt') 58 | if os.path.isfile(filelist): 59 | package['files'] = filelist 60 | yield package 61 | 62 | 63 | def print_results(distributions, list_all_files): 64 | """ 65 | Print the informations from installed distributions found. 66 | """ 67 | for dist in distributions: 68 | logger.notify("---") 69 | logger.notify("Name: %s" % dist['name']) 70 | logger.notify("Version: %s" % dist['version']) 71 | logger.notify("Location: %s" % dist['location']) 72 | logger.notify("Requires: %s" % ', '.join(dist['requires'])) 73 | if list_all_files: 74 | logger.notify("Files:") 75 | if 'files' in dist: 76 | for line in open(dist['files']): 77 | logger.notify(" %s" % line.strip()) 78 | else: 79 | logger.notify("Cannot locate installed-files.txt") 80 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/uninstall.py: -------------------------------------------------------------------------------- 1 | from pip.req import InstallRequirement, RequirementSet, parse_requirements 2 | from pip.basecommand import Command 3 | from pip.exceptions import InstallationError 4 | 5 | 6 | class UninstallCommand(Command): 7 | """ 8 | Uninstall packages. 9 | 10 | pip is able to uninstall most installed packages. Known exceptions are: 11 | 12 | - Pure distutils packages installed with ``python setup.py install``, which 13 | leave behind no metadata to determine what files were installed. 14 | - Script wrappers installed by ``python setup.py develop``. 15 | """ 16 | name = 'uninstall' 17 | usage = """ 18 | %prog [options] ... 19 | %prog [options] -r ...""" 20 | summary = 'Uninstall packages.' 21 | 22 | def __init__(self, *args, **kw): 23 | super(UninstallCommand, self).__init__(*args, **kw) 24 | self.cmd_opts.add_option( 25 | '-r', '--requirement', 26 | dest='requirements', 27 | action='append', 28 | default=[], 29 | metavar='file', 30 | help='Uninstall all the packages listed in the given requirements file. ' 31 | 'This option can be used multiple times.') 32 | self.cmd_opts.add_option( 33 | '-y', '--yes', 34 | dest='yes', 35 | action='store_true', 36 | help="Don't ask for confirmation of uninstall deletions.") 37 | 38 | self.parser.insert_option_group(0, self.cmd_opts) 39 | 40 | def run(self, options, args): 41 | requirement_set = RequirementSet( 42 | build_dir=None, 43 | src_dir=None, 44 | download_dir=None) 45 | for name in args: 46 | requirement_set.add_requirement( 47 | InstallRequirement.from_line(name)) 48 | for filename in options.requirements: 49 | for req in parse_requirements(filename, options=options): 50 | requirement_set.add_requirement(req) 51 | if not requirement_set.has_requirements: 52 | raise InstallationError('You must give at least one requirement ' 53 | 'to %(name)s (see "pip help %(name)s")' % dict(name=self.name)) 54 | requirement_set.uninstall(auto_confirm=options.yes) 55 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/commands/unzip.py: -------------------------------------------------------------------------------- 1 | from pip.commands.zip import ZipCommand 2 | 3 | 4 | class UnzipCommand(ZipCommand): 5 | """Unzip individual packages.""" 6 | name = 'unzip' 7 | summary = 'Unzip individual packages.' 8 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/exceptions.py: -------------------------------------------------------------------------------- 1 | """Exceptions used throughout package""" 2 | 3 | import textwrap 4 | 5 | class PipError(Exception): 6 | """Base pip exception""" 7 | 8 | 9 | class InstallationError(PipError): 10 | """General exception during installation""" 11 | 12 | 13 | class UninstallationError(PipError): 14 | """General exception during uninstallation""" 15 | 16 | 17 | class DistributionNotFound(InstallationError): 18 | """Raised when a distribution cannot be found to satisfy a requirement""" 19 | 20 | 21 | class BestVersionAlreadyInstalled(PipError): 22 | """Raised when the most up-to-date version of a package is already 23 | installed. """ 24 | 25 | 26 | class BadCommand(PipError): 27 | """Raised when virtualenv or a command is not found""" 28 | 29 | 30 | class CommandError(PipError): 31 | """Raised when there is an error in command-line arguments""" 32 | 33 | 34 | class NoSSLError(PipError): 35 | """Raised when there's no ssl and not using '--insecure'""" 36 | 37 | def __str__(self): 38 | return textwrap.dedent(""" 39 | ################################################################### 40 | ## You don't have an importable ssl module. You are most ## 41 | ## likely using Python 2.5, which did not include ssl ## 42 | ## support by default. In this state, we can not provide ## 43 | ## ssl certified downloads from PyPI. ## 44 | ## ## 45 | ## You can do one of 2 things: ## 46 | ## 1) Install this: https://pypi.python.org/pypi/ssl/ ## 47 | ## (It provides ssl support for older Pythons ) ## 48 | ## 2) Use the --insecure option to allow this insecurity ## 49 | ## ## 50 | ## For more details, go to the "SSL Certificate Verification" ## 51 | ## section located here: ## 52 | ## http://www.pip-installer.org/en/latest/logic.html ## 53 | ## ## 54 | ################################################################### 55 | """) 56 | 57 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/locations.py: -------------------------------------------------------------------------------- 1 | """Locations where we look for configs, install stuff, etc""" 2 | 3 | import sys 4 | import site 5 | import os 6 | import tempfile 7 | import getpass 8 | from pip.backwardcompat import get_python_lib 9 | import pip.exceptions 10 | 11 | default_cert_path = os.path.join(os.path.dirname(__file__), 'cacert.pem') 12 | 13 | def running_under_virtualenv(): 14 | """ 15 | Return True if we're running inside a virtualenv, False otherwise. 16 | 17 | """ 18 | return hasattr(sys, 'real_prefix') 19 | 20 | 21 | def virtualenv_no_global(): 22 | """ 23 | Return True if in a venv and no system site packages. 24 | """ 25 | #this mirrors the logic in virtualenv.py for locating the no-global-site-packages.txt file 26 | site_mod_dir = os.path.dirname(os.path.abspath(site.__file__)) 27 | no_global_file = os.path.join(site_mod_dir, 'no-global-site-packages.txt') 28 | if running_under_virtualenv() and os.path.isfile(no_global_file): 29 | return True 30 | 31 | def _get_build_prefix(): 32 | """ Returns a safe build_prefix """ 33 | path = os.path.join(tempfile.gettempdir(), 'pip-build-%s' % \ 34 | getpass.getuser()) 35 | if sys.platform == 'win32': 36 | """ on windows(tested on 7) temp dirs are isolated """ 37 | return path 38 | try: 39 | os.mkdir(path) 40 | except OSError: 41 | file_uid = None 42 | try: 43 | fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW) 44 | file_uid = os.fstat(fd).st_uid 45 | os.close(fd) 46 | except OSError: 47 | file_uid = None 48 | if file_uid != os.getuid(): 49 | msg = "The temporary folder for building (%s) is not owned by your user!" \ 50 | % path 51 | print (msg) 52 | print("pip will not work until the temporary folder is " + \ 53 | "either deleted or owned by your user account.") 54 | raise pip.exceptions.InstallationError(msg) 55 | return path 56 | 57 | if running_under_virtualenv(): 58 | build_prefix = os.path.join(sys.prefix, 'build') 59 | src_prefix = os.path.join(sys.prefix, 'src') 60 | else: 61 | # Use tempfile to create a temporary folder for build 62 | # Note: we are NOT using mkdtemp so we can have a consistent build dir 63 | # Note: using realpath due to tmp dirs on OSX being symlinks 64 | build_prefix = _get_build_prefix() 65 | 66 | ## FIXME: keep src in cwd for now (it is not a temporary folder) 67 | try: 68 | src_prefix = os.path.join(os.getcwd(), 'src') 69 | except OSError: 70 | # In case the current working directory has been renamed or deleted 71 | sys.exit("The folder you are executing pip from can no longer be found.") 72 | 73 | # under Mac OS X + virtualenv sys.prefix is not properly resolved 74 | # it is something like /path/to/python/bin/.. 75 | build_prefix = os.path.abspath(os.path.realpath(build_prefix)) 76 | src_prefix = os.path.abspath(src_prefix) 77 | 78 | # FIXME doesn't account for venv linked to global site-packages 79 | 80 | site_packages = get_python_lib() 81 | user_dir = os.path.expanduser('~') 82 | if sys.platform == 'win32': 83 | bin_py = os.path.join(sys.prefix, 'Scripts') 84 | # buildout uses 'bin' on Windows too? 85 | if not os.path.exists(bin_py): 86 | bin_py = os.path.join(sys.prefix, 'bin') 87 | default_storage_dir = os.path.join(user_dir, 'pip') 88 | default_config_file = os.path.join(default_storage_dir, 'pip.ini') 89 | default_log_file = os.path.join(default_storage_dir, 'pip.log') 90 | else: 91 | bin_py = os.path.join(sys.prefix, 'bin') 92 | default_storage_dir = os.path.join(user_dir, '.pip') 93 | default_config_file = os.path.join(default_storage_dir, 'pip.conf') 94 | default_log_file = os.path.join(default_storage_dir, 'pip.log') 95 | 96 | # Forcing to use /usr/local/bin for standard Mac OS X framework installs 97 | # Also log to ~/Library/Logs/ for use with the Console.app log viewer 98 | if sys.platform[:6] == 'darwin' and sys.prefix[:16] == '/System/Library/': 99 | bin_py = '/usr/local/bin' 100 | default_log_file = os.path.join(user_dir, 'Library/Logs/pip.log') 101 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/runner.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | 5 | def run(): 6 | base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 7 | ## FIXME: this is kind of crude; if we could create a fake pip 8 | ## module, then exec into it and update pip.__path__ properly, we 9 | ## wouldn't have to update sys.path: 10 | sys.path.insert(0, base) 11 | import pip 12 | return pip.main() 13 | 14 | 15 | if __name__ == '__main__': 16 | exit = run() 17 | if exit: 18 | sys.exit(exit) 19 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/pip/status_codes.py: -------------------------------------------------------------------------------- 1 | SUCCESS = 0 2 | ERROR = 1 3 | UNKNOWN_ERROR = 2 4 | VIRTUALENV_NOT_FOUND = 3 5 | NO_MATCHES_FOUND = 23 6 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/setup.cfg: -------------------------------------------------------------------------------- 1 | [nosetests] 2 | where = tests 3 | 4 | [aliases] 5 | dev = develop easy_install pip[testing] 6 | 7 | [egg_info] 8 | tag_build = 9 | tag_date = 0 10 | tag_svn_revision = 0 11 | 12 | -------------------------------------------------------------------------------- /vendor/pip-1.3.1/setup.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | import os 3 | import re 4 | import sys 5 | import textwrap 6 | from setuptools import setup 7 | 8 | here = os.path.abspath(os.path.dirname(__file__)) 9 | 10 | def read(*parts): 11 | # intentionally *not* adding an encoding option to open 12 | # see here: https://github.com/pypa/virtualenv/issues/201#issuecomment-3145690 13 | return codecs.open(os.path.join(here, *parts), 'r').read() 14 | 15 | def find_version(*file_paths): 16 | version_file = read(*file_paths) 17 | version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", 18 | version_file, re.M) 19 | if version_match: 20 | return version_match.group(1) 21 | raise RuntimeError("Unable to find version string.") 22 | 23 | long_description = "\n" + "\n".join([ 24 | read('PROJECT.txt'), 25 | read('docs', 'quickstart.txt'), 26 | read('CHANGES.txt')]) 27 | 28 | tests_require = ['nose', 'virtualenv>=1.7', 'scripttest>=1.1.1', 'mock'] 29 | 30 | setup(name="pip", 31 | version=find_version('pip', '__init__.py'), 32 | description="A tool for installing and managing Python packages.", 33 | long_description=long_description, 34 | classifiers=[ 35 | 'Development Status :: 5 - Production/Stable', 36 | 'Intended Audience :: Developers', 37 | 'License :: OSI Approved :: MIT License', 38 | 'Topic :: Software Development :: Build Tools', 39 | 'Programming Language :: Python :: 2', 40 | 'Programming Language :: Python :: 2.5', 41 | 'Programming Language :: Python :: 2.6', 42 | 'Programming Language :: Python :: 2.7', 43 | 'Programming Language :: Python :: 3', 44 | 'Programming Language :: Python :: 3.1', 45 | 'Programming Language :: Python :: 3.2', 46 | ], 47 | keywords='easy_install distutils setuptools egg virtualenv', 48 | author='The pip developers', 49 | author_email='python-virtualenv@groups.google.com', 50 | url='http://www.pip-installer.org', 51 | license='MIT', 52 | packages=['pip', 'pip.commands', 'pip.vcs', 'pip.backwardcompat'], 53 | package_data={'pip': ['*.pem']}, 54 | entry_points=dict(console_scripts=['pip=pip:main', 'pip-%s=pip:main' % sys.version[:3]]), 55 | test_suite='nose.collector', 56 | tests_require=tests_require, 57 | zip_safe=False, 58 | extras_require = { 59 | 'testing':tests_require, 60 | }, 61 | ) 62 | -------------------------------------------------------------------------------- /vendor/test-utils: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # taken from 4 | # https://github.com/ryanbrainard/heroku-buildpack-testrunner/blob/master/lib/test_utils.sh 5 | 6 | oneTimeSetUp() 7 | { 8 | TEST_SUITE_CACHE="$(mktemp -d ${SHUNIT_TMPDIR}/test_suite_cache.XXXX)" 9 | } 10 | 11 | oneTimeTearDown() 12 | { 13 | rm -rf ${TEST_SUITE_CACHE} 14 | } 15 | 16 | setUp() 17 | { 18 | OUTPUT_DIR="$(mktemp -d ${SHUNIT_TMPDIR}/output.XXXX)" 19 | STD_OUT="${OUTPUT_DIR}/stdout" 20 | STD_ERR="${OUTPUT_DIR}/stderr" 21 | BUILD_DIR="${OUTPUT_DIR}/build" 22 | CACHE_DIR="${OUTPUT_DIR}/cache" 23 | mkdir -p ${OUTPUT_DIR} 24 | mkdir -p ${BUILD_DIR} 25 | mkdir -p ${CACHE_DIR} 26 | } 27 | 28 | tearDown() 29 | { 30 | rm -rf ${OUTPUT_DIR} 31 | } 32 | 33 | capture() 34 | { 35 | resetCapture 36 | 37 | LAST_COMMAND="$@" 38 | 39 | $@ >${STD_OUT} 2>${STD_ERR} 40 | RETURN=$? 41 | rtrn=${RETURN} # deprecated 42 | } 43 | 44 | resetCapture() 45 | { 46 | if [ -f ${STD_OUT} ]; then 47 | rm ${STD_OUT} 48 | fi 49 | 50 | if [ -f ${STD_ERR} ]; then 51 | rm ${STD_ERR} 52 | fi 53 | 54 | unset LAST_COMMAND 55 | unset RETURN 56 | unset rtrn # deprecated 57 | } 58 | 59 | detect() 60 | { 61 | capture ${BUILDPACK_HOME}/bin/detect ${BUILD_DIR} 62 | } 63 | 64 | compile() 65 | { 66 | capture ${BUILDPACK_HOME}/bin/compile ${BUILD_DIR} ${CACHE_DIR} 67 | } 68 | 69 | release() 70 | { 71 | capture ${BUILDPACK_HOME}/bin/release ${BUILD_DIR} 72 | } 73 | 74 | assertCapturedEquals() 75 | { 76 | assertEquals "$@" "$(cat ${STD_OUT})" 77 | } 78 | 79 | assertCapturedNotEquals() 80 | { 81 | assertNotEquals "$@" "$(cat ${STD_OUT})" 82 | } 83 | 84 | assertCaptured() 85 | { 86 | assertFileContains "$@" "${STD_OUT}" 87 | } 88 | 89 | assertNotCaptured() 90 | { 91 | assertFileNotContains "$@" "${STD_OUT}" 92 | } 93 | 94 | assertCapturedSuccess() 95 | { 96 | assertEquals "Expected captured exit code to be 0; was <${RETURN}>" "0" "${RETURN}" 97 | assertEquals "Expected STD_ERR to be empty; was <$(cat ${STD_ERR})>" "" "$(cat ${STD_ERR})" 98 | } 99 | 100 | # assertCapturedError [[expectedErrorCode] expectedErrorMsg] 101 | assertCapturedError() 102 | { 103 | if [ $# -gt 1 ]; then 104 | expectedErrorCode=${1} 105 | shift 106 | fi 107 | 108 | expectedErrorMsg=${1:-""} 109 | 110 | if [ -z ${expectedErrorCode} ]; then 111 | assertTrue "Expected captured exit code to be greater than 0; was <${RETURN}>" "[ ${RETURN} -gt 0 ]" 112 | else 113 | assertTrue "Expected captured exit code to be <${expectedErrorCode}>; was <${RETURN}>" "[ ${RETURN} -eq ${expectedErrorCode} ]" 114 | fi 115 | 116 | assertFileContains "Expected STD_OUT to contain error <${expectedErrorMsg}>" "${expectedErrorMsg}" "${STD_OUT}" 117 | assertEquals "STD_ERR should always be empty" "" "$(cat ${STD_ERR})" 118 | } 119 | 120 | assertAppDetected() 121 | { 122 | expectedAppType=${1?"Must provide app type"} 123 | 124 | assertCapturedSuccess 125 | assertEquals "${expectedAppType}" "$(cat ${STD_OUT})" 126 | } 127 | 128 | assertNoAppDetected() 129 | { 130 | assertEquals "1" "${RETURN}" 131 | assertEquals "no" "$(cat ${STD_OUT})" 132 | assertEquals "" "$(cat ${STD_ERR})" 133 | } 134 | 135 | _assertContains() 136 | { 137 | if [ 5 -eq $# ]; then 138 | msg=$1 139 | shift 140 | elif [ ! 4 -eq $# ]; then 141 | fail "Expected 4 or 5 parameters; Receieved $# parameters" 142 | fi 143 | 144 | needle=$1 145 | haystack=$2 146 | expectation=$3 147 | haystack_type=$4 148 | 149 | case "${haystack_type}" in 150 | "file") grep -q -F -e "${needle}" ${haystack} ;; 151 | "text") echo "${haystack}" | grep -q -F -e "${needle}" ;; 152 | esac 153 | 154 | if [ "${expectation}" != "$?" ]; then 155 | case "${expectation}" in 156 | 0) default_msg="Expected <${haystack}> to contain <${needle}>" ;; 157 | 1) default_msg="Did not expect <${haystack}> to contain <${needle}>" ;; 158 | esac 159 | 160 | fail "${msg:-${default_msg}}" 161 | fi 162 | } 163 | 164 | assertContains() 165 | { 166 | _assertContains "$@" 0 "text" 167 | } 168 | 169 | assertNotContains() 170 | { 171 | _assertContains "$@" 1 "text" 172 | } 173 | 174 | assertFileContains() 175 | { 176 | _assertContains "$@" 0 "file" 177 | } 178 | 179 | assertFileNotContains() 180 | { 181 | _assertContains "$@" 1 "file" 182 | } 183 | 184 | command_exists () { 185 | type "$1" > /dev/null 2>&1 ; 186 | } 187 | 188 | assertFileMD5() 189 | { 190 | expectedHash=$1 191 | filename=$2 192 | 193 | if command_exists "md5sum"; then 194 | md5_cmd="md5sum ${filename}" 195 | expected_md5_cmd_output="${expectedHash} ${filename}" 196 | elif command_exists "md5"; then 197 | md5_cmd="md5 ${filename}" 198 | expected_md5_cmd_output="MD5 (${filename}) = ${expectedHash}" 199 | else 200 | fail "no suitable MD5 hashing command found on this system" 201 | fi 202 | 203 | assertEquals "${expected_md5_cmd_output}" "`${md5_cmd}`" 204 | } 205 | --------------------------------------------------------------------------------