├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── Readme.md ├── bin ├── compile ├── detect ├── release ├── steps │ ├── collectstatic │ ├── cryptography │ ├── gdal │ ├── geo-libs │ ├── hooks │ │ ├── post_compile │ │ └── pre_compile │ ├── mercurial │ ├── nltk-corpora │ ├── pip-install │ ├── pip-uninstall │ ├── pylibmc │ ├── python │ └── setuptools ├── test ├── utils └── warnings ├── builds ├── README.md ├── libraries │ ├── autoconf │ ├── sqlite │ └── vendor │ │ ├── gdal │ │ ├── geos │ │ ├── libffi │ │ ├── libmemcache │ │ └── proj └── runtimes │ ├── pypy-1.7 │ ├── pypy-1.8 │ ├── pypy-1.9 │ ├── pypy-2.0 │ ├── pypy-2.0.1 │ ├── pypy-2.0.2 │ ├── pypy-2.1 │ ├── pypy-2.2 │ ├── pypy-2.2.1 │ ├── pypy-2.3 │ ├── pypy-2.3.1 │ ├── pypy-2.4.0 │ ├── pypy-2.5.0 │ ├── pypy-2.5.1 │ ├── pypy-2.6.0 │ ├── pypy-2.6.1 │ ├── pypy-4.0.0 │ ├── pypy-4.0.1 │ ├── pypy-5.0.0 │ ├── pypy-5.0.1 │ ├── pypy3-2.3.1 │ ├── pypy3-2.4.0 │ ├── python-2.4.4 │ ├── python-2.4.5 │ ├── python-2.4.6 │ ├── python-2.5.0 │ ├── python-2.5.1 │ ├── python-2.5.2 │ ├── python-2.5.3 │ ├── python-2.5.4 │ ├── python-2.5.5 │ ├── python-2.5.6 │ ├── python-2.6.0 │ ├── python-2.6.1 │ ├── python-2.6.2 │ ├── python-2.6.3 │ ├── python-2.6.4 │ ├── python-2.6.5 │ ├── python-2.6.6 │ ├── python-2.6.7 │ ├── python-2.6.8 │ ├── python-2.6.9 │ ├── python-2.7.0 │ ├── python-2.7.1 │ ├── python-2.7.10 │ ├── python-2.7.11 │ ├── python-2.7.11rc1 │ ├── python-2.7.2 │ ├── python-2.7.3 │ ├── python-2.7.4 │ ├── python-2.7.5 │ ├── python-2.7.6 │ ├── python-2.7.7 │ ├── python-2.7.7-shared │ ├── python-2.7.8 │ ├── python-2.7.8-shared │ ├── python-2.7.9 │ ├── python-3.1.0 │ ├── python-3.1.1 │ ├── python-3.1.2 │ ├── python-3.1.3 │ ├── python-3.1.4 │ ├── python-3.1.5 │ ├── python-3.2.0 │ ├── python-3.2.1 │ ├── python-3.2.2 │ ├── python-3.2.3 │ ├── python-3.2.4 │ ├── python-3.2.5 │ ├── python-3.3.0 │ ├── python-3.3.1 │ ├── python-3.3.2 │ ├── python-3.3.3 │ ├── python-3.3.4 │ ├── python-3.3.5 │ ├── python-3.3.6 │ ├── python-3.4.0 │ ├── python-3.4.1 │ ├── python-3.4.2 │ ├── python-3.4.3 │ ├── python-3.5.0 │ └── python-3.5.1 ├── requirements.txt └── vendor ├── bpwatch ├── bpwatch └── bpwatch.zip ├── pip-8.1.1.tar.gz ├── pip-pop ├── docopt.py ├── pip-diff ├── pip-grep └── pip │ ├── __init__.py │ ├── __main__.py │ ├── _vendor │ ├── README.rst │ ├── __init__.py │ ├── _markerlib │ │ ├── __init__.py │ │ └── markers.py │ ├── cachecontrol │ │ ├── __init__.py │ │ ├── adapter.py │ │ ├── cache.py │ │ ├── caches │ │ │ ├── __init__.py │ │ │ ├── file_cache.py │ │ │ └── redis_cache.py │ │ ├── compat.py │ │ ├── controller.py │ │ ├── filewrapper.py │ │ ├── heuristics.py │ │ ├── serialize.py │ │ └── wrapper.py │ ├── colorama │ │ ├── __init__.py │ │ ├── ansi.py │ │ ├── ansitowin32.py │ │ ├── initialise.py │ │ ├── win32.py │ │ └── winterm.py │ ├── distlib │ │ ├── __init__.py │ │ ├── _backport │ │ │ ├── __init__.py │ │ │ ├── misc.py │ │ │ ├── shutil.py │ │ │ ├── sysconfig.cfg │ │ │ ├── sysconfig.py │ │ │ └── tarfile.py │ │ ├── compat.py │ │ ├── database.py │ │ ├── index.py │ │ ├── locators.py │ │ ├── manifest.py │ │ ├── markers.py │ │ ├── metadata.py │ │ ├── resources.py │ │ ├── scripts.py │ │ ├── t32.exe │ │ ├── t64.exe │ │ ├── util.py │ │ ├── version.py │ │ ├── w32.exe │ │ ├── w64.exe │ │ └── wheel.py │ ├── html5lib │ │ ├── __init__.py │ │ ├── constants.py │ │ ├── filters │ │ │ ├── __init__.py │ │ │ ├── _base.py │ │ │ ├── alphabeticalattributes.py │ │ │ ├── inject_meta_charset.py │ │ │ ├── lint.py │ │ │ ├── optionaltags.py │ │ │ ├── sanitizer.py │ │ │ └── whitespace.py │ │ ├── html5parser.py │ │ ├── ihatexml.py │ │ ├── inputstream.py │ │ ├── sanitizer.py │ │ ├── serializer │ │ │ ├── __init__.py │ │ │ └── htmlserializer.py │ │ ├── tokenizer.py │ │ ├── treeadapters │ │ │ ├── __init__.py │ │ │ └── sax.py │ │ ├── treebuilders │ │ │ ├── __init__.py │ │ │ ├── _base.py │ │ │ ├── dom.py │ │ │ ├── etree.py │ │ │ └── etree_lxml.py │ │ ├── treewalkers │ │ │ ├── __init__.py │ │ │ ├── _base.py │ │ │ ├── dom.py │ │ │ ├── etree.py │ │ │ ├── genshistream.py │ │ │ ├── lxmletree.py │ │ │ └── pulldom.py │ │ ├── trie │ │ │ ├── __init__.py │ │ │ ├── _base.py │ │ │ ├── datrie.py │ │ │ └── py.py │ │ └── utils.py │ ├── ipaddress.py │ ├── lockfile │ │ ├── __init__.py │ │ ├── linklockfile.py │ │ ├── mkdirlockfile.py │ │ ├── pidlockfile.py │ │ ├── sqlitelockfile.py │ │ └── symlinklockfile.py │ ├── packaging │ │ ├── __about__.py │ │ ├── __init__.py │ │ ├── _compat.py │ │ ├── _structures.py │ │ ├── specifiers.py │ │ └── version.py │ ├── pkg_resources │ │ └── __init__.py │ ├── progress │ │ ├── __init__.py │ │ ├── bar.py │ │ ├── counter.py │ │ ├── helpers.py │ │ └── spinner.py │ ├── re-vendor.py │ ├── requests │ │ ├── __init__.py │ │ ├── adapters.py │ │ ├── api.py │ │ ├── auth.py │ │ ├── cacert.pem │ │ ├── certs.py │ │ ├── compat.py │ │ ├── cookies.py │ │ ├── exceptions.py │ │ ├── hooks.py │ │ ├── models.py │ │ ├── packages │ │ │ ├── __init__.py │ │ │ ├── chardet │ │ │ │ ├── __init__.py │ │ │ │ ├── big5freq.py │ │ │ │ ├── big5prober.py │ │ │ │ ├── chardetect.py │ │ │ │ ├── chardistribution.py │ │ │ │ ├── charsetgroupprober.py │ │ │ │ ├── charsetprober.py │ │ │ │ ├── codingstatemachine.py │ │ │ │ ├── compat.py │ │ │ │ ├── constants.py │ │ │ │ ├── cp949prober.py │ │ │ │ ├── escprober.py │ │ │ │ ├── escsm.py │ │ │ │ ├── eucjpprober.py │ │ │ │ ├── euckrfreq.py │ │ │ │ ├── euckrprober.py │ │ │ │ ├── euctwfreq.py │ │ │ │ ├── euctwprober.py │ │ │ │ ├── gb2312freq.py │ │ │ │ ├── gb2312prober.py │ │ │ │ ├── hebrewprober.py │ │ │ │ ├── jisfreq.py │ │ │ │ ├── jpcntx.py │ │ │ │ ├── langbulgarianmodel.py │ │ │ │ ├── langcyrillicmodel.py │ │ │ │ ├── langgreekmodel.py │ │ │ │ ├── langhebrewmodel.py │ │ │ │ ├── langhungarianmodel.py │ │ │ │ ├── langthaimodel.py │ │ │ │ ├── latin1prober.py │ │ │ │ ├── mbcharsetprober.py │ │ │ │ ├── mbcsgroupprober.py │ │ │ │ ├── mbcssm.py │ │ │ │ ├── sbcharsetprober.py │ │ │ │ ├── sbcsgroupprober.py │ │ │ │ ├── sjisprober.py │ │ │ │ ├── universaldetector.py │ │ │ │ └── utf8prober.py │ │ │ └── urllib3 │ │ │ │ ├── __init__.py │ │ │ │ ├── _collections.py │ │ │ │ ├── connection.py │ │ │ │ ├── connectionpool.py │ │ │ │ ├── contrib │ │ │ │ ├── __init__.py │ │ │ │ ├── ntlmpool.py │ │ │ │ └── pyopenssl.py │ │ │ │ ├── exceptions.py │ │ │ │ ├── fields.py │ │ │ │ ├── filepost.py │ │ │ │ ├── packages │ │ │ │ ├── __init__.py │ │ │ │ ├── ordered_dict.py │ │ │ │ ├── six.py │ │ │ │ └── ssl_match_hostname │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── _implementation.py │ │ │ │ ├── poolmanager.py │ │ │ │ ├── request.py │ │ │ │ ├── response.py │ │ │ │ └── util │ │ │ │ ├── __init__.py │ │ │ │ ├── connection.py │ │ │ │ ├── request.py │ │ │ │ ├── response.py │ │ │ │ ├── retry.py │ │ │ │ ├── ssl_.py │ │ │ │ ├── timeout.py │ │ │ │ └── url.py │ │ ├── sessions.py │ │ ├── status_codes.py │ │ ├── structures.py │ │ └── utils.py │ ├── retrying.py │ ├── six.py │ └── vendor.txt │ ├── basecommand.py │ ├── baseparser.py │ ├── cmdoptions.py │ ├── commands │ ├── __init__.py │ ├── completion.py │ ├── freeze.py │ ├── help.py │ ├── install.py │ ├── list.py │ ├── search.py │ ├── show.py │ ├── uninstall.py │ └── wheel.py │ ├── compat │ ├── __init__.py │ └── dictconfig.py │ ├── download.py │ ├── exceptions.py │ ├── index.py │ ├── locations.py │ ├── models │ ├── __init__.py │ └── index.py │ ├── operations │ ├── __init__.py │ └── freeze.py │ ├── pep425tags.py │ ├── req │ ├── __init__.py │ ├── req_file.py │ ├── req_install.py │ ├── req_set.py │ └── req_uninstall.py │ ├── status_codes.py │ ├── utils │ ├── __init__.py │ ├── appdirs.py │ ├── build.py │ ├── deprecation.py │ ├── filesystem.py │ ├── logging.py │ ├── outdated.py │ └── ui.py │ ├── vcs │ ├── __init__.py │ ├── bazaar.py │ ├── git.py │ ├── mercurial.py │ └── subversion.py │ └── wheel.py ├── python.gunicorn.sh ├── setuptools-20.4.tar.gz ├── shunit2 └── test-utils /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | site 3 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Python Buildpack Changelog 2 | 3 | ## v80 (2016-04-05) 4 | 5 | Improved pip-pop compatibility with latest pip releases. 6 | 7 | ## v79 (2016-03-22) 8 | 9 | Compatibility improvements with heroku-apt-buildpack. 10 | 11 | ## v78 (2016-03-18) 12 | 13 | Added automatic configuration of Gunicorn's `FORWARDED_ALLOW_IPS` setting. 14 | 15 | Improved detection of libffi dependency when using bcrypt via `Django[bcrypt]`. 16 | 17 | Improved GDAL support. 18 | 19 | - GDAL dependency detection now checks for pygdal and is case-insensitive. 20 | - The vendored GDAL library has been updated to 1.11.1. 21 | - GDAL bootstrapping now also installs the GEOS and Proj.4 libraries. 22 | 23 | Updated pip to 8.1.1 and setuptools to 20.3. 24 | 25 | ## v77 (2016-02-10) 26 | 27 | Improvements to warnings and minor bugfix. 28 | 29 | ## v76 (2016-02-08) 30 | 31 | Improved Django collectstatic support. 32 | 33 | - `$ python manage.py collectstatic` will only be run if `Django` is present in `requirements.txt`. 34 | - If collectstatic fails, the build fails. Full traceback is provided. 35 | - `$DISABLE_COLLECTSTATIC`: skip collectstatic step completely (not new). 36 | - `$DEBUG_COLLECTSTATIC`: echo environment variables upon collectstatic failure. 37 | - Updated build output style. 38 | - New warning for outdated Python (via pip `InsecurePlatform` warning). 39 | 40 | ## v75 (2016-01-29) 41 | 42 | Updated pip and Setuptools. 43 | 44 | ## v74 (2015-12-29) 45 | 46 | Added warnings for lack of Procfile. 47 | 48 | ## v72 (2015-12-07) 49 | 50 | Updated default Python to 2.7.11. 51 | 52 | ## v72 (2015-12-03) 53 | 54 | Added friendly warnings for common build failures. 55 | 56 | ## v70 (2015-10-29) 57 | 58 | Improved compatibility with multi and node.js buildpacks. 59 | 60 | ## v69 (2015-10-12) 61 | 62 | Revert to v66. 63 | 64 | ## v68 (2015-10-12) 65 | 66 | Fixed .heroku/venv error with modern apps. 67 | 68 | ## v67 (2015-10-12) 69 | 70 | Further improved cache compatibility with multi and node.js buildpacks. 71 | 72 | ## v66 (2015-10-09) 73 | 74 | Improved compatibility with multi and node.js buildpacks. 75 | 76 | ## v65 (2015-10-08) 77 | 78 | Reverted v64. 79 | 80 | ## v64 (2015-10-08) 81 | 82 | Improved compatibility with multi and node.js buildpacks. 83 | 84 | ## v63 (2015-10-08) 85 | 86 | Updated Pip and Setuptools. 87 | 88 | - Setuptools updated to v18.3.2 89 | - Pip updated to v7.1.2 90 | 91 | 92 | ## v62 (2015-08-07) 93 | 94 | Updated Pip and Setuptools. 95 | 96 | - Setuptools updated to v18.1 97 | - Pip updated to v7.1.0 98 | 99 | ## v61 (2015-06-30) 100 | 101 | Updated Pip and Setuptools. 102 | 103 | - Setuptools updated to v18.0.1 104 | - Pip updated to v7.0.3 105 | 106 | ## v60 (2015-05-27) 107 | 108 | Default Python is now latest 2.7.10. Updated Pip and Distribute. 109 | 110 | - Default Python version is v2.7.10 111 | - Setuptools updated to v16.0 112 | - Pip updated to v7.0.1 113 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License: 2 | 3 | Copyright (C) 2016 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 | # These targets are not files 2 | .PHONY: tests 3 | 4 | tests: 5 | ./bin/test 6 | 7 | tools: 8 | git clone https://github.com/kennethreitz/pip-pop.git 9 | mv pip-pop/bin/* vendor/pip-pop/ 10 | rm -fr pip-pop -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Heroku Buildpack: Python + NLTK 2 | ![python](https://cloud.githubusercontent.com/assets/51578/13712821/b68a42ce-e793-11e5-96b0-d8eb978137ba.png) 3 | 4 | This buildpack is identical to the official [python](https://github.com/heroku/heroku-buildpack-python), but also installs any NLTK corpora/packages desired. Desired packages should be defined in `.nltk_packages` in the root of the repo. Packages will only be downloaded if both this file exists and `nltk` is installed among your dependencies. 5 | 6 | The `.nltk_packages` file can contain either space-separated packages, or one package on each line. 7 | 8 | See it in Action 9 | ---------------- 10 | 11 | Deploying a Python application couldn't be easier: 12 | 13 | $ echo "punkt brown" > .nltk_packages 14 | $ ls -a 15 | .nltk_packages Procfile requirements.txt web.py 16 | 17 | $ heroku create --buildpack https://github.com/megacool/heroku-buildpack-python-nltk 18 | 19 | $ git push heroku master 20 | ... 21 | -----> Python app detected 22 | $ pip install -r requirements.txt 23 | -----> Downloading NLTK packages punkt brown 24 | [nltk_data] Downloading package punkt to /app/nltk_data... 25 | [nltk_data] Unzipping tokenizers/punkt.zip. 26 | [nltk_data] Downloading package brown to 27 | [nltk_data] /app/nltk_data... 28 | [nltk_data] Unzipping taggers/brown.zip. 29 | -----> Discovering process types 30 | Procfile declares types -> (none) 31 | 32 | A `requirements.txt` file must be present at the root of your application's repository. 33 | 34 | You can also specify the latest production release of this buildpack for upcoming builds of an existing application: 35 | 36 | $ heroku buildpacks:set https://github.com/megacool/heroku-buildpack-python-nltk 37 | 38 | 39 | Specify a Python Runtime 40 | ------------------------ 41 | 42 | Specific versions of the Python runtime can be specified with a `runtime.txt` file: 43 | 44 | $ cat runtime.txt 45 | python-3.5.1 46 | 47 | Runtime options include: 48 | 49 | - `python-2.7.11` 50 | - `python-3.5.1` 51 | - `pypy-5.0.1` (unsupported, experimental) 52 | 53 | Other [unsupported runtimes](https://github.com/heroku/heroku-buildpack-python/tree/master/builds/runtimes) are available as well. Use at your own risk. 54 | -------------------------------------------------------------------------------- /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](https://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 <&1 | sed '/^Post-processed/d;/^Copying/d;/^$/d' | indent 34 | COLLECTSTATIC_STATUS="${PIPESTATUS[0]}" 35 | 36 | set -e 37 | 38 | # Display a warning if collectstatic failed. 39 | [ $COLLECTSTATIC_STATUS -ne 0 ] && { 40 | 41 | echo 42 | echo " ! Error while running '$ python $MANAGE_FILE collectstatic --noinput'." 43 | echo " See traceback above for details." 44 | echo 45 | echo " You may need to update application code to resolve this error." 46 | echo " Or, you can disable collectstatic for this application:" 47 | echo 48 | echo " $ heroku config:set DISABLE_COLLECTSTATIC=1" 49 | echo 50 | echo " https://devcenter.heroku.com/articles/django-assets" 51 | 52 | # Additionally, dump out the environment, if debug mode is on. 53 | if [ "$DEBUG_COLLECTSTATIC" ]; then 54 | echo 55 | echo "****** Collectstatic environment variables:" 56 | echo 57 | env | indent 58 | fi 59 | 60 | # Abort the build. 61 | exit 1 62 | } 63 | 64 | echo 65 | fi 66 | 67 | bpwatch stop collectstatic # metrics collection 68 | -------------------------------------------------------------------------------- /bin/steps/cryptography: -------------------------------------------------------------------------------- 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](https://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 libffi binary. 13 | VENDORED_LIBFFI="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libffi.tar.gz" 14 | 15 | PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" 16 | 17 | # Syntax sugar. 18 | source $BIN_DIR/utils 19 | 20 | bpwatch start libffi_install 21 | 22 | # If a package using cffi exists within requirements, use vendored libffi. 23 | if (pip-grep -s requirements.txt bcrypt cffi cryptography django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] &> /dev/null) then 24 | 25 | if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then 26 | export LIBFFI=$(pwd)/vendor 27 | else 28 | echo "-----> Noticed cffi. Bootstrapping libffi." 29 | mkdir -p .heroku/vendor 30 | # Download and extract libffi into target vendor directory. 31 | curl $VENDORED_LIBFFI -s | tar zxv -C .heroku/vendor &> /dev/null 32 | 33 | export LIBFFI=$(pwd)/vendor 34 | fi 35 | fi 36 | 37 | bpwatch stop libffi_install 38 | -------------------------------------------------------------------------------- /bin/steps/gdal: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as the GDAL build step of the 4 | # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) 5 | # compiler. 6 | # 7 | # A [buildpack](https://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 cryptography binary. 13 | VENDORED_GDAL="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/gdal.tar.gz" 14 | 15 | PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" 16 | 17 | # Syntax sugar. 18 | source $BIN_DIR/utils 19 | 20 | bpwatch start gdal_install 21 | 22 | # If GDAL exists within requirements, use vendored gdal. 23 | if (pip-grep -s requirements.txt GDAL gdal pygdal &> /dev/null) then 24 | 25 | if [ -f ".heroku/vendor/bin/gdalserver" ]; then 26 | export GDAL=$(pwd)/vendor 27 | else 28 | echo "-----> Noticed GDAL. Bootstrapping gdal." 29 | mkdir -p .heroku/vendor 30 | # Download and extract cryptography into target vendor directory. 31 | curl $VENDORED_GDAL -s | tar zxv -C .heroku/vendor &> /dev/null 32 | 33 | export GDAL=$(pwd)/vendor 34 | fi 35 | fi 36 | 37 | bpwatch stop gdal_install 38 | -------------------------------------------------------------------------------- /bin/steps/geo-libs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as the GDAL build step of the 4 | # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) 5 | # compiler. 6 | # 7 | # A [buildpack](https://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 cryptography binary. 13 | VENDORED_GDAL="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/gdal.tar.gz" 14 | VENDORED_GEOS="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/geos.tar.gz" 15 | VENDORED_PROJ="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/proj.tar.gz" 16 | 17 | PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH" 18 | 19 | # Syntax sugar. 20 | source $BIN_DIR/utils 21 | 22 | bpwatch start geo_libs_install 23 | 24 | # If GDAL exists within requirements, use vendored gdal. 25 | if [[ "$BUILD_WITH_GEO_LIBRARIES" ]]; then 26 | 27 | if [ -f ".heroku/vendor/bin/gdalserver" ]; then 28 | export GDAL=$(pwd)/vendor 29 | else 30 | echo "-----> Bootstrapping gdal, geos, proj." 31 | mkdir -p .heroku/vendor 32 | # Download and extract cryptography into target vendor directory. 33 | curl $VENDORED_GDAL -s | tar zxv -C .heroku/vendor &> /dev/null 34 | curl $VENDORED_GEOS -s | tar zxv -C .heroku/vendor &> /dev/null 35 | curl $VENDORED_PROJ -s | tar zxv -C .heroku/vendor &> /dev/null 36 | 37 | export GDAL=$(pwd)/vendor 38 | fi 39 | fi 40 | 41 | bpwatch stop geo_libs_install 42 | -------------------------------------------------------------------------------- /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 | sub-env 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 | sub-env bin/pre_compile 7 | fi -------------------------------------------------------------------------------- /bin/steps/mercurial: -------------------------------------------------------------------------------- 1 | # Install Mercurial if it appears to be required. 2 | if (grep -Fiq "hg+" requirements.txt) then 3 | bpwatch start mercurial_install 4 | /app/.heroku/python/bin/pip install mercurial | cleanup | indent 5 | bpwatch stop mercurial_install 6 | fi -------------------------------------------------------------------------------- /bin/steps/nltk-corpora: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as the NLTK corpora download build step of the 4 | # [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python) 5 | # compiler. The NLTK packages to download should be specified in .nltk_packages 6 | # in the root of the repo. If not present this buildpack is identical to 7 | # heroku/python 8 | # 9 | # A [buildpack](http://devcenter.heroku.com/articles/buildpacks) is an 10 | # adapter between a Python application and Heroku's runtime. 11 | # 12 | # This script is invoked by [`bin/compile`](/). 13 | 14 | NLTK_DATA_DIR="nltk_data" 15 | 16 | # Syntax sugar. 17 | source $BIN_DIR/utils 18 | 19 | cd .heroku 20 | 21 | # Check that nltk was installed by pip, otherwise obviously not needed 22 | python -m nltk.downloader -h >/dev/null 2>&1 23 | if [ $? -eq 0 ]; then 24 | nltk_packages_definition="$BUILD_DIR/.nltk_packages" 25 | if [ -f "$nltk_packages_definition" ]; then 26 | nltk_packages=$(tr "\n" " " < "$nltk_packages_definition") 27 | puts-step "Downloading NLTK packages $nltk_packages" 28 | python -m nltk.downloader $nltk_packages 29 | set-env NLTK_DATA "/app/.heroku/nltk_data" 30 | else 31 | puts-warn ".nltk_packages not found, not downloading anything" 32 | fi 33 | else 34 | puts-warn "nltk not apparently installed, not downloading packages" 35 | fi 36 | 37 | cd .. 38 | -------------------------------------------------------------------------------- /bin/steps/pip-install: -------------------------------------------------------------------------------- 1 | # Install dependencies with Pip. 2 | puts-cmd "pip install -r requirements.txt" 3 | 4 | [ ! "$FRESH_PYTHON" ] && bpwatch start pip_install 5 | [ "$FRESH_PYTHON" ] && bpwatch start pip_install_first 6 | 7 | set +e 8 | /app/.heroku/python/bin/pip install -r requirements.txt --exists-action=w --src=./.heroku/src --disable-pip-version-check --no-cache-dir 2>&1 | tee $WARNINGS_LOG | cleanup | indent 9 | PIP_STATUS="${PIPESTATUS[0]}" 10 | set -e 11 | 12 | show-warnings 13 | 14 | if [[ ! $PIP_STATUS -eq 0 ]]; then 15 | exit 1 16 | fi 17 | 18 | 19 | # Smart Requirements handling 20 | cp requirements.txt .heroku/python/requirements-declared.txt 21 | /app/.heroku/python/bin/pip freeze --disable-pip-version-check > .heroku/python/requirements-installed.txt 22 | 23 | [ ! "$FRESH_PYTHON" ] && bpwatch stop pip_install 24 | [ "$FRESH_PYTHON" ] && bpwatch stop pip_install_first 25 | 26 | echo 27 | -------------------------------------------------------------------------------- /bin/steps/pip-uninstall: -------------------------------------------------------------------------------- 1 | set +e 2 | # Install dependencies with Pip. 3 | bpwatch start pip_uninstall 4 | if [[ -f .heroku/python/requirements-declared.txt ]]; then 5 | 6 | cp .heroku/python/requirements-declared.txt requirements-declared.txt 7 | 8 | pip-diff --stale requirements-declared.txt requirements.txt --exclude setuptools pip wheel > .heroku/python/requirements-stale.txt 9 | 10 | rm -fr requirements-declared.txt 11 | 12 | if [[ -s .heroku/python/requirements-stale.txt ]]; then 13 | puts-step "Uninstalling stale dependencies" 14 | /app/.heroku/python/bin/pip uninstall -r .heroku/python/requirements-stale.txt -y --exists-action=w | cleanup | indent 15 | fi 16 | fi 17 | bpwatch stop pip_uninstall 18 | set -e -------------------------------------------------------------------------------- /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](https://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="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libmemcache.tar.gz" 14 | 15 | # Syntax sugar. 16 | source $BIN_DIR/utils 17 | 18 | 19 | bpwatch start pylibmc_install 20 | 21 | # If pylibmc exists within requirements, use vendored libmemcached. 22 | if (pip-grep -s requirements.txt pylibmc &> /dev/null) then 23 | 24 | if [ -d ".heroku/vendor/lib/sasl2" ]; then 25 | export LIBMEMCACHED=$(pwd)/vendor 26 | else 27 | echo "-----> Noticed pylibmc. Bootstrapping libmemcached." 28 | mkdir -p .heroku/vendor 29 | # Download and extract libmemcached into target vendor directory. 30 | curl $VENDORED_MEMCACHED -s | tar zxv -C .heroku/vendor &> /dev/null 31 | 32 | export LIBMEMCACHED=$(pwd)/vendor 33 | fi 34 | fi 35 | 36 | bpwatch stop pylibmc_install 37 | -------------------------------------------------------------------------------- /bin/steps/python: -------------------------------------------------------------------------------- 1 | set +e 2 | PYTHON_VERSION=$(cat runtime.txt) 3 | 4 | # Install Python. 5 | if [ -f .heroku/python-version ]; then 6 | if [ ! $(cat .heroku/python-version) = $PYTHON_VERSION ]; then 7 | bpwatch start uninstall_python 8 | puts-step "Found $(cat .heroku/python-version), removing" 9 | rm -fr .heroku/python 10 | bpwatch stop uninstall_python 11 | else 12 | SKIP_INSTALL=1 13 | fi 14 | fi 15 | 16 | if [ ! $STACK = $CACHED_PYTHON_STACK ]; then 17 | bpwatch start uninstall_python 18 | rm -fr .heroku/python .heroku/python-stack .heroku/vendor 19 | unset SKIP_INSTALL 20 | bpwatch stop uninstall_python 21 | fi 22 | 23 | 24 | if [ ! "$SKIP_INSTALL" ]; then 25 | bpwatch start install_python 26 | puts-step "Installing $PYTHON_VERSION" 27 | 28 | # Prepare destination directory. 29 | mkdir -p .heroku/python 30 | 31 | curl https://lang-python.s3.amazonaws.com/$STACK/runtimes/$PYTHON_VERSION.tar.gz -s | tar zxv -C .heroku/python &> /dev/null 32 | if [[ $? != 0 ]] ; then 33 | puts-warn "Requested runtime ($PYTHON_VERSION) is not available for this stack ($STACK)." 34 | puts-warn "Aborting. More info: https://devcenter.heroku.com/articles/python-support" 35 | exit 1 36 | fi 37 | 38 | bpwatch stop install_python 39 | 40 | # Record for future reference. 41 | echo $PYTHON_VERSION > .heroku/python-version 42 | echo $STACK > .heroku/python-stack 43 | FRESH_PYTHON=true 44 | 45 | hash -r 46 | fi 47 | 48 | # If Pip isn't up to date: 49 | if [ "$FRESH_PYTHON" ] || [[ ! $(pip --version) == *$PIP_VERSION* ]]; then 50 | WORKING_DIR=$(pwd) 51 | 52 | bpwatch start prepare_environment 53 | 54 | TMPTARDIR=$(mktemp -d) 55 | trap "rm -rf $TMPTARDIR" RETURN 56 | 57 | bpwatch start install_setuptools 58 | # Prepare it for the real world 59 | # puts-step "Installing Setuptools ($SETUPTOOLS_VERSION)" 60 | tar zxf $ROOT_DIR/vendor/setuptools-$SETUPTOOLS_VERSION.tar.gz -C $TMPTARDIR 61 | cd $TMPTARDIR/setuptools-$SETUPTOOLS_VERSION/ 62 | python setup.py install &> /dev/null 63 | cd $WORKING_DIR 64 | bpwatch stop install_setuptoools 65 | 66 | bpwatch start install_pip 67 | # puts-step "Installing Pip ($PIP_VERSION)" 68 | tar zxf $ROOT_DIR/vendor/pip-$PIP_VERSION.tar.gz -C $TMPTARDIR 69 | cd $TMPTARDIR/pip-$PIP_VERSION/ 70 | python setup.py install &> /dev/null 71 | cd $WORKING_DIR 72 | 73 | bpwatch stop install_pip 74 | bpwatch stop prepare_environment 75 | fi 76 | 77 | set -e 78 | hash -r 79 | -------------------------------------------------------------------------------- /bin/steps/setuptools: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Syntax sugar. 4 | source $BIN_DIR/utils 5 | 6 | if (pip-grep -s requirements.txt setuptools distribute &> /dev/null) then 7 | 8 | puts-warn 'The package setuptools/distribute is listed in requirements.txt.' 9 | puts-warn 'Please remove to ensure expected behavior. ' 10 | 11 | fi 12 | -------------------------------------------------------------------------------- /bin/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # 4 | # Create a Heroku app with the following buildpack: 5 | # https://github.com/ddollar/buildpack-test 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 | testDetectDjango16() { 24 | detect "django-1.6-skeleton" 25 | assertCapturedEquals "Python" 26 | assertCapturedSuccess 27 | } 28 | 29 | testDetectDjango15() { 30 | detect "django-1.5-skeleton" 31 | assertCapturedEquals "Python" 32 | assertCapturedSuccess 33 | } 34 | 35 | testDetectDjango14() { 36 | detect "django-1.4-skeleton" 37 | assertCapturedEquals "Python" 38 | assertCapturedSuccess 39 | } 40 | 41 | testDetectDjango13() { 42 | detect "django-1.3-skeleton" 43 | assertCapturedEquals "Python" 44 | assertCapturedSuccess 45 | } 46 | 47 | testDetectNotDjangoWithSettings() { 48 | detect "not-django" 49 | assertCapturedEquals "Python" 50 | assertCapturedSuccess 51 | } 52 | 53 | testDetectWithSetupPy() { 54 | detect "distutils" 55 | assertCapturedEquals "Python" 56 | assertCapturedSuccess 57 | } 58 | 59 | testDetectWithSetupRequires() { 60 | detect "no-requirements" 61 | assertCapturedEquals "Python" 62 | assertCapturedSuccess 63 | } 64 | 65 | testDetectNotPython() { 66 | detect "not-python" 67 | assertNotCaptured "Python" 68 | assertEquals "1" "${RETURN}" 69 | } 70 | 71 | testDetectSimpleRuntimePypy2() { 72 | detect "simple-runtime-pypy2" 73 | assertCapturedEquals "Python" 74 | assertCapturedSuccess 75 | } 76 | 77 | testDetectSimpleRuntimePython2() { 78 | detect "simple-runtime-python2" 79 | assertCapturedEquals "Python" 80 | assertCapturedSuccess 81 | } 82 | 83 | testDetectSimpleRuntimePython3() { 84 | detect "simple-runtime" # should probably be renamed simple-runtime-python3 85 | assertCapturedEquals "Python" 86 | assertCapturedSuccess 87 | } 88 | 89 | ## utils ######################################## 90 | 91 | pushd $(dirname 0) >/dev/null 92 | BASE=$(pwd) 93 | popd >/dev/null 94 | 95 | source ${BASE}/vendor/test-utils 96 | 97 | detect() { 98 | capture ${BASE}/bin/detect ${BASE}/test/$1 99 | } 100 | 101 | compile() { 102 | capture ${BASE}/bin/compile ${BASE}/test/$1 103 | } 104 | 105 | source ${BASE}/vendor/shunit2 106 | 107 | -------------------------------------------------------------------------------- /bin/utils: -------------------------------------------------------------------------------- 1 | shopt -s extglob 2 | 3 | if [ $(uname) == Darwin ]; then 4 | sed() { command sed -l "$@"; } 5 | else 6 | sed() { command sed -u "$@"; } 7 | fi 8 | 9 | # Syntax sugar. 10 | indent() { 11 | sed "s/^/ /" 12 | } 13 | 14 | # Clean up pip output 15 | cleanup() { 16 | sed -e 's/\.\.\.\+/.../g' | sed -e '/already satisfied/Id' | sed -e '/Overwriting/Id' | sed -e '/python executable/Id' | sed -e '/no previously-included files/Id' 17 | } 18 | 19 | # Buildpack Indented line. 20 | puts-line() { 21 | echo " $@" 22 | } 23 | 24 | # Buildpack Steps. 25 | puts-step() { 26 | echo "-----> $@" 27 | } 28 | 29 | # Buildpack Warnings. 30 | puts-warn() { 31 | echo " ! $@" 32 | } 33 | 34 | # Buildpack Commands. 35 | puts-cmd() { 36 | echo " $ $@" 37 | } 38 | 39 | # Usage: $ set-env key value 40 | set-env() { 41 | echo "export $1=$2" >> $PROFILE_PATH 42 | } 43 | 44 | # Usage: $ set-default-env key value 45 | set-default-env() { 46 | echo "export $1=\${$1:-$2}" >> $PROFILE_PATH 47 | } 48 | 49 | # Usage: $ un-set-env key 50 | un-set-env() { 51 | echo "unset $1" >> $PROFILE_PATH 52 | } 53 | 54 | # Does some serious copying. 55 | deep-cp() { 56 | declare source="$1" target="$2" 57 | 58 | mkdir -p "$target" 59 | 60 | # cp doesn't like being called without source params, 61 | # so make sure they expand to something first. 62 | # subshell to avoid surprising caller with shopts. 63 | ( 64 | shopt -s nullglob dotglob 65 | set -- "$source"/!(tmp|.|..) 66 | [[ $# == 0 ]] || cp -a "$@" "$target" 67 | ) 68 | } 69 | 70 | # Does some serious moving. 71 | deep-mv() { 72 | deep-cp "$1" "$2" 73 | deep-rm "$1" 74 | } 75 | 76 | # Does some serious deleting. 77 | deep-rm() { 78 | # subshell to avoid surprising caller with shopts. 79 | ( 80 | shopt -s dotglob 81 | rm -rf "$1"/!(.curlrc|.netrc|tmp|.|..) 82 | ) 83 | } 84 | 85 | 86 | sub-env() { 87 | 88 | WHITELIST=${2:-''} 89 | BLACKLIST=${3:-'^(GIT_DIR|PYTHONHOME|LD_LIBRARY_PATH|LIBRARY_PATH|PATH)$'} 90 | 91 | # Python-specific variables. 92 | export PYHONHOME=$BUILD_DIR/.heroku/python 93 | export PYTHONPATH=$BUILD_DIR/ 94 | 95 | ( 96 | if [ -d "$ENV_DIR" ]; then 97 | for e in $(ls $ENV_DIR); do 98 | echo "$e" | grep -E "$WHITELIST" | grep -qvE "$BLACKLIST" && 99 | export "$e=$(cat $ENV_DIR/$e)" 100 | : 101 | done 102 | fi 103 | 104 | $1 105 | 106 | ) 107 | } 108 | 109 | -------------------------------------------------------------------------------- /bin/warnings: -------------------------------------------------------------------------------- 1 | shopt -s extglob 2 | 3 | old-platform() { 4 | if grep -qi 'InsecurePlatformWarning' "$WARNINGS_LOG"; then 5 | echo 6 | puts-warn "Hello! It looks like your application is using an outdated version of Python." 7 | puts-warn "This caused the security warning you saw above during the 'pip install' step." 8 | puts-warn "We recommend '$RECOMMENDED_PYTHON_VERSION', which you can specify in a 'runtime.txt' file." 9 | puts-warn " -- Much Love, Heroku." 10 | fi 11 | } 12 | 13 | pylibmc-missing() { 14 | if grep -qi 'fatal error: libmemcached/memcached.h: No such file or directory' "$WARNINGS_LOG"; then 15 | echo 16 | puts-warn "Hello! There was a problem with your build related to libmemcache." 17 | puts-warn "The Python library 'pylibmc' must be explicitly specified in 'requirements.txt' in order to build correctly." 18 | puts-warn "Once you do that, everything should work as expected. -- Much Love, Heroku." 19 | fi 20 | } 21 | 22 | scipy-included() { 23 | if grep -qi 'running setup.py install for scipy' "$WARNINGS_LOG"; then 24 | echo 25 | puts-warn "Hello! It looks like you're trying to use scipy on Heroku." 26 | puts-warn "Unfortunately, at this time, we do not directly support this library." 27 | puts-warn "There is, however, a buildpack available that makes it possible to use it on Heroku." 28 | puts-warn "You can learn more here: https://devcenter.heroku.com/articles/python-c-deps" 29 | puts-warn "Sorry for the inconvenience. -- Much Love, Heroku." 30 | fi 31 | } 32 | 33 | distribute-included() { 34 | if grep -qi 'Running setup.py install for distribute' "$WARNINGS_LOG"; then 35 | echo 36 | puts-warn "Hello! Your requirements.txt file contains the distribute package." 37 | puts-warn "This library is automatically installed by Heroku and shouldn't be in" 38 | puts-warn "Your requirements.txt file. This can cause unexpected behavior." 39 | puts-warn " -- Much Love, Heroku." 40 | fi 41 | } 42 | 43 | show-warnings() { 44 | old-platform 45 | pylibmc-missing 46 | scipy-included 47 | distribute-included 48 | } 49 | 50 | -------------------------------------------------------------------------------- /builds/README.md: -------------------------------------------------------------------------------- 1 | # Python Buildpack Binaries 2 | 3 | 4 | To get started with it, create an app on Heroku inside a clone of this repository, and set your S3 config vars: 5 | 6 | $ heroku create --buildpack https://github.com/heroku/heroku-buildpack-python#not-heroku 7 | $ heroku config:set WORKSPACE_DIR=builds 8 | $ heroku config:set AWS_ACCESS_KEY_ID= 9 | $ heroku config:set AWS_SECRET_ACCESS_KEY= 10 | $ heroku config:set S3_BUCKET= 11 | 12 | 13 | Then, shell into an instance and run a build by giving the name of the formula inside `builds`: 14 | 15 | $ heroku run bash 16 | Running `bash` attached to terminal... up, run.6880 17 | ~ $ bob build runtimes/python-2.7.6 18 | 19 | Fetching dependencies... found 2: 20 | - libraries/sqlite 21 | 22 | Building formula runtimes/python-2.7.6: 23 | === Building Python 2.7.6 24 | Fetching Python v2.7.6 source... 25 | Compiling... 26 | 27 | If this works, run `bob deploy` instead of `bob build` to have the result uploaded to S3 for you. 28 | 29 | To speed things up drastically, it'll usually be a good idea to `heroku run bash --size PX` instead. 30 | 31 | Enjoy :) -------------------------------------------------------------------------------- /builds/libraries/autoconf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | echo "Building autoconf..." 7 | 8 | 9 | SOURCE_TARBALL='https://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.gz' 10 | curl -L $SOURCE_TARBALL | tar xz 11 | 12 | cd autoconf-2.68 13 | ./configure --prefix=$OUT_PREFIX 14 | make 15 | make install -------------------------------------------------------------------------------- /builds/libraries/sqlite: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | echo "Building SQLite..." 7 | 8 | 9 | SOURCE_TARBALL='https://www.sqlite.org/sqlite-autoconf-3070900.tar.gz' 10 | 11 | curl $SOURCE_TARBALL | tar xz 12 | # jx 13 | mv sqlite-autoconf-3070900 sqlite 14 | 15 | cd sqlite 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | 20 | # Cleanup 21 | cd .. 22 | rm -fr sqlite 23 | -------------------------------------------------------------------------------- /builds/libraries/vendor/gdal: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/vendor/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | # Use new path, containing autoconf. 7 | export PATH="/app/.heroku/python/bin/:$PATH" 8 | hash -r 9 | 10 | 11 | echo "Building gdal..." 12 | 13 | SOURCE_TARBALL='http://download.osgeo.org/gdal/1.11.1/gdal-1.11.1.tar.gz' 14 | 15 | curl -L $SOURCE_TARBALL | tar zx 16 | 17 | cd gdal-1.11.1 18 | ./configure --prefix=$OUT_PREFIX && 19 | make 20 | make install 21 | 22 | # Cleanup 23 | cd .. 24 | -------------------------------------------------------------------------------- /builds/libraries/vendor/geos: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/vendor/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | # Use new path, containing autoconf. 7 | export PATH="/app/.heroku/python/bin/:$PATH" 8 | hash -r 9 | 10 | 11 | echo "Building geos..." 12 | 13 | SOURCE_TARBALL='http://download.osgeo.org/geos/geos-3.4.2.tar.bz2' 14 | 15 | curl -L $SOURCE_TARBALL | tar xj 16 | 17 | cd geos-3.4.2 18 | ./configure --prefix=$OUT_PREFIX && 19 | make 20 | make install 21 | 22 | # Cleanup 23 | cd .. 24 | -------------------------------------------------------------------------------- /builds/libraries/vendor/libffi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/vendor/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | # Use new path, containing autoconf. 7 | export PATH="/app/.heroku/python/bin/:$PATH" 8 | hash -r 9 | 10 | 11 | echo "Building libffi..." 12 | 13 | SOURCE_TARBALL='ftp://sourceware.org/pub/libffi/libffi-3.1.tar.gz' 14 | 15 | curl -L $SOURCE_TARBALL | tar x 16 | 17 | cd libffi-3.1 18 | ./configure --prefix=$OUT_PREFIX --disable-static && 19 | make 20 | make install 21 | 22 | # Cleanup 23 | cd .. 24 | -------------------------------------------------------------------------------- /builds/libraries/vendor/libmemcache: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/vendor/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | # fail hard 7 | set -o pipefail 8 | # fail harder 9 | set -eux 10 | 11 | DEFAULT_VERSION="1.0.18" 12 | dep_version=${VERSION:-$DEFAULT_VERSION} 13 | dep_dirname=libmemcached-${dep_version} 14 | dep_archive_name=${dep_dirname}.tar.gz 15 | dep_url=https://launchpad.net/libmemcached/1.0/${dep_version}/+download/${dep_archive_name} 16 | 17 | # SASL Support. 18 | echo "-----> Building cyrus-sasl 2.1.26..." 19 | 20 | curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz 21 | # FTP doesn't play well with piping into tar xz 22 | tar xzf cyrus-sasl-2.1.26.tar.gz 23 | 24 | pushd cyrus-sasl-2.1.26 25 | ./configure --prefix=${OUT_PREFIX} --with-plugindir=${OUT_PREFIX}lib/sasl2 --with-configdir=${OUT_PREFIX}lib/sasl2 26 | 27 | make -s -j 9 28 | make install -s 29 | popd 30 | 31 | echo "-----> Building libmemcached ${dep_version}..." 32 | 33 | curl -L ${dep_url} | tar xz 34 | pushd ${dep_dirname} 35 | CPPFLAGS=-I${OUT_PREFIX}/include LDFLAGS=-L${OUT_PREFIX}/lib ./configure --prefix=${OUT_PREFIX} --without-memcached 36 | make -s -j 9 37 | make install -s 38 | popd 39 | 40 | echo "-----> Done." -------------------------------------------------------------------------------- /builds/libraries/vendor/proj: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/vendor/ 3 | 4 | OUT_PREFIX=$1 5 | 6 | # Use new path, containing autoconf. 7 | export PATH="/app/.heroku/python/bin/:$PATH" 8 | hash -r 9 | 10 | 11 | echo "Building gdal..." 12 | 13 | SOURCE_TARBALL='http://download.osgeo.org/proj/proj-4.8.0.tar.gz' 14 | 15 | curl -L $SOURCE_TARBALL | tar zx 16 | 17 | cd proj-4.8.0 18 | ./configure --prefix=$OUT_PREFIX && 19 | make 20 | make install 21 | 22 | # Cleanup 23 | cd .. 24 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-1.7: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building PyPy..." 8 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-1.7-linux64.tar.bz2' 9 | curl -L $SOURCE_TARBALL | tar jx 10 | cp -R pypy-1.7/* $OUT_PREFIX 11 | 12 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python -------------------------------------------------------------------------------- /builds/runtimes/pypy-1.8: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building PyPy..." 8 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-1.8-linux64.tar.bz2' 9 | curl -L $SOURCE_TARBALL | tar jx 10 | cp -R pypy-1.8/* $OUT_PREFIX 11 | 12 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 13 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-1.9: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building PyPy..." 8 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-1.9-linux64.tar.bz2' 9 | curl -L $SOURCE_TARBALL | tar jx 10 | cp -R pypy-1.9/* $OUT_PREFIX 11 | 12 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 13 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.0/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.0.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.0.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.0.1/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.0.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.0.2-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.0.2/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.1/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.2-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.2-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.2.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.2.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.2.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite, libraries/libffi 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.3-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.3-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.3.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.3.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.3.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.4.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.4.0-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.5.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.5.0-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.5.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.5.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.5.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.6.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.6.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.6.0-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-2.6.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-2.6.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-2.6.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-4.0.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-4.0.0-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-4.0.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-4.0.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-4.0.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-5.0.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-5.0.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-5.0.0-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy-5.0.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy-5.0.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy-5.0.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy3-2.3.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy3-2.3.1-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy3-2.3.1-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/pypy3-2.4.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar-14 stack, not cedar. 6 | 7 | OUT_PREFIX=$1 8 | 9 | echo "Building PyPy..." 10 | SOURCE_TARBALL='https://bitbucket.org/pypy/pypy/downloads/pypy3-2.4.0-linux64.tar.bz2' 11 | curl -L $SOURCE_TARBALL | tar jx 12 | cp -R pypy3-2.4.0-linux64/* $OUT_PREFIX 13 | 14 | ln $OUT_PREFIX/bin/pypy3 $OUT_PREFIX/bin/python 15 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.4.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.4 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.4.4/Python-2.4.4.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.4.4 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.4.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.4 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.4.5/Python-2.4.5.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.4.5 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.4.6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.4 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.4.6/Python-2.4.6.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.4.6 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.5 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5/Python-2.5.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.5 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5.1/Python-2.5.1.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5.1 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.5 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5.2/Python-2.5.2.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5.2 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.5 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5.3/Python-2.5.3.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5.3 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.5 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5.4/Python-2.5.4.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5.4 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5.5/Python-2.5.5.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5.5 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.5.6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.5 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.5.6/Python-2.5.6.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.5.6 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar stack, not cedar-14. 6 | 7 | OUT_PREFIX=$1 8 | 9 | # Protect 2.6 builds from parent Python (causes segfault during build). 10 | unset LANG PYTHONHOME PYTHONPATH 11 | 12 | echo "Building Python..." 13 | SOURCE_TARBALL='https://www.python.org/ftp/python/2.6/Python-2.6.tar.bz2' 14 | curl -L $SOURCE_TARBALL | tar jx 15 | mv Python-2.6 src 16 | cd src 17 | 18 | ./configure --prefix=$OUT_PREFIX --enable-shared 19 | make 20 | make install 21 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | # NOTICE: This formula only works for the cedar stack, not cedar-14. 6 | 7 | OUT_PREFIX=$1 8 | 9 | # Protect 2.6 builds from parent Python (causes segfault during build). 10 | unset LANG PYTHONHOME PYTHONPATH 11 | 12 | echo "Building Python..." 13 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.1/Python-2.6.1.tgz' 14 | curl -L $SOURCE_TARBALL | tar xz 15 | mv Python-2.6.1 src 16 | cd src 17 | 18 | ./configure --prefix=$OUT_PREFIX --enable-shared 19 | make 20 | make install 21 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.2/Python-2.6.2.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.2 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.3/Python-2.6.3.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.3 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.4/Python-2.6.4.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.4 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.5/Python-2.6.5.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.5 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.6/Python-2.6.6.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.6 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.7: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.7/Python-2.6.7.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.7 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.8: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.8/Python-2.6.8.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.8 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.6.9: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | # Protect 2.6 builds from parent Python (causes segfault during build). 8 | unset LANG PYTHONHOME PYTHONPATH 9 | 10 | echo "Building Python..." 11 | SOURCE_TARBALL='https://python.org/ftp/python/2.6.9/Python-2.6.9.tgz' 12 | curl -L $SOURCE_TARBALL | tar xz 13 | mv Python-2.6.9 src 14 | cd src 15 | 16 | ./configure --prefix=$OUT_PREFIX --enable-shared 17 | make 18 | make install 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7/Python-2.7.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.1/Python-2.7.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.10: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.10/Python-2.7.10.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.10 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.11: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.11/Python-2.7.11.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.11 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.11rc1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://www.python.org/ftp/python/2.7.11/Python-2.7.11rc1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.11rc1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.2/Python-2.7.2.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.2 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.3/Python-2.7.3.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.3 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.4/Python-2.7.4.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.4 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.5/Python-2.7.5.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.5 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.6/Python-2.7.6.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.6 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.7: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.7/Python-2.7.7.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.7 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.7-shared: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.7/Python-2.7.7.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.7 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.8: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.8/Python-2.7.8.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.8 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.8-shared: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.8/Python-2.7.8.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.8 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-2.7.9: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/2.7.9/Python-2.7.9.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-2.7.9 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no 14 | make 15 | make install 16 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.1.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.1/Python-3.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.1.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.1.1/Python-3.1.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.1.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.1.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.1.2/Python-3.1.2.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.1.2 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.1.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.1.3/Python-3.1.3.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.1.3 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.1.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.1.4/Python-3.1.4.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.1.4 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.1.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.1.5/Python-3.1.5.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.1.5 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.2.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.2/Python-3.2.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.2 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.2.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.2.1/Python-3.2.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.2.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.2.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.2.2/Python-3.2.2.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.2.2 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.2.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.2.3/Python-3.2.3.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.2.3 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.2.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.2.4/Python-3.2.4.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.2.4 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.2.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.2.5/Python-3.2.5.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.2.5 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.0/Python-3.3.0.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.0 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.1/Python-3.3.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.2/Python-3.3.2.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.2 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.3/Python-3.3.3.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.3 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.4: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.4/Python-3.3.4.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.4 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.5: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.5/Python-3.3.5.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.5 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.3.6: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.3.6/Python-3.3.6.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.3.6 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.4.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.4.0/Python-3.4.0.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.4.0 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.4.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.4.1/Python-3.4.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.4.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.4.2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.4.2/Python-3.4.2.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.4.2 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.4.3: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.4.3/Python-3.4.3.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.4.3 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.5.0: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.5.0/Python-3.5.0.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.5.0 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no --enable-shared 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | 19 | -------------------------------------------------------------------------------- /builds/runtimes/python-3.5.1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Build Path: /app/.heroku/python/ 3 | # Build Deps: libraries/sqlite 4 | 5 | OUT_PREFIX=$1 6 | 7 | echo "Building Python..." 8 | SOURCE_TARBALL='https://python.org/ftp/python/3.5.1/Python-3.5.1.tgz' 9 | curl -L $SOURCE_TARBALL | tar xz 10 | mv Python-3.5.1 src 11 | cd src 12 | 13 | ./configure --prefix=$OUT_PREFIX --with-ensurepip=no 14 | make 15 | make install 16 | 17 | ln $OUT_PREFIX/bin/python3 $OUT_PREFIX/bin/python 18 | 19 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | bob-builder==0.0.5 2 | -------------------------------------------------------------------------------- /vendor/bpwatch/bpwatch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | 4 | import os 5 | import sys 6 | 7 | 8 | DEFAULT_PATH = '{0}.zip'.format(os.path.abspath(__file__)) 9 | BPWATCH_DISTRO_PATH = os.environ.get('BPWATCH_DISTRO_PATH', DEFAULT_PATH) 10 | 11 | sys.path.insert(0, BPWATCH_DISTRO_PATH) 12 | 13 | import bp_cli 14 | bp_cli.main() 15 | -------------------------------------------------------------------------------- /vendor/bpwatch/bpwatch.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/bpwatch/bpwatch.zip -------------------------------------------------------------------------------- /vendor/pip-8.1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-8.1.1.tar.gz -------------------------------------------------------------------------------- /vendor/pip-pop/pip-grep: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """Usage: 5 | pip-grep [-s] ... 6 | 7 | Options: 8 | -h --help Show this screen. 9 | """ 10 | import os 11 | from docopt import docopt 12 | from pip.req import parse_requirements 13 | from pip.index import PackageFinder 14 | from pip._vendor.requests import session 15 | 16 | requests = session() 17 | 18 | class Requirements(object): 19 | def __init__(self, reqfile=None): 20 | super(Requirements, self).__init__() 21 | self.path = reqfile 22 | self.requirements = [] 23 | 24 | if reqfile: 25 | self.load(reqfile) 26 | 27 | def __repr__(self): 28 | return ''.format(self.path) 29 | 30 | def load(self, reqfile): 31 | 32 | if not os.path.exists(reqfile): 33 | raise ValueError('The given requirements file does not exist.') 34 | 35 | finder = PackageFinder([], [], session=requests) 36 | for requirement in parse_requirements(reqfile, finder=finder, session=requests): 37 | self.requirements.append(requirement) 38 | 39 | 40 | 41 | 42 | def grep(reqfile, packages, silent=False): 43 | 44 | try: 45 | r = Requirements(reqfile) 46 | except ValueError: 47 | 48 | if not silent: 49 | print('There was a problem loading the given requirement file.') 50 | 51 | exit(os.EX_NOINPUT) 52 | 53 | for requirement in r.requirements: 54 | 55 | if requirement.req: 56 | 57 | if requirement.req.project_name in packages: 58 | 59 | if not silent: 60 | print('Package {} found!'.format(requirement.req.project_name)) 61 | 62 | exit(0) 63 | 64 | if not silent: 65 | print('Not found.'.format(requirement.req.project_name)) 66 | 67 | exit(1) 68 | 69 | 70 | def main(): 71 | args = docopt(__doc__, version='pip-grep') 72 | 73 | kwargs = {'reqfile': args[''], 'packages': args[''], 'silent': args['-s']} 74 | 75 | 76 | grep(**kwargs) 77 | 78 | 79 | 80 | if __name__ == '__main__': 81 | main() 82 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/__main__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import os 4 | import sys 5 | 6 | # If we are running from a wheel, add the wheel to sys.path 7 | # This allows the usage python pip-*.whl/pip install pip-*.whl 8 | if __package__ == '': 9 | # __file__ is pip-*.whl/pip/__main__.py 10 | # first dirname call strips of '/__main__.py', second strips off '/pip' 11 | # Resulting path is the name of the wheel itself 12 | # Add that to sys.path so we can import pip 13 | path = os.path.dirname(os.path.dirname(__file__)) 14 | sys.path.insert(0, path) 15 | 16 | import pip # noqa 17 | 18 | if __name__ == '__main__': 19 | sys.exit(pip.main()) 20 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/README.rst: -------------------------------------------------------------------------------- 1 | Policy 2 | ====== 3 | 4 | Vendored libraries should not be modified except as required to actually 5 | successfully vendor them. 6 | 7 | 8 | Modifications 9 | ============= 10 | 11 | * html5lib has been modified to import six from pip._vendor 12 | * pkg_resources has been modified to import _markerlib from pip._vendor 13 | * markerlib has been modified to import its API from pip._vendor 14 | * CacheControl has been modified to import it's dependencies from pip._vendor 15 | * progress has been modified to not use unicode literals for support for Python 3.2 16 | 17 | 18 | _markerlib and pkg_resources 19 | ============================ 20 | 21 | _markerlib and pkg_resources has been pulled in from setuptools 18.2 22 | 23 | 24 | Note to Downstream Distributors 25 | =============================== 26 | 27 | Libraries are vendored/bundled inside of this directory in order to prevent 28 | end users from needing to manually install packages if they accidently remove 29 | something that pip depends on. 30 | 31 | All bundled packages exist in the ``pip._vendor`` namespace, and the versions 32 | (fetched from PyPI) that we use are located in ``vendor.txt``. If you wish 33 | to debundle these you can do so by either deleting everything in 34 | ``pip/_vendor`` **except** for ``pip/_vendor/__init__.py`` or by running 35 | ``PIP_NO_VENDOR_FOR_DOWNSTREAM=1 setup.py install``. No other changes should 36 | be required as the ``pip/_vendor/__init__.py`` file will alias the "real" 37 | names (such as ``import six``) to the bundled names (such as 38 | ``import pip._vendor.six``) automatically. Alternatively if you delete the 39 | entire ``pip._vendor`` you will need to adjust imports that import from those 40 | locations. 41 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | pip._vendor is for vendoring dependencies of pip to prevent needing pip to 3 | depend on something external. 4 | 5 | Files inside of pip._vendor should be considered immutable and should only be 6 | updated to versions from upstream. 7 | """ 8 | from __future__ import absolute_import 9 | 10 | import glob 11 | import os.path 12 | import sys 13 | 14 | # Downstream redistributors which have debundled our dependencies should also 15 | # patch this value to be true. This will trigger the additional patching 16 | # to cause things like "six" to be available as pip. 17 | DEBUNDLED = False 18 | 19 | # By default, look in this directory for a bunch of .whl files which we will 20 | # add to the beginning of sys.path before attempting to import anything. This 21 | # is done to support downstream re-distributors like Debian and Fedora who 22 | # wish to create their own Wheels for our dependencies to aid in debundling. 23 | WHEEL_DIR = os.path.abspath(os.path.dirname(__file__)) 24 | 25 | 26 | # Define a small helper function to alias our vendored modules to the real ones 27 | # if the vendored ones do not exist. This idea of this was taken from 28 | # https://github.com/kennethreitz/requests/pull/2567. 29 | def vendored(modulename): 30 | vendored_name = "{0}.{1}".format(__name__, modulename) 31 | 32 | try: 33 | __import__(vendored_name, globals(), locals(), level=0) 34 | except ImportError: 35 | __import__(modulename, globals(), locals(), level=0) 36 | sys.modules[vendored_name] = sys.modules[modulename] 37 | base, head = vendored_name.rsplit(".", 1) 38 | setattr(sys.modules[base], head, sys.modules[modulename]) 39 | 40 | 41 | # If we're operating in a debundled setup, then we want to go ahead and trigger 42 | # the aliasing of our vendored libraries as well as looking for wheels to add 43 | # to our sys.path. This will cause all of this code to be a no-op typically 44 | # however downstream redistributors can enable it in a consistent way across 45 | # all platforms. 46 | if DEBUNDLED: 47 | # Actually look inside of WHEEL_DIR to find .whl files and add them to the 48 | # front of our sys.path. 49 | sys.path[:] = glob.glob(os.path.join(WHEEL_DIR, "*.whl")) + sys.path 50 | 51 | # Actually alias all of our vendored dependencies. 52 | vendored("cachecontrol") 53 | vendored("colorama") 54 | vendored("distlib") 55 | vendored("html5lib") 56 | vendored("lockfile") 57 | vendored("six") 58 | vendored("six.moves") 59 | vendored("six.moves.urllib") 60 | vendored("packaging") 61 | vendored("packaging.version") 62 | vendored("packaging.specifiers") 63 | vendored("pkg_resources") 64 | vendored("progress") 65 | vendored("retrying") 66 | vendored("requests") 67 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/_markerlib/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | import ast 3 | from pip._vendor._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/pip-pop/pip/_vendor/cachecontrol/__init__.py: -------------------------------------------------------------------------------- 1 | """CacheControl import Interface. 2 | 3 | Make it easy to import from cachecontrol without long namespaces. 4 | """ 5 | __author__ = 'Eric Larson' 6 | __email__ = 'eric@ionrock.org' 7 | __version__ = '0.11.5' 8 | 9 | from .wrapper import CacheControl 10 | from .adapter import CacheControlAdapter 11 | from .controller import CacheController 12 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/cachecontrol/cache.py: -------------------------------------------------------------------------------- 1 | """ 2 | The cache object API for implementing caches. The default is a thread 3 | safe in-memory dictionary. 4 | """ 5 | from threading import Lock 6 | 7 | 8 | class BaseCache(object): 9 | 10 | def get(self, key): 11 | raise NotImplemented() 12 | 13 | def set(self, key, value): 14 | raise NotImplemented() 15 | 16 | def delete(self, key): 17 | raise NotImplemented() 18 | 19 | def close(self): 20 | pass 21 | 22 | 23 | class DictCache(BaseCache): 24 | 25 | def __init__(self, init_dict=None): 26 | self.lock = Lock() 27 | self.data = init_dict or {} 28 | 29 | def get(self, key): 30 | return self.data.get(key, None) 31 | 32 | def set(self, key, value): 33 | with self.lock: 34 | self.data.update({key: value}) 35 | 36 | def delete(self, key): 37 | with self.lock: 38 | if key in self.data: 39 | self.data.pop(key) 40 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/cachecontrol/caches/__init__.py: -------------------------------------------------------------------------------- 1 | from textwrap import dedent 2 | 3 | try: 4 | from .file_cache import FileCache 5 | except ImportError: 6 | notice = dedent(''' 7 | NOTE: In order to use the FileCache you must have 8 | lockfile installed. You can install it via pip: 9 | pip install lockfile 10 | ''') 11 | print(notice) 12 | 13 | 14 | try: 15 | import redis 16 | from .redis_cache import RedisCache 17 | except ImportError: 18 | pass 19 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/cachecontrol/caches/redis_cache.py: -------------------------------------------------------------------------------- 1 | from __future__ import division 2 | 3 | from datetime import datetime 4 | 5 | 6 | def total_seconds(td): 7 | """Python 2.6 compatability""" 8 | if hasattr(td, 'total_seconds'): 9 | return td.total_seconds() 10 | 11 | ms = td.microseconds 12 | secs = (td.seconds + td.days * 24 * 3600) 13 | return (ms + secs * 10**6) / 10**6 14 | 15 | 16 | class RedisCache(object): 17 | 18 | def __init__(self, conn): 19 | self.conn = conn 20 | 21 | def get(self, key): 22 | return self.conn.get(key) 23 | 24 | def set(self, key, value, expires=None): 25 | if not expires: 26 | self.conn.set(key, value) 27 | else: 28 | expires = expires - datetime.now() 29 | self.conn.setex(key, total_seconds(expires), value) 30 | 31 | def delete(self, key): 32 | self.conn.delete(key) 33 | 34 | def clear(self): 35 | """Helper for clearing all the keys in a database. Use with 36 | caution!""" 37 | for key in self.conn.keys(): 38 | self.conn.delete(key) 39 | 40 | def close(self): 41 | self.conn.disconnect() 42 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/cachecontrol/compat.py: -------------------------------------------------------------------------------- 1 | try: 2 | from urllib.parse import urljoin 3 | except ImportError: 4 | from urlparse import urljoin 5 | 6 | 7 | try: 8 | import cPickle as pickle 9 | except ImportError: 10 | import pickle 11 | 12 | 13 | from pip._vendor.requests.packages.urllib3.response import HTTPResponse 14 | from pip._vendor.requests.packages.urllib3.util import is_fp_closed 15 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/cachecontrol/filewrapper.py: -------------------------------------------------------------------------------- 1 | from io import BytesIO 2 | 3 | 4 | class CallbackFileWrapper(object): 5 | """ 6 | Small wrapper around a fp object which will tee everything read into a 7 | buffer, and when that file is closed it will execute a callback with the 8 | contents of that buffer. 9 | 10 | All attributes are proxied to the underlying file object. 11 | 12 | This class uses members with a double underscore (__) leading prefix so as 13 | not to accidentally shadow an attribute. 14 | """ 15 | 16 | def __init__(self, fp, callback): 17 | self.__buf = BytesIO() 18 | self.__fp = fp 19 | self.__callback = callback 20 | 21 | def __getattr__(self, name): 22 | # The vaguaries of garbage collection means that self.__fp is 23 | # not always set. By using __getattribute__ and the private 24 | # name[0] allows looking up the attribute value and raising an 25 | # AttributeError when it doesn't exist. This stop thigns from 26 | # infinitely recursing calls to getattr in the case where 27 | # self.__fp hasn't been set. 28 | # 29 | # [0] https://docs.python.org/2/reference/expressions.html#atom-identifiers 30 | fp = self.__getattribute__('_CallbackFileWrapper__fp') 31 | return getattr(fp, name) 32 | 33 | def __is_fp_closed(self): 34 | try: 35 | return self.__fp.fp is None 36 | except AttributeError: 37 | pass 38 | 39 | try: 40 | return self.__fp.closed 41 | except AttributeError: 42 | pass 43 | 44 | # We just don't cache it then. 45 | # TODO: Add some logging here... 46 | return False 47 | 48 | def read(self, amt=None): 49 | data = self.__fp.read(amt) 50 | self.__buf.write(data) 51 | 52 | if self.__is_fp_closed(): 53 | if self.__callback: 54 | self.__callback(self.__buf.getvalue()) 55 | 56 | # We assign this to None here, because otherwise we can get into 57 | # really tricky problems where the CPython interpreter dead locks 58 | # because the callback is holding a reference to something which 59 | # has a __del__ method. Setting this to None breaks the cycle 60 | # and allows the garbage collector to do it's thing normally. 61 | self.__callback = None 62 | 63 | return data 64 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/cachecontrol/wrapper.py: -------------------------------------------------------------------------------- 1 | from .adapter import CacheControlAdapter 2 | from .cache import DictCache 3 | 4 | 5 | def CacheControl(sess, 6 | cache=None, 7 | cache_etags=True, 8 | serializer=None, 9 | heuristic=None): 10 | 11 | cache = cache or DictCache() 12 | adapter = CacheControlAdapter( 13 | cache, 14 | cache_etags=cache_etags, 15 | serializer=serializer, 16 | heuristic=heuristic, 17 | ) 18 | sess.mount('http://', adapter) 19 | sess.mount('https://', adapter) 20 | 21 | return sess 22 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/colorama/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | from .initialise import init, deinit, reinit 3 | from .ansi import Fore, Back, Style, Cursor 4 | from .ansitowin32 import AnsiToWin32 5 | 6 | __version__ = '0.3.3' 7 | 8 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/colorama/ansi.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | ''' 3 | This module generates ANSI character codes to printing colors to terminals. 4 | See: http://en.wikipedia.org/wiki/ANSI_escape_code 5 | ''' 6 | 7 | CSI = '\033[' 8 | OSC = '\033]' 9 | BEL = '\007' 10 | 11 | 12 | def code_to_chars(code): 13 | return CSI + str(code) + 'm' 14 | 15 | 16 | class AnsiCodes(object): 17 | def __init__(self, codes): 18 | for name in dir(codes): 19 | if not name.startswith('_'): 20 | value = getattr(codes, name) 21 | setattr(self, name, code_to_chars(value)) 22 | 23 | 24 | class AnsiCursor(object): 25 | def UP(self, n=1): 26 | return CSI + str(n) + "A" 27 | def DOWN(self, n=1): 28 | return CSI + str(n) + "B" 29 | def FORWARD(self, n=1): 30 | return CSI + str(n) + "C" 31 | def BACK(self, n=1): 32 | return CSI + str(n) + "D" 33 | def POS(self, x=1, y=1): 34 | return CSI + str(y) + ";" + str(x) + "H" 35 | 36 | def set_title(title): 37 | return OSC + "2;" + title + BEL 38 | 39 | def clear_screen(mode=2): 40 | return CSI + str(mode) + "J" 41 | 42 | def clear_line(mode=2): 43 | return CSI + str(mode) + "K" 44 | 45 | 46 | class AnsiFore: 47 | BLACK = 30 48 | RED = 31 49 | GREEN = 32 50 | YELLOW = 33 51 | BLUE = 34 52 | MAGENTA = 35 53 | CYAN = 36 54 | WHITE = 37 55 | RESET = 39 56 | 57 | # These are fairly well supported, but not part of the standard. 58 | LIGHTBLACK_EX = 90 59 | LIGHTRED_EX = 91 60 | LIGHTGREEN_EX = 92 61 | LIGHTYELLOW_EX = 93 62 | LIGHTBLUE_EX = 94 63 | LIGHTMAGENTA_EX = 95 64 | LIGHTCYAN_EX = 96 65 | LIGHTWHITE_EX = 97 66 | 67 | 68 | class AnsiBack: 69 | BLACK = 40 70 | RED = 41 71 | GREEN = 42 72 | YELLOW = 43 73 | BLUE = 44 74 | MAGENTA = 45 75 | CYAN = 46 76 | WHITE = 47 77 | RESET = 49 78 | 79 | # These are fairly well supported, but not part of the standard. 80 | LIGHTBLACK_EX = 100 81 | LIGHTRED_EX = 101 82 | LIGHTGREEN_EX = 102 83 | LIGHTYELLOW_EX = 103 84 | LIGHTBLUE_EX = 104 85 | LIGHTMAGENTA_EX = 105 86 | LIGHTCYAN_EX = 106 87 | LIGHTWHITE_EX = 107 88 | 89 | 90 | class AnsiStyle: 91 | BRIGHT = 1 92 | DIM = 2 93 | NORMAL = 22 94 | RESET_ALL = 0 95 | 96 | Fore = AnsiCodes( AnsiFore ) 97 | Back = AnsiCodes( AnsiBack ) 98 | Style = AnsiCodes( AnsiStyle ) 99 | Cursor = AnsiCursor() 100 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/colorama/initialise.py: -------------------------------------------------------------------------------- 1 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. 2 | import atexit 3 | import sys 4 | 5 | from .ansitowin32 import AnsiToWin32 6 | 7 | 8 | orig_stdout = sys.stdout 9 | orig_stderr = sys.stderr 10 | 11 | wrapped_stdout = sys.stdout 12 | wrapped_stderr = sys.stderr 13 | 14 | atexit_done = False 15 | 16 | 17 | def reset_all(): 18 | AnsiToWin32(orig_stdout).reset_all() 19 | 20 | 21 | def init(autoreset=False, convert=None, strip=None, wrap=True): 22 | 23 | if not wrap and any([autoreset, convert, strip]): 24 | raise ValueError('wrap=False conflicts with any other arg=True') 25 | 26 | global wrapped_stdout, wrapped_stderr 27 | if sys.stdout is None: 28 | wrapped_stdout = None 29 | else: 30 | sys.stdout = wrapped_stdout = \ 31 | wrap_stream(orig_stdout, convert, strip, autoreset, wrap) 32 | if sys.stderr is None: 33 | wrapped_stderr = None 34 | else: 35 | sys.stderr = wrapped_stderr = \ 36 | wrap_stream(orig_stderr, convert, strip, autoreset, wrap) 37 | 38 | global atexit_done 39 | if not atexit_done: 40 | atexit.register(reset_all) 41 | atexit_done = True 42 | 43 | 44 | def deinit(): 45 | if orig_stdout is not None: 46 | sys.stdout = orig_stdout 47 | if orig_stderr is not None: 48 | sys.stderr = orig_stderr 49 | 50 | 51 | def reinit(): 52 | if wrapped_stdout is not None: 53 | sys.stdout = wrapped_stdout 54 | if wrapped_stderr is not None: 55 | sys.stderr = wrapped_stderr 56 | 57 | 58 | def wrap_stream(stream, convert, strip, autoreset, wrap): 59 | if wrap: 60 | wrapper = AnsiToWin32(stream, 61 | convert=convert, strip=strip, autoreset=autoreset) 62 | if wrapper.should_wrap(): 63 | stream = wrapper.stream 64 | return stream 65 | 66 | 67 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012-2014 Vinay Sajip. 4 | # Licensed to the Python Software Foundation under a contributor agreement. 5 | # See LICENSE.txt and CONTRIBUTORS.txt. 6 | # 7 | import logging 8 | 9 | __version__ = '0.2.1' 10 | 11 | class DistlibException(Exception): 12 | pass 13 | 14 | try: 15 | from logging import NullHandler 16 | except ImportError: # pragma: no cover 17 | class NullHandler(logging.Handler): 18 | def handle(self, record): pass 19 | def emit(self, record): pass 20 | def createLock(self): self.lock = None 21 | 22 | logger = logging.getLogger(__name__) 23 | logger.addHandler(NullHandler()) 24 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/_backport/__init__.py: -------------------------------------------------------------------------------- 1 | """Modules copied from Python 3 standard libraries, for internal use only. 2 | 3 | Individual classes and functions are found in d2._backport.misc. Intended 4 | usage is to always import things missing from 3.1 from that module: the 5 | built-in/stdlib objects will be used if found. 6 | """ 7 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/_backport/misc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # Copyright (C) 2012 The Python Software Foundation. 4 | # See LICENSE.txt and CONTRIBUTORS.txt. 5 | # 6 | """Backports for individual classes and functions.""" 7 | 8 | import os 9 | import sys 10 | 11 | __all__ = ['cache_from_source', 'callable', 'fsencode'] 12 | 13 | 14 | try: 15 | from imp import cache_from_source 16 | except ImportError: 17 | def cache_from_source(py_file, debug=__debug__): 18 | ext = debug and 'c' or 'o' 19 | return py_file + ext 20 | 21 | 22 | try: 23 | callable = callable 24 | except NameError: 25 | from collections import Callable 26 | 27 | def callable(obj): 28 | return isinstance(obj, Callable) 29 | 30 | 31 | try: 32 | fsencode = os.fsencode 33 | except AttributeError: 34 | def fsencode(filename): 35 | if isinstance(filename, bytes): 36 | return filename 37 | elif isinstance(filename, str): 38 | return filename.encode(sys.getfilesystemencoding()) 39 | else: 40 | raise TypeError("expect bytes or str, not %s" % 41 | type(filename).__name__) 42 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/_backport/sysconfig.cfg: -------------------------------------------------------------------------------- 1 | [posix_prefix] 2 | # Configuration directories. Some of these come straight out of the 3 | # configure script. They are for implementing the other variables, not to 4 | # be used directly in [resource_locations]. 5 | confdir = /etc 6 | datadir = /usr/share 7 | libdir = /usr/lib 8 | statedir = /var 9 | # User resource directory 10 | local = ~/.local/{distribution.name} 11 | 12 | stdlib = {base}/lib/python{py_version_short} 13 | platstdlib = {platbase}/lib/python{py_version_short} 14 | purelib = {base}/lib/python{py_version_short}/site-packages 15 | platlib = {platbase}/lib/python{py_version_short}/site-packages 16 | include = {base}/include/python{py_version_short}{abiflags} 17 | platinclude = {platbase}/include/python{py_version_short}{abiflags} 18 | data = {base} 19 | 20 | [posix_home] 21 | stdlib = {base}/lib/python 22 | platstdlib = {base}/lib/python 23 | purelib = {base}/lib/python 24 | platlib = {base}/lib/python 25 | include = {base}/include/python 26 | platinclude = {base}/include/python 27 | scripts = {base}/bin 28 | data = {base} 29 | 30 | [nt] 31 | stdlib = {base}/Lib 32 | platstdlib = {base}/Lib 33 | purelib = {base}/Lib/site-packages 34 | platlib = {base}/Lib/site-packages 35 | include = {base}/Include 36 | platinclude = {base}/Include 37 | scripts = {base}/Scripts 38 | data = {base} 39 | 40 | [os2] 41 | stdlib = {base}/Lib 42 | platstdlib = {base}/Lib 43 | purelib = {base}/Lib/site-packages 44 | platlib = {base}/Lib/site-packages 45 | include = {base}/Include 46 | platinclude = {base}/Include 47 | scripts = {base}/Scripts 48 | data = {base} 49 | 50 | [os2_home] 51 | stdlib = {userbase}/lib/python{py_version_short} 52 | platstdlib = {userbase}/lib/python{py_version_short} 53 | purelib = {userbase}/lib/python{py_version_short}/site-packages 54 | platlib = {userbase}/lib/python{py_version_short}/site-packages 55 | include = {userbase}/include/python{py_version_short} 56 | scripts = {userbase}/bin 57 | data = {userbase} 58 | 59 | [nt_user] 60 | stdlib = {userbase}/Python{py_version_nodot} 61 | platstdlib = {userbase}/Python{py_version_nodot} 62 | purelib = {userbase}/Python{py_version_nodot}/site-packages 63 | platlib = {userbase}/Python{py_version_nodot}/site-packages 64 | include = {userbase}/Python{py_version_nodot}/Include 65 | scripts = {userbase}/Scripts 66 | data = {userbase} 67 | 68 | [posix_user] 69 | stdlib = {userbase}/lib/python{py_version_short} 70 | platstdlib = {userbase}/lib/python{py_version_short} 71 | purelib = {userbase}/lib/python{py_version_short}/site-packages 72 | platlib = {userbase}/lib/python{py_version_short}/site-packages 73 | include = {userbase}/include/python{py_version_short} 74 | scripts = {userbase}/bin 75 | data = {userbase} 76 | 77 | [osx_framework_user] 78 | stdlib = {userbase}/lib/python 79 | platstdlib = {userbase}/lib/python 80 | purelib = {userbase}/lib/python/site-packages 81 | platlib = {userbase}/lib/python/site-packages 82 | include = {userbase}/include 83 | scripts = {userbase}/bin 84 | data = {userbase} 85 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/t32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/distlib/t32.exe -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/t64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/distlib/t64.exe -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/w32.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/distlib/w32.exe -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/distlib/w64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/distlib/w64.exe -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | HTML parsing library based on the WHATWG "HTML5" 3 | specification. The parser is designed to be compatible with existing 4 | HTML found in the wild and implements well-defined error recovery that 5 | is largely compatible with modern desktop web browsers. 6 | 7 | Example usage: 8 | 9 | import html5lib 10 | f = open("my_document.html") 11 | tree = html5lib.parse(f) 12 | """ 13 | 14 | from __future__ import absolute_import, division, unicode_literals 15 | 16 | from .html5parser import HTMLParser, parse, parseFragment 17 | from .treebuilders import getTreeBuilder 18 | from .treewalkers import getTreeWalker 19 | from .serializer import serialize 20 | 21 | __all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder", 22 | "getTreeWalker", "serialize"] 23 | __version__ = "1.0b5" 24 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/filters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/html5lib/filters/__init__.py -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/filters/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | 4 | class Filter(object): 5 | def __init__(self, source): 6 | self.source = source 7 | 8 | def __iter__(self): 9 | return iter(self.source) 10 | 11 | def __getattr__(self, name): 12 | return getattr(self.source, name) 13 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/filters/alphabeticalattributes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import _base 4 | 5 | try: 6 | from collections import OrderedDict 7 | except ImportError: 8 | from ordereddict import OrderedDict 9 | 10 | 11 | class Filter(_base.Filter): 12 | def __iter__(self): 13 | for token in _base.Filter.__iter__(self): 14 | if token["type"] in ("StartTag", "EmptyTag"): 15 | attrs = OrderedDict() 16 | for name, value in sorted(token["data"].items(), 17 | key=lambda x: x[0]): 18 | attrs[name] = value 19 | token["data"] = attrs 20 | yield token 21 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/filters/inject_meta_charset.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import _base 4 | 5 | 6 | class Filter(_base.Filter): 7 | def __init__(self, source, encoding): 8 | _base.Filter.__init__(self, source) 9 | self.encoding = encoding 10 | 11 | def __iter__(self): 12 | state = "pre_head" 13 | meta_found = (self.encoding is None) 14 | pending = [] 15 | 16 | for token in _base.Filter.__iter__(self): 17 | type = token["type"] 18 | if type == "StartTag": 19 | if token["name"].lower() == "head": 20 | state = "in_head" 21 | 22 | elif type == "EmptyTag": 23 | if token["name"].lower() == "meta": 24 | # replace charset with actual encoding 25 | has_http_equiv_content_type = False 26 | for (namespace, name), value in token["data"].items(): 27 | if namespace is not None: 28 | continue 29 | elif name.lower() == 'charset': 30 | token["data"][(namespace, name)] = self.encoding 31 | meta_found = True 32 | break 33 | elif name == 'http-equiv' and value.lower() == 'content-type': 34 | has_http_equiv_content_type = True 35 | else: 36 | if has_http_equiv_content_type and (None, "content") in token["data"]: 37 | token["data"][(None, "content")] = 'text/html; charset=%s' % self.encoding 38 | meta_found = True 39 | 40 | elif token["name"].lower() == "head" and not meta_found: 41 | # insert meta into empty head 42 | yield {"type": "StartTag", "name": "head", 43 | "data": token["data"]} 44 | yield {"type": "EmptyTag", "name": "meta", 45 | "data": {(None, "charset"): self.encoding}} 46 | yield {"type": "EndTag", "name": "head"} 47 | meta_found = True 48 | continue 49 | 50 | elif type == "EndTag": 51 | if token["name"].lower() == "head" and pending: 52 | # insert meta into head (if necessary) and flush pending queue 53 | yield pending.pop(0) 54 | if not meta_found: 55 | yield {"type": "EmptyTag", "name": "meta", 56 | "data": {(None, "charset"): self.encoding}} 57 | while pending: 58 | yield pending.pop(0) 59 | meta_found = True 60 | state = "post_head" 61 | 62 | if state == "in_head": 63 | pending.append(token) 64 | else: 65 | yield token 66 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/filters/sanitizer.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from . import _base 4 | from ..sanitizer import HTMLSanitizerMixin 5 | 6 | 7 | class Filter(_base.Filter, HTMLSanitizerMixin): 8 | def __iter__(self): 9 | for token in _base.Filter.__iter__(self): 10 | token = self.sanitize_token(token) 11 | if token: 12 | yield token 13 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/filters/whitespace.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | import re 4 | 5 | from . import _base 6 | from ..constants import rcdataElements, spaceCharacters 7 | spaceCharacters = "".join(spaceCharacters) 8 | 9 | SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) 10 | 11 | 12 | class Filter(_base.Filter): 13 | 14 | spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements)) 15 | 16 | def __iter__(self): 17 | preserve = 0 18 | for token in _base.Filter.__iter__(self): 19 | type = token["type"] 20 | if type == "StartTag" \ 21 | and (preserve or token["name"] in self.spacePreserveElements): 22 | preserve += 1 23 | 24 | elif type == "EndTag" and preserve: 25 | preserve -= 1 26 | 27 | elif not preserve and type == "SpaceCharacters" and token["data"]: 28 | # Test on token["data"] above to not introduce spaces where there were not 29 | token["data"] = " " 30 | 31 | elif not preserve and type == "Characters": 32 | token["data"] = collapse_spaces(token["data"]) 33 | 34 | yield token 35 | 36 | 37 | def collapse_spaces(text): 38 | return SPACES_REGEX.sub(' ', text) 39 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/serializer/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from .. import treewalkers 4 | 5 | from .htmlserializer import HTMLSerializer 6 | 7 | 8 | def serialize(input, tree="etree", format="html", encoding=None, 9 | **serializer_opts): 10 | # XXX: Should we cache this? 11 | walker = treewalkers.getTreeWalker(tree) 12 | if format == "html": 13 | s = HTMLSerializer(**serializer_opts) 14 | else: 15 | raise ValueError("type must be html") 16 | return s.render(walker(input), encoding) 17 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/treeadapters/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/html5lib/treeadapters/__init__.py -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/treeadapters/sax.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.sax.xmlreader import AttributesNSImpl 4 | 5 | from ..constants import adjustForeignAttributes, unadjustForeignAttributes 6 | 7 | prefix_mapping = {} 8 | for prefix, localName, namespace in adjustForeignAttributes.values(): 9 | if prefix is not None: 10 | prefix_mapping[prefix] = namespace 11 | 12 | 13 | def to_sax(walker, handler): 14 | """Call SAX-like content handler based on treewalker walker""" 15 | handler.startDocument() 16 | for prefix, namespace in prefix_mapping.items(): 17 | handler.startPrefixMapping(prefix, namespace) 18 | 19 | for token in walker: 20 | type = token["type"] 21 | if type == "Doctype": 22 | continue 23 | elif type in ("StartTag", "EmptyTag"): 24 | attrs = AttributesNSImpl(token["data"], 25 | unadjustForeignAttributes) 26 | handler.startElementNS((token["namespace"], token["name"]), 27 | token["name"], 28 | attrs) 29 | if type == "EmptyTag": 30 | handler.endElementNS((token["namespace"], token["name"]), 31 | token["name"]) 32 | elif type == "EndTag": 33 | handler.endElementNS((token["namespace"], token["name"]), 34 | token["name"]) 35 | elif type in ("Characters", "SpaceCharacters"): 36 | handler.characters(token["data"]) 37 | elif type == "Comment": 38 | pass 39 | else: 40 | assert False, "Unknown token type" 41 | 42 | for prefix, namespace in prefix_mapping.items(): 43 | handler.endPrefixMapping(prefix) 44 | handler.endDocument() 45 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/treewalkers/dom.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.dom import Node 4 | 5 | from . import _base 6 | 7 | 8 | class TreeWalker(_base.NonRecursiveTreeWalker): 9 | def getNodeDetails(self, node): 10 | if node.nodeType == Node.DOCUMENT_TYPE_NODE: 11 | return _base.DOCTYPE, node.name, node.publicId, node.systemId 12 | 13 | elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE): 14 | return _base.TEXT, node.nodeValue 15 | 16 | elif node.nodeType == Node.ELEMENT_NODE: 17 | attrs = {} 18 | for attr in list(node.attributes.keys()): 19 | attr = node.getAttributeNode(attr) 20 | if attr.namespaceURI: 21 | attrs[(attr.namespaceURI, attr.localName)] = attr.value 22 | else: 23 | attrs[(None, attr.name)] = attr.value 24 | return (_base.ELEMENT, node.namespaceURI, node.nodeName, 25 | attrs, node.hasChildNodes()) 26 | 27 | elif node.nodeType == Node.COMMENT_NODE: 28 | return _base.COMMENT, node.nodeValue 29 | 30 | elif node.nodeType in (Node.DOCUMENT_NODE, Node.DOCUMENT_FRAGMENT_NODE): 31 | return (_base.DOCUMENT,) 32 | 33 | else: 34 | return _base.UNKNOWN, node.nodeType 35 | 36 | def getFirstChild(self, node): 37 | return node.firstChild 38 | 39 | def getNextSibling(self, node): 40 | return node.nextSibling 41 | 42 | def getParentNode(self, node): 43 | return node.parentNode 44 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/treewalkers/genshistream.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from genshi.core import QName 4 | from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT 5 | from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT 6 | 7 | from . import _base 8 | 9 | from ..constants import voidElements, namespaces 10 | 11 | 12 | class TreeWalker(_base.TreeWalker): 13 | def __iter__(self): 14 | # Buffer the events so we can pass in the following one 15 | previous = None 16 | for event in self.tree: 17 | if previous is not None: 18 | for token in self.tokens(previous, event): 19 | yield token 20 | previous = event 21 | 22 | # Don't forget the final event! 23 | if previous is not None: 24 | for token in self.tokens(previous, None): 25 | yield token 26 | 27 | def tokens(self, event, next): 28 | kind, data, pos = event 29 | if kind == START: 30 | tag, attribs = data 31 | name = tag.localname 32 | namespace = tag.namespace 33 | converted_attribs = {} 34 | for k, v in attribs: 35 | if isinstance(k, QName): 36 | converted_attribs[(k.namespace, k.localname)] = v 37 | else: 38 | converted_attribs[(None, k)] = v 39 | 40 | if namespace == namespaces["html"] and name in voidElements: 41 | for token in self.emptyTag(namespace, name, converted_attribs, 42 | not next or next[0] != END 43 | or next[1] != tag): 44 | yield token 45 | else: 46 | yield self.startTag(namespace, name, converted_attribs) 47 | 48 | elif kind == END: 49 | name = data.localname 50 | namespace = data.namespace 51 | if name not in voidElements: 52 | yield self.endTag(namespace, name) 53 | 54 | elif kind == COMMENT: 55 | yield self.comment(data) 56 | 57 | elif kind == TEXT: 58 | for token in self.text(data): 59 | yield token 60 | 61 | elif kind == DOCTYPE: 62 | yield self.doctype(*data) 63 | 64 | elif kind in (XML_NAMESPACE, DOCTYPE, START_NS, END_NS, 65 | START_CDATA, END_CDATA, PI): 66 | pass 67 | 68 | else: 69 | yield self.unknown(kind) 70 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/treewalkers/pulldom.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ 4 | COMMENT, IGNORABLE_WHITESPACE, CHARACTERS 5 | 6 | from . import _base 7 | 8 | from ..constants import voidElements 9 | 10 | 11 | class TreeWalker(_base.TreeWalker): 12 | def __iter__(self): 13 | ignore_until = None 14 | previous = None 15 | for event in self.tree: 16 | if previous is not None and \ 17 | (ignore_until is None or previous[1] is ignore_until): 18 | if previous[1] is ignore_until: 19 | ignore_until = None 20 | for token in self.tokens(previous, event): 21 | yield token 22 | if token["type"] == "EmptyTag": 23 | ignore_until = previous[1] 24 | previous = event 25 | if ignore_until is None or previous[1] is ignore_until: 26 | for token in self.tokens(previous, None): 27 | yield token 28 | elif ignore_until is not None: 29 | raise ValueError("Illformed DOM event stream: void element without END_ELEMENT") 30 | 31 | def tokens(self, event, next): 32 | type, node = event 33 | if type == START_ELEMENT: 34 | name = node.nodeName 35 | namespace = node.namespaceURI 36 | attrs = {} 37 | for attr in list(node.attributes.keys()): 38 | attr = node.getAttributeNode(attr) 39 | attrs[(attr.namespaceURI, attr.localName)] = attr.value 40 | if name in voidElements: 41 | for token in self.emptyTag(namespace, 42 | name, 43 | attrs, 44 | not next or next[1] is not node): 45 | yield token 46 | else: 47 | yield self.startTag(namespace, name, attrs) 48 | 49 | elif type == END_ELEMENT: 50 | name = node.nodeName 51 | namespace = node.namespaceURI 52 | if name not in voidElements: 53 | yield self.endTag(namespace, name) 54 | 55 | elif type == COMMENT: 56 | yield self.comment(node.nodeValue) 57 | 58 | elif type in (IGNORABLE_WHITESPACE, CHARACTERS): 59 | for token in self.text(node.nodeValue): 60 | yield token 61 | 62 | else: 63 | yield self.unknown(type) 64 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/trie/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from .py import Trie as PyTrie 4 | 5 | Trie = PyTrie 6 | 7 | try: 8 | from .datrie import Trie as DATrie 9 | except ImportError: 10 | pass 11 | else: 12 | Trie = DATrie 13 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/trie/_base.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from collections import Mapping 4 | 5 | 6 | class Trie(Mapping): 7 | """Abstract base class for tries""" 8 | 9 | def keys(self, prefix=None): 10 | keys = super().keys() 11 | 12 | if prefix is None: 13 | return set(keys) 14 | 15 | # Python 2.6: no set comprehensions 16 | return set([x for x in keys if x.startswith(prefix)]) 17 | 18 | def has_keys_with_prefix(self, prefix): 19 | for key in self.keys(): 20 | if key.startswith(prefix): 21 | return True 22 | 23 | return False 24 | 25 | def longest_prefix(self, prefix): 26 | if prefix in self: 27 | return prefix 28 | 29 | for i in range(1, len(prefix) + 1): 30 | if prefix[:-i] in self: 31 | return prefix[:-i] 32 | 33 | raise KeyError(prefix) 34 | 35 | def longest_prefix_item(self, prefix): 36 | lprefix = self.longest_prefix(prefix) 37 | return (lprefix, self[lprefix]) 38 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/trie/datrie.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | 3 | from datrie import Trie as DATrie 4 | from pip._vendor.six import text_type 5 | 6 | from ._base import Trie as ABCTrie 7 | 8 | 9 | class Trie(ABCTrie): 10 | def __init__(self, data): 11 | chars = set() 12 | for key in data.keys(): 13 | if not isinstance(key, text_type): 14 | raise TypeError("All keys must be strings") 15 | for char in key: 16 | chars.add(char) 17 | 18 | self._data = DATrie("".join(chars)) 19 | for key, value in data.items(): 20 | self._data[key] = value 21 | 22 | def __contains__(self, key): 23 | return key in self._data 24 | 25 | def __len__(self): 26 | return len(self._data) 27 | 28 | def __iter__(self): 29 | raise NotImplementedError() 30 | 31 | def __getitem__(self, key): 32 | return self._data[key] 33 | 34 | def keys(self, prefix=None): 35 | return self._data.keys(prefix) 36 | 37 | def has_keys_with_prefix(self, prefix): 38 | return self._data.has_keys_with_prefix(prefix) 39 | 40 | def longest_prefix(self, prefix): 41 | return self._data.longest_prefix(prefix) 42 | 43 | def longest_prefix_item(self, prefix): 44 | return self._data.longest_prefix_item(prefix) 45 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/html5lib/trie/py.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, division, unicode_literals 2 | from pip._vendor.six import text_type 3 | 4 | from bisect import bisect_left 5 | 6 | from ._base import Trie as ABCTrie 7 | 8 | 9 | class Trie(ABCTrie): 10 | def __init__(self, data): 11 | if not all(isinstance(x, text_type) for x in data.keys()): 12 | raise TypeError("All keys must be strings") 13 | 14 | self._data = data 15 | self._keys = sorted(data.keys()) 16 | self._cachestr = "" 17 | self._cachepoints = (0, len(data)) 18 | 19 | def __contains__(self, key): 20 | return key in self._data 21 | 22 | def __len__(self): 23 | return len(self._data) 24 | 25 | def __iter__(self): 26 | return iter(self._data) 27 | 28 | def __getitem__(self, key): 29 | return self._data[key] 30 | 31 | def keys(self, prefix=None): 32 | if prefix is None or prefix == "" or not self._keys: 33 | return set(self._keys) 34 | 35 | if prefix.startswith(self._cachestr): 36 | lo, hi = self._cachepoints 37 | start = i = bisect_left(self._keys, prefix, lo, hi) 38 | else: 39 | start = i = bisect_left(self._keys, prefix) 40 | 41 | keys = set() 42 | if start == len(self._keys): 43 | return keys 44 | 45 | while self._keys[i].startswith(prefix): 46 | keys.add(self._keys[i]) 47 | i += 1 48 | 49 | self._cachestr = prefix 50 | self._cachepoints = (start, i) 51 | 52 | return keys 53 | 54 | def has_keys_with_prefix(self, prefix): 55 | if prefix in self._data: 56 | return True 57 | 58 | if prefix.startswith(self._cachestr): 59 | lo, hi = self._cachepoints 60 | i = bisect_left(self._keys, prefix, lo, hi) 61 | else: 62 | i = bisect_left(self._keys, prefix) 63 | 64 | if i == len(self._keys): 65 | return False 66 | 67 | return self._keys[i].startswith(prefix) 68 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/lockfile/linklockfile.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import time 4 | import os 5 | 6 | from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, 7 | AlreadyLocked) 8 | 9 | class LinkLockFile(LockBase): 10 | """Lock access to a file using atomic property of link(2). 11 | 12 | >>> lock = LinkLockFile('somefile') 13 | >>> lock = LinkLockFile('somefile', threaded=False) 14 | """ 15 | 16 | def acquire(self, timeout=None): 17 | try: 18 | open(self.unique_name, "wb").close() 19 | except IOError: 20 | raise LockFailed("failed to create %s" % self.unique_name) 21 | 22 | timeout = timeout is not None and timeout or self.timeout 23 | end_time = time.time() 24 | if timeout is not None and timeout > 0: 25 | end_time += timeout 26 | 27 | while True: 28 | # Try and create a hard link to it. 29 | try: 30 | os.link(self.unique_name, self.lock_file) 31 | except OSError: 32 | # Link creation failed. Maybe we've double-locked? 33 | nlinks = os.stat(self.unique_name).st_nlink 34 | if nlinks == 2: 35 | # The original link plus the one I created == 2. We're 36 | # good to go. 37 | return 38 | else: 39 | # Otherwise the lock creation failed. 40 | if timeout is not None and time.time() > end_time: 41 | os.unlink(self.unique_name) 42 | if timeout > 0: 43 | raise LockTimeout("Timeout waiting to acquire" 44 | " lock for %s" % 45 | self.path) 46 | else: 47 | raise AlreadyLocked("%s is already locked" % 48 | self.path) 49 | time.sleep(timeout is not None and timeout/10 or 0.1) 50 | else: 51 | # Link creation succeeded. We're good to go. 52 | return 53 | 54 | def release(self): 55 | if not self.is_locked(): 56 | raise NotLocked("%s is not locked" % self.path) 57 | elif not os.path.exists(self.unique_name): 58 | raise NotMyLock("%s is locked, but not by me" % self.path) 59 | os.unlink(self.unique_name) 60 | os.unlink(self.lock_file) 61 | 62 | def is_locked(self): 63 | return os.path.exists(self.lock_file) 64 | 65 | def i_am_locking(self): 66 | return (self.is_locked() and 67 | os.path.exists(self.unique_name) and 68 | os.stat(self.unique_name).st_nlink == 2) 69 | 70 | def break_lock(self): 71 | if os.path.exists(self.lock_file): 72 | os.unlink(self.lock_file) 73 | 74 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/lockfile/symlinklockfile.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import time 4 | import os 5 | 6 | from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, 7 | AlreadyLocked) 8 | 9 | class SymlinkLockFile(LockBase): 10 | """Lock access to a file using symlink(2).""" 11 | 12 | def __init__(self, path, threaded=True, timeout=None): 13 | # super(SymlinkLockFile).__init(...) 14 | LockBase.__init__(self, path, threaded, timeout) 15 | # split it back! 16 | self.unique_name = os.path.split(self.unique_name)[1] 17 | 18 | def acquire(self, timeout=None): 19 | # Hopefully unnecessary for symlink. 20 | #try: 21 | # open(self.unique_name, "wb").close() 22 | #except IOError: 23 | # raise LockFailed("failed to create %s" % self.unique_name) 24 | timeout = timeout is not None and timeout or self.timeout 25 | end_time = time.time() 26 | if timeout is not None and timeout > 0: 27 | end_time += timeout 28 | 29 | while True: 30 | # Try and create a symbolic link to it. 31 | try: 32 | os.symlink(self.unique_name, self.lock_file) 33 | except OSError: 34 | # Link creation failed. Maybe we've double-locked? 35 | if self.i_am_locking(): 36 | # Linked to out unique name. Proceed. 37 | return 38 | else: 39 | # Otherwise the lock creation failed. 40 | if timeout is not None and time.time() > end_time: 41 | if timeout > 0: 42 | raise LockTimeout("Timeout waiting to acquire" 43 | " lock for %s" % 44 | self.path) 45 | else: 46 | raise AlreadyLocked("%s is already locked" % 47 | self.path) 48 | time.sleep(timeout/10 if timeout is not None else 0.1) 49 | else: 50 | # Link creation succeeded. We're good to go. 51 | return 52 | 53 | def release(self): 54 | if not self.is_locked(): 55 | raise NotLocked("%s is not locked" % self.path) 56 | elif not self.i_am_locking(): 57 | raise NotMyLock("%s is locked, but not by me" % self.path) 58 | os.unlink(self.lock_file) 59 | 60 | def is_locked(self): 61 | return os.path.islink(self.lock_file) 62 | 63 | def i_am_locking(self): 64 | return os.path.islink(self.lock_file) and \ 65 | os.readlink(self.lock_file) == self.unique_name 66 | 67 | def break_lock(self): 68 | if os.path.islink(self.lock_file): # exists && link 69 | os.unlink(self.lock_file) 70 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/packaging/__about__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | __all__ = [ 17 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 18 | "__email__", "__license__", "__copyright__", 19 | ] 20 | 21 | __title__ = "packaging" 22 | __summary__ = "Core utilities for Python packages" 23 | __uri__ = "https://github.com/pypa/packaging" 24 | 25 | __version__ = "15.3" 26 | 27 | __author__ = "Donald Stufft" 28 | __email__ = "donald@stufft.io" 29 | 30 | __license__ = "Apache License, Version 2.0" 31 | __copyright__ = "Copyright 2014 %s" % __author__ 32 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/packaging/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | from .__about__ import ( 17 | __author__, __copyright__, __email__, __license__, __summary__, __title__, 18 | __uri__, __version__ 19 | ) 20 | 21 | __all__ = [ 22 | "__title__", "__summary__", "__uri__", "__version__", "__author__", 23 | "__email__", "__license__", "__copyright__", 24 | ] 25 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/packaging/_compat.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | import sys 17 | 18 | 19 | PY2 = sys.version_info[0] == 2 20 | PY3 = sys.version_info[0] == 3 21 | 22 | # flake8: noqa 23 | 24 | if PY3: 25 | string_types = str, 26 | else: 27 | string_types = basestring, 28 | 29 | 30 | def with_metaclass(meta, *bases): 31 | """ 32 | Create a base class with a metaclass. 33 | """ 34 | # This requires a bit of explanation: the basic idea is to make a dummy 35 | # metaclass for one level of class instantiation that replaces itself with 36 | # the actual metaclass. 37 | class metaclass(meta): 38 | def __new__(cls, name, this_bases, d): 39 | return meta(name, bases, d) 40 | return type.__new__(metaclass, 'temporary_class', (), {}) 41 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/packaging/_structures.py: -------------------------------------------------------------------------------- 1 | # Copyright 2014 Donald Stufft 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | from __future__ import absolute_import, division, print_function 15 | 16 | 17 | class Infinity(object): 18 | 19 | def __repr__(self): 20 | return "Infinity" 21 | 22 | def __hash__(self): 23 | return hash(repr(self)) 24 | 25 | def __lt__(self, other): 26 | return False 27 | 28 | def __le__(self, other): 29 | return False 30 | 31 | def __eq__(self, other): 32 | return isinstance(other, self.__class__) 33 | 34 | def __ne__(self, other): 35 | return not isinstance(other, self.__class__) 36 | 37 | def __gt__(self, other): 38 | return True 39 | 40 | def __ge__(self, other): 41 | return True 42 | 43 | def __neg__(self): 44 | return NegativeInfinity 45 | 46 | Infinity = Infinity() 47 | 48 | 49 | class NegativeInfinity(object): 50 | 51 | def __repr__(self): 52 | return "-Infinity" 53 | 54 | def __hash__(self): 55 | return hash(repr(self)) 56 | 57 | def __lt__(self, other): 58 | return True 59 | 60 | def __le__(self, other): 61 | return True 62 | 63 | def __eq__(self, other): 64 | return isinstance(other, self.__class__) 65 | 66 | def __ne__(self, other): 67 | return not isinstance(other, self.__class__) 68 | 69 | def __gt__(self, other): 70 | return False 71 | 72 | def __ge__(self, other): 73 | return False 74 | 75 | def __neg__(self): 76 | return Infinity 77 | 78 | NegativeInfinity = NegativeInfinity() 79 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/progress/bar.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | 19 | 20 | from . import Progress 21 | from .helpers import WritelnMixin 22 | 23 | 24 | class Bar(WritelnMixin, Progress): 25 | width = 32 26 | message = '' 27 | suffix = '%(index)d/%(max)d' 28 | bar_prefix = ' |' 29 | bar_suffix = '| ' 30 | empty_fill = ' ' 31 | fill = '#' 32 | hide_cursor = True 33 | 34 | def update(self): 35 | filled_length = int(self.width * self.progress) 36 | empty_length = self.width - filled_length 37 | 38 | message = self.message % self 39 | bar = self.fill * filled_length 40 | empty = self.empty_fill * empty_length 41 | suffix = self.suffix % self 42 | line = ''.join([message, self.bar_prefix, bar, empty, self.bar_suffix, 43 | suffix]) 44 | self.writeln(line) 45 | 46 | 47 | class ChargingBar(Bar): 48 | suffix = '%(percent)d%%' 49 | bar_prefix = ' ' 50 | bar_suffix = ' ' 51 | empty_fill = '∙' 52 | fill = '█' 53 | 54 | 55 | class FillingSquaresBar(ChargingBar): 56 | empty_fill = '▢' 57 | fill = '▣' 58 | 59 | 60 | class FillingCirclesBar(ChargingBar): 61 | empty_fill = '◯' 62 | fill = '◉' 63 | 64 | 65 | class IncrementalBar(Bar): 66 | phases = (' ', '▏', '▎', '▍', '▌', '▋', '▊', '▉', '█') 67 | 68 | def update(self): 69 | nphases = len(self.phases) 70 | expanded_length = int(nphases * self.width * self.progress) 71 | filled_length = int(self.width * self.progress) 72 | empty_length = self.width - filled_length 73 | phase = expanded_length - (filled_length * nphases) 74 | 75 | message = self.message % self 76 | bar = self.phases[-1] * filled_length 77 | current = self.phases[phase] if phase > 0 else '' 78 | empty = self.empty_fill * max(0, empty_length - len(current)) 79 | suffix = self.suffix % self 80 | line = ''.join([message, self.bar_prefix, bar, current, empty, 81 | self.bar_suffix, suffix]) 82 | self.writeln(line) 83 | 84 | 85 | class ShadyBar(IncrementalBar): 86 | phases = (' ', '░', '▒', '▓', '█') 87 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/progress/counter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | 19 | from . import Infinite, Progress 20 | from .helpers import WriteMixin 21 | 22 | 23 | class Counter(WriteMixin, Infinite): 24 | message = '' 25 | hide_cursor = True 26 | 27 | def update(self): 28 | self.write(str(self.index)) 29 | 30 | 31 | class Countdown(WriteMixin, Progress): 32 | hide_cursor = True 33 | 34 | def update(self): 35 | self.write(str(self.remaining)) 36 | 37 | 38 | class Stack(WriteMixin, Progress): 39 | phases = (' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') 40 | hide_cursor = True 41 | 42 | def update(self): 43 | nphases = len(self.phases) 44 | i = min(nphases - 1, int(self.progress * nphases)) 45 | self.write(self.phases[i]) 46 | 47 | 48 | class Pie(Stack): 49 | phases = ('○', '◔', '◑', '◕', '●') 50 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/progress/spinner.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Copyright (c) 2012 Giorgos Verigakis 4 | # 5 | # Permission to use, copy, modify, and distribute this software for any 6 | # purpose with or without fee is hereby granted, provided that the above 7 | # copyright notice and this permission notice appear in all copies. 8 | # 9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | 17 | from __future__ import unicode_literals 18 | 19 | from . import Infinite 20 | from .helpers import WriteMixin 21 | 22 | 23 | class Spinner(WriteMixin, Infinite): 24 | message = '' 25 | phases = ('-', '\\', '|', '/') 26 | hide_cursor = True 27 | 28 | def update(self): 29 | i = self.index % len(self.phases) 30 | self.write(self.phases[i]) 31 | 32 | 33 | class PieSpinner(Spinner): 34 | phases = ['◷', '◶', '◵', '◴'] 35 | 36 | 37 | class MoonSpinner(Spinner): 38 | phases = ['◑', '◒', '◐', '◓'] 39 | 40 | 41 | class LineSpinner(Spinner): 42 | phases = ['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'] 43 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/re-vendor.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import pip 4 | import glob 5 | import shutil 6 | 7 | here = os.path.abspath(os.path.dirname(__file__)) 8 | 9 | def usage(): 10 | print("Usage: re-vendor.py [clean|vendor]") 11 | sys.exit(1) 12 | 13 | def clean(): 14 | for fn in os.listdir(here): 15 | dirname = os.path.join(here, fn) 16 | if os.path.isdir(dirname): 17 | shutil.rmtree(dirname) 18 | # six is a single file, not a package 19 | os.unlink(os.path.join(here, 'six.py')) 20 | 21 | def vendor(): 22 | pip.main(['install', '-t', here, '-r', 'vendor.txt']) 23 | for dirname in glob.glob('*.egg-info'): 24 | shutil.rmtree(dirname) 25 | 26 | if __name__ == '__main__': 27 | if len(sys.argv) != 2: 28 | usage() 29 | if sys.argv[1] == 'clean': 30 | clean() 31 | elif sys.argv[1] == 'vendor': 32 | vendor() 33 | else: 34 | usage() 35 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # __ 4 | # /__) _ _ _ _ _/ _ 5 | # / ( (- (/ (/ (- _) / _) 6 | # / 7 | 8 | """ 9 | requests HTTP library 10 | ~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | Requests is an HTTP library, written in Python, for human beings. Basic GET 13 | usage: 14 | 15 | >>> import requests 16 | >>> r = requests.get('https://www.python.org') 17 | >>> r.status_code 18 | 200 19 | >>> 'Python is a programming language' in r.content 20 | True 21 | 22 | ... or POST: 23 | 24 | >>> payload = dict(key1='value1', key2='value2') 25 | >>> r = requests.post('http://httpbin.org/post', data=payload) 26 | >>> print(r.text) 27 | { 28 | ... 29 | "form": { 30 | "key2": "value2", 31 | "key1": "value1" 32 | }, 33 | ... 34 | } 35 | 36 | The other HTTP methods are supported - see `requests.api`. Full documentation 37 | is at . 38 | 39 | :copyright: (c) 2015 by Kenneth Reitz. 40 | :license: Apache 2.0, see LICENSE for more details. 41 | 42 | """ 43 | 44 | __title__ = 'requests' 45 | __version__ = '2.7.0' 46 | __build__ = 0x020700 47 | __author__ = 'Kenneth Reitz' 48 | __license__ = 'Apache 2.0' 49 | __copyright__ = 'Copyright 2015 Kenneth Reitz' 50 | 51 | # Attempt to enable urllib3's SNI support, if possible 52 | try: 53 | from .packages.urllib3.contrib import pyopenssl 54 | pyopenssl.inject_into_urllib3() 55 | except ImportError: 56 | pass 57 | 58 | from . import utils 59 | from .models import Request, Response, PreparedRequest 60 | from .api import request, get, head, post, patch, put, delete, options 61 | from .sessions import session, Session 62 | from .status_codes import codes 63 | from .exceptions import ( 64 | RequestException, Timeout, URLRequired, 65 | TooManyRedirects, HTTPError, ConnectionError 66 | ) 67 | 68 | # Set default logging handler to avoid "No handler found" warnings. 69 | import logging 70 | try: # Python 2.7+ 71 | from logging import NullHandler 72 | except ImportError: 73 | class NullHandler(logging.Handler): 74 | def emit(self, record): 75 | pass 76 | 77 | logging.getLogger(__name__).addHandler(NullHandler()) 78 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certs.py 6 | ~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | import os.path 15 | 16 | try: 17 | from certifi import where 18 | except ImportError: 19 | def where(): 20 | """Return the preferred certificate bundle.""" 21 | # vendored bundle inside Requests 22 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 23 | 24 | if __name__ == '__main__': 25 | print(where()) 26 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | pythoncompat 5 | """ 6 | 7 | from .packages import chardet 8 | 9 | import sys 10 | 11 | # ------- 12 | # Pythons 13 | # ------- 14 | 15 | # Syntax sugar. 16 | _ver = sys.version_info 17 | 18 | #: Python 2.x? 19 | is_py2 = (_ver[0] == 2) 20 | 21 | #: Python 3.x? 22 | is_py3 = (_ver[0] == 3) 23 | 24 | try: 25 | import simplejson as json 26 | except (ImportError, SyntaxError): 27 | # simplejson does not support Python 3.2, it throws a SyntaxError 28 | # because of u'...' Unicode literals. 29 | import json 30 | 31 | # --------- 32 | # Specifics 33 | # --------- 34 | 35 | if is_py2: 36 | from urllib import quote, unquote, quote_plus, unquote_plus, urlencode, getproxies, proxy_bypass 37 | from urlparse import urlparse, urlunparse, urljoin, urlsplit, urldefrag 38 | from urllib2 import parse_http_list 39 | import cookielib 40 | from Cookie import Morsel 41 | from StringIO import StringIO 42 | from .packages.urllib3.packages.ordered_dict import OrderedDict 43 | 44 | builtin_str = str 45 | bytes = str 46 | str = unicode 47 | basestring = basestring 48 | numeric_types = (int, long, float) 49 | 50 | elif is_py3: 51 | from urllib.parse import urlparse, urlunparse, urljoin, urlsplit, urlencode, quote, unquote, quote_plus, unquote_plus, urldefrag 52 | from urllib.request import parse_http_list, getproxies, proxy_bypass 53 | from http import cookiejar as cookielib 54 | from http.cookies import Morsel 55 | from io import StringIO 56 | from collections import OrderedDict 57 | 58 | builtin_str = str 59 | str = str 60 | bytes = bytes 61 | basestring = (str, bytes) 62 | numeric_types = (int, float) 63 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.exceptions 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | This module contains the set of Requests' exceptions. 8 | 9 | """ 10 | from .packages.urllib3.exceptions import HTTPError as BaseHTTPError 11 | 12 | 13 | class RequestException(IOError): 14 | """There was an ambiguous exception that occurred while handling your 15 | request.""" 16 | 17 | def __init__(self, *args, **kwargs): 18 | """ 19 | Initialize RequestException with `request` and `response` objects. 20 | """ 21 | response = kwargs.pop('response', None) 22 | self.response = response 23 | self.request = kwargs.pop('request', None) 24 | if (response is not None and not self.request and 25 | hasattr(response, 'request')): 26 | self.request = self.response.request 27 | super(RequestException, self).__init__(*args, **kwargs) 28 | 29 | 30 | class HTTPError(RequestException): 31 | """An HTTP error occurred.""" 32 | 33 | 34 | class ConnectionError(RequestException): 35 | """A Connection error occurred.""" 36 | 37 | 38 | class ProxyError(ConnectionError): 39 | """A proxy error occurred.""" 40 | 41 | 42 | class SSLError(ConnectionError): 43 | """An SSL error occurred.""" 44 | 45 | 46 | class Timeout(RequestException): 47 | """The request timed out. 48 | 49 | Catching this error will catch both 50 | :exc:`~requests.exceptions.ConnectTimeout` and 51 | :exc:`~requests.exceptions.ReadTimeout` errors. 52 | """ 53 | 54 | 55 | class ConnectTimeout(ConnectionError, Timeout): 56 | """The request timed out while trying to connect to the remote server. 57 | 58 | Requests that produced this error are safe to retry. 59 | """ 60 | 61 | 62 | class ReadTimeout(Timeout): 63 | """The server did not send any data in the allotted amount of time.""" 64 | 65 | 66 | class URLRequired(RequestException): 67 | """A valid URL is required to make a request.""" 68 | 69 | 70 | class TooManyRedirects(RequestException): 71 | """Too many redirects.""" 72 | 73 | 74 | class MissingSchema(RequestException, ValueError): 75 | """The URL schema (e.g. http or https) is missing.""" 76 | 77 | 78 | class InvalidSchema(RequestException, ValueError): 79 | """See defaults.py for valid schemas.""" 80 | 81 | 82 | class InvalidURL(RequestException, ValueError): 83 | """ The URL provided was somehow invalid. """ 84 | 85 | 86 | class ChunkedEncodingError(RequestException): 87 | """The server declared chunked encoding but sent an invalid chunk.""" 88 | 89 | 90 | class ContentDecodingError(RequestException, BaseHTTPError): 91 | """Failed to decode response content""" 92 | 93 | 94 | class StreamConsumedError(RequestException, TypeError): 95 | """The content for this response was already consumed""" 96 | 97 | 98 | class RetryError(RequestException): 99 | """Custom retries logic failed""" 100 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | 14 | """ 15 | 16 | 17 | HOOKS = ['response'] 18 | 19 | 20 | def default_hooks(): 21 | hooks = {} 22 | for event in HOOKS: 23 | hooks[event] = [] 24 | return hooks 25 | 26 | # TODO: response is the only one 27 | 28 | 29 | def dispatch_hook(key, hooks, hook_data, **kwargs): 30 | """Dispatches a hook dictionary on a given piece of data.""" 31 | 32 | hooks = hooks or dict() 33 | 34 | if key in hooks: 35 | hooks = hooks.get(key) 36 | 37 | if hasattr(hooks, '__call__'): 38 | hooks = [hooks] 39 | 40 | for hook in hooks: 41 | _hook_data = hook(hook_data, **kwargs) 42 | if _hook_data is not None: 43 | hook_data = _hook_data 44 | 45 | return hook_data 46 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import urllib3 4 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "2.3.0" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import Big5SMModel 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(Big5SMModel) 38 | self._mDistributionAnalyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "Big5" 43 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/chardetect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Script which takes one or more file paths and reports on their detected 4 | encodings 5 | 6 | Example:: 7 | 8 | % chardetect somefile someotherfile 9 | somefile: windows-1252 with confidence 0.5 10 | someotherfile: ascii with confidence 1.0 11 | 12 | If no paths are provided, it takes its input from stdin. 13 | 14 | """ 15 | 16 | from __future__ import absolute_import, print_function, unicode_literals 17 | 18 | import argparse 19 | import sys 20 | from io import open 21 | 22 | from chardet import __version__ 23 | from chardet.universaldetector import UniversalDetector 24 | 25 | 26 | def description_of(lines, name='stdin'): 27 | """ 28 | Return a string describing the probable encoding of a file or 29 | list of strings. 30 | 31 | :param lines: The lines to get the encoding of. 32 | :type lines: Iterable of bytes 33 | :param name: Name of file or collection of lines 34 | :type name: str 35 | """ 36 | u = UniversalDetector() 37 | for line in lines: 38 | u.feed(line) 39 | u.close() 40 | result = u.result 41 | if result['encoding']: 42 | return '{0}: {1} with confidence {2}'.format(name, result['encoding'], 43 | result['confidence']) 44 | else: 45 | return '{0}: no result'.format(name) 46 | 47 | 48 | def main(argv=None): 49 | ''' 50 | Handles command line arguments and gets things started. 51 | 52 | :param argv: List of arguments, as if specified on the command-line. 53 | If None, ``sys.argv[1:]`` is used instead. 54 | :type argv: list of str 55 | ''' 56 | # Get command line arguments 57 | parser = argparse.ArgumentParser( 58 | description="Takes one or more file paths and reports their detected \ 59 | encodings", 60 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, 61 | conflict_handler='resolve') 62 | parser.add_argument('input', 63 | help='File whose encoding we would like to determine.', 64 | type=argparse.FileType('rb'), nargs='*', 65 | default=[sys.stdin]) 66 | parser.add_argument('--version', action='version', 67 | version='%(prog)s {0}'.format(__version__)) 68 | args = parser.parse_args(argv) 69 | 70 | for f in args.input: 71 | if f.isatty(): 72 | print("You are running chardetect interactively. Press " + 73 | "CTRL-D twice at the start of a blank line to signal the " + 74 | "end of your input. If you want help, run chardetect " + 75 | "--help\n", file=sys.stderr) 76 | print(description_of(f, f.name)) 77 | 78 | 79 | if __name__ == '__main__': 80 | main() 81 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/charsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from . import constants 30 | import re 31 | 32 | 33 | class CharSetProber: 34 | def __init__(self): 35 | pass 36 | 37 | def reset(self): 38 | self._mState = constants.eDetecting 39 | 40 | def get_charset_name(self): 41 | return None 42 | 43 | def feed(self, aBuf): 44 | pass 45 | 46 | def get_state(self): 47 | return self._mState 48 | 49 | def get_confidence(self): 50 | return 0.0 51 | 52 | def filter_high_bit_only(self, aBuf): 53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf) 54 | return aBuf 55 | 56 | def filter_without_english_letters(self, aBuf): 57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf) 58 | return aBuf 59 | 60 | def filter_with_english_letters(self, aBuf): 61 | # TODO 62 | return aBuf 63 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/codingstatemachine.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .constants import eStart 29 | from .compat import wrap_ord 30 | 31 | 32 | class CodingStateMachine: 33 | def __init__(self, sm): 34 | self._mModel = sm 35 | self._mCurrentBytePos = 0 36 | self._mCurrentCharLen = 0 37 | self.reset() 38 | 39 | def reset(self): 40 | self._mCurrentState = eStart 41 | 42 | def next_state(self, c): 43 | # for each byte we get its class 44 | # if it is first byte, we also get byte length 45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte 46 | byteCls = self._mModel['classTable'][wrap_ord(c)] 47 | if self._mCurrentState == eStart: 48 | self._mCurrentBytePos = 0 49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls] 50 | # from byte's class and stateTable, we get its next state 51 | curr_state = (self._mCurrentState * self._mModel['classFactor'] 52 | + byteCls) 53 | self._mCurrentState = self._mModel['stateTable'][curr_state] 54 | self._mCurrentBytePos += 1 55 | return self._mCurrentState 56 | 57 | def get_current_charlen(self): 58 | return self._mCurrentCharLen 59 | 60 | def get_coding_state_machine(self): 61 | return self._mModel['name'] 62 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/compat.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # Contributor(s): 3 | # Ian Cordasco - port to Python 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | # 02110-1301 USA 19 | ######################### END LICENSE BLOCK ######################### 20 | 21 | import sys 22 | 23 | 24 | if sys.version_info < (3, 0): 25 | base_str = (str, unicode) 26 | else: 27 | base_str = (bytes, str) 28 | 29 | 30 | def wrap_ord(a): 31 | if sys.version_info < (3, 0) and isinstance(a, base_str): 32 | return ord(a) 33 | else: 34 | return a 35 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import CP949SMModel 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(CP949SMModel) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | def get_charset_name(self): 44 | return "CP949" 45 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKRSMModel 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel) 38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "EUC-KR" 43 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTWSMModel 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel) 37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "EUC-TW" 42 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312SMModel 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(GB2312SMModel) 37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "GB2312" 42 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self): 43 | CharSetGroupProber.__init__(self) 44 | self._mProbers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/chardet/utf8prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from . import constants 29 | from .charsetprober import CharSetProber 30 | from .codingstatemachine import CodingStateMachine 31 | from .mbcssm import UTF8SMModel 32 | 33 | ONE_CHAR_PROB = 0.5 34 | 35 | 36 | class UTF8Prober(CharSetProber): 37 | def __init__(self): 38 | CharSetProber.__init__(self) 39 | self._mCodingSM = CodingStateMachine(UTF8SMModel) 40 | self.reset() 41 | 42 | def reset(self): 43 | CharSetProber.reset(self) 44 | self._mCodingSM.reset() 45 | self._mNumOfMBChar = 0 46 | 47 | def get_charset_name(self): 48 | return "utf-8" 49 | 50 | def feed(self, aBuf): 51 | for c in aBuf: 52 | codingState = self._mCodingSM.next_state(c) 53 | if codingState == constants.eError: 54 | self._mState = constants.eNotMe 55 | break 56 | elif codingState == constants.eItsMe: 57 | self._mState = constants.eFoundIt 58 | break 59 | elif codingState == constants.eStart: 60 | if self._mCodingSM.get_current_charlen() >= 2: 61 | self._mNumOfMBChar += 1 62 | 63 | if self.get_state() == constants.eDetecting: 64 | if self.get_confidence() > constants.SHORTCUT_THRESHOLD: 65 | self._mState = constants.eFoundIt 66 | 67 | return self.get_state() 68 | 69 | def get_confidence(self): 70 | unlike = 0.99 71 | if self._mNumOfMBChar < 6: 72 | for i in range(0, self._mNumOfMBChar): 73 | unlike = unlike * ONE_CHAR_PROB 74 | return 1.0 - unlike 75 | else: 76 | return unlike 77 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | urllib3 - Thread-safe connection pooling and re-using. 3 | """ 4 | 5 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' 6 | __license__ = 'MIT' 7 | __version__ = '1.10.4' 8 | 9 | 10 | from .connectionpool import ( 11 | HTTPConnectionPool, 12 | HTTPSConnectionPool, 13 | connection_from_url 14 | ) 15 | 16 | from . import exceptions 17 | from .filepost import encode_multipart_formdata 18 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url 19 | from .response import HTTPResponse 20 | from .util.request import make_headers 21 | from .util.url import get_host 22 | from .util.timeout import Timeout 23 | from .util.retry import Retry 24 | 25 | 26 | # Set default logging handler to avoid "No handler found" warnings. 27 | import logging 28 | try: # Python 2.7+ 29 | from logging import NullHandler 30 | except ImportError: 31 | class NullHandler(logging.Handler): 32 | def emit(self, record): 33 | pass 34 | 35 | logging.getLogger(__name__).addHandler(NullHandler()) 36 | 37 | def add_stderr_logger(level=logging.DEBUG): 38 | """ 39 | Helper for quickly adding a StreamHandler to the logger. Useful for 40 | debugging. 41 | 42 | Returns the handler after adding it. 43 | """ 44 | # This method needs to be in this __init__.py to get the __name__ correct 45 | # even if urllib3 is vendored within another package. 46 | logger = logging.getLogger(__name__) 47 | handler = logging.StreamHandler() 48 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) 49 | logger.addHandler(handler) 50 | logger.setLevel(level) 51 | logger.debug('Added a stderr logging handler to logger: %s' % __name__) 52 | return handler 53 | 54 | # ... Clean up. 55 | del NullHandler 56 | 57 | 58 | import warnings 59 | # SecurityWarning's always go off by default. 60 | warnings.simplefilter('always', exceptions.SecurityWarning, append=True) 61 | # InsecurePlatformWarning's don't vary between requests, so we keep it default. 62 | warnings.simplefilter('default', exceptions.InsecurePlatformWarning, 63 | append=True) 64 | 65 | def disable_warnings(category=exceptions.HTTPWarning): 66 | """ 67 | Helper for quickly disabling all urllib3 warnings. 68 | """ 69 | warnings.simplefilter('ignore', category) 70 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/_vendor/requests/packages/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/filepost.py: -------------------------------------------------------------------------------- 1 | import codecs 2 | 3 | from uuid import uuid4 4 | from io import BytesIO 5 | 6 | from .packages import six 7 | from .packages.six import b 8 | from .fields import RequestField 9 | 10 | writer = codecs.lookup('utf-8')[3] 11 | 12 | 13 | def choose_boundary(): 14 | """ 15 | Our embarassingly-simple replacement for mimetools.choose_boundary. 16 | """ 17 | return uuid4().hex 18 | 19 | 20 | def iter_field_objects(fields): 21 | """ 22 | Iterate over fields. 23 | 24 | Supports list of (k, v) tuples and dicts, and lists of 25 | :class:`~urllib3.fields.RequestField`. 26 | 27 | """ 28 | if isinstance(fields, dict): 29 | i = six.iteritems(fields) 30 | else: 31 | i = iter(fields) 32 | 33 | for field in i: 34 | if isinstance(field, RequestField): 35 | yield field 36 | else: 37 | yield RequestField.from_tuples(*field) 38 | 39 | 40 | def iter_fields(fields): 41 | """ 42 | .. deprecated:: 1.6 43 | 44 | Iterate over fields. 45 | 46 | The addition of :class:`~urllib3.fields.RequestField` makes this function 47 | obsolete. Instead, use :func:`iter_field_objects`, which returns 48 | :class:`~urllib3.fields.RequestField` objects. 49 | 50 | Supports list of (k, v) tuples and dicts. 51 | """ 52 | if isinstance(fields, dict): 53 | return ((k, v) for k, v in six.iteritems(fields)) 54 | 55 | return ((k, v) for k, v in fields) 56 | 57 | 58 | def encode_multipart_formdata(fields, boundary=None): 59 | """ 60 | Encode a dictionary of ``fields`` using the multipart/form-data MIME format. 61 | 62 | :param fields: 63 | Dictionary of fields or list of (key, :class:`~urllib3.fields.RequestField`). 64 | 65 | :param boundary: 66 | If not specified, then a random boundary will be generated using 67 | :func:`mimetools.choose_boundary`. 68 | """ 69 | body = BytesIO() 70 | if boundary is None: 71 | boundary = choose_boundary() 72 | 73 | for field in iter_field_objects(fields): 74 | body.write(b('--%s\r\n' % (boundary))) 75 | 76 | writer(body).write(field.render_headers()) 77 | data = field.data 78 | 79 | if isinstance(data, int): 80 | data = str(data) # Backwards compatibility 81 | 82 | if isinstance(data, six.text_type): 83 | writer(body).write(data) 84 | else: 85 | body.write(data) 86 | 87 | body.write(b'\r\n') 88 | 89 | body.write(b('--%s--\r\n' % (boundary))) 90 | 91 | content_type = str('multipart/form-data; boundary=%s' % boundary) 92 | 93 | return body.getvalue(), content_type 94 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from ._implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/util/__init__.py: -------------------------------------------------------------------------------- 1 | # For backwards compatibility, provide imports that used to be here. 2 | from .connection import is_connection_dropped 3 | from .request import make_headers 4 | from .response import is_fp_closed 5 | from .ssl_ import ( 6 | SSLContext, 7 | HAS_SNI, 8 | assert_fingerprint, 9 | resolve_cert_reqs, 10 | resolve_ssl_version, 11 | ssl_wrap_socket, 12 | ) 13 | from .timeout import ( 14 | current_time, 15 | Timeout, 16 | ) 17 | 18 | from .retry import Retry 19 | from .url import ( 20 | get_host, 21 | parse_url, 22 | split_first, 23 | Url, 24 | ) 25 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/util/request.py: -------------------------------------------------------------------------------- 1 | from base64 import b64encode 2 | 3 | from ..packages.six import b 4 | 5 | ACCEPT_ENCODING = 'gzip,deflate' 6 | 7 | 8 | def make_headers(keep_alive=None, accept_encoding=None, user_agent=None, 9 | basic_auth=None, proxy_basic_auth=None, disable_cache=None): 10 | """ 11 | Shortcuts for generating request headers. 12 | 13 | :param keep_alive: 14 | If ``True``, adds 'connection: keep-alive' header. 15 | 16 | :param accept_encoding: 17 | Can be a boolean, list, or string. 18 | ``True`` translates to 'gzip,deflate'. 19 | List will get joined by comma. 20 | String will be used as provided. 21 | 22 | :param user_agent: 23 | String representing the user-agent you want, such as 24 | "python-urllib3/0.6" 25 | 26 | :param basic_auth: 27 | Colon-separated username:password string for 'authorization: basic ...' 28 | auth header. 29 | 30 | :param proxy_basic_auth: 31 | Colon-separated username:password string for 'proxy-authorization: basic ...' 32 | auth header. 33 | 34 | :param disable_cache: 35 | If ``True``, adds 'cache-control: no-cache' header. 36 | 37 | Example:: 38 | 39 | >>> make_headers(keep_alive=True, user_agent="Batman/1.0") 40 | {'connection': 'keep-alive', 'user-agent': 'Batman/1.0'} 41 | >>> make_headers(accept_encoding=True) 42 | {'accept-encoding': 'gzip,deflate'} 43 | """ 44 | headers = {} 45 | if accept_encoding: 46 | if isinstance(accept_encoding, str): 47 | pass 48 | elif isinstance(accept_encoding, list): 49 | accept_encoding = ','.join(accept_encoding) 50 | else: 51 | accept_encoding = ACCEPT_ENCODING 52 | headers['accept-encoding'] = accept_encoding 53 | 54 | if user_agent: 55 | headers['user-agent'] = user_agent 56 | 57 | if keep_alive: 58 | headers['connection'] = 'keep-alive' 59 | 60 | if basic_auth: 61 | headers['authorization'] = 'Basic ' + \ 62 | b64encode(b(basic_auth)).decode('utf-8') 63 | 64 | if proxy_basic_auth: 65 | headers['proxy-authorization'] = 'Basic ' + \ 66 | b64encode(b(proxy_basic_auth)).decode('utf-8') 67 | 68 | if disable_cache: 69 | headers['cache-control'] = 'no-cache' 70 | 71 | return headers 72 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/requests/packages/urllib3/util/response.py: -------------------------------------------------------------------------------- 1 | def is_fp_closed(obj): 2 | """ 3 | Checks whether a given file-like object is closed. 4 | 5 | :param obj: 6 | The file-like object to check. 7 | """ 8 | 9 | try: 10 | # Check via the official file-like-object way. 11 | return obj.closed 12 | except AttributeError: 13 | pass 14 | 15 | try: 16 | # Check if the object is a container for another file-like object that 17 | # gets released on exhaustion (e.g. HTTPResponse). 18 | return obj.fp is None 19 | except AttributeError: 20 | pass 21 | 22 | raise ValueError("Unable to determine whether fp is closed.") 23 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/_vendor/vendor.txt: -------------------------------------------------------------------------------- 1 | distlib==0.2.1 2 | html5lib==1.0b5 3 | six==1.9.0 4 | colorama==0.3.3 5 | requests==2.7.0 6 | CacheControl==0.11.5 7 | lockfile==0.10.2 8 | progress==1.2 9 | ipaddress==1.0.14 # Only needed on 2.6, 2.7, and 3.2 10 | packaging==15.3 11 | retrying==1.3.3 12 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/commands/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Package containing all pip commands 3 | """ 4 | from __future__ import absolute_import 5 | 6 | from pip.commands.completion import CompletionCommand 7 | from pip.commands.freeze import FreezeCommand 8 | from pip.commands.help import HelpCommand 9 | from pip.commands.list import ListCommand 10 | from pip.commands.search import SearchCommand 11 | from pip.commands.show import ShowCommand 12 | from pip.commands.install import InstallCommand 13 | from pip.commands.uninstall import UninstallCommand 14 | from pip.commands.wheel import WheelCommand 15 | 16 | 17 | commands_dict = { 18 | CompletionCommand.name: CompletionCommand, 19 | FreezeCommand.name: FreezeCommand, 20 | HelpCommand.name: HelpCommand, 21 | SearchCommand.name: SearchCommand, 22 | ShowCommand.name: ShowCommand, 23 | InstallCommand.name: InstallCommand, 24 | UninstallCommand.name: UninstallCommand, 25 | ListCommand.name: ListCommand, 26 | WheelCommand.name: WheelCommand, 27 | } 28 | 29 | 30 | commands_order = [ 31 | InstallCommand, 32 | UninstallCommand, 33 | FreezeCommand, 34 | ListCommand, 35 | ShowCommand, 36 | SearchCommand, 37 | WheelCommand, 38 | HelpCommand, 39 | ] 40 | 41 | 42 | def get_summaries(ignore_hidden=True, ordered=True): 43 | """Yields sorted (command name, command summary) tuples.""" 44 | 45 | if ordered: 46 | cmditems = _sort_commands(commands_dict, commands_order) 47 | else: 48 | cmditems = commands_dict.items() 49 | 50 | for name, command_class in cmditems: 51 | if ignore_hidden and command_class.hidden: 52 | continue 53 | 54 | yield (name, command_class.summary) 55 | 56 | 57 | def get_similar_commands(name): 58 | """Command name auto-correct.""" 59 | from difflib import get_close_matches 60 | 61 | name = name.lower() 62 | 63 | close_commands = get_close_matches(name, commands_dict.keys()) 64 | 65 | if close_commands: 66 | return close_commands[0] 67 | else: 68 | return False 69 | 70 | 71 | def _sort_commands(cmddict, order): 72 | def keyfn(key): 73 | try: 74 | return order.index(key[1]) 75 | except ValueError: 76 | # unordered items should come last 77 | return 0xff 78 | 79 | return sorted(cmddict.items(), key=keyfn) 80 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/commands/completion.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import sys 4 | from pip.basecommand import Command 5 | 6 | BASE_COMPLETION = """ 7 | # pip %(shell)s completion start%(script)s# pip %(shell)s completion end 8 | """ 9 | 10 | COMPLETION_SCRIPTS = { 11 | 'bash': """ 12 | _pip_completion() 13 | { 14 | COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\ 15 | COMP_CWORD=$COMP_CWORD \\ 16 | PIP_AUTO_COMPLETE=1 $1 ) ) 17 | } 18 | complete -o default -F _pip_completion pip 19 | """, 'zsh': """ 20 | function _pip_completion { 21 | local words cword 22 | read -Ac words 23 | read -cn cword 24 | reply=( $( COMP_WORDS="$words[*]" \\ 25 | COMP_CWORD=$(( cword-1 )) \\ 26 | PIP_AUTO_COMPLETE=1 $words[1] ) ) 27 | } 28 | compctl -K _pip_completion pip 29 | """} 30 | 31 | 32 | class CompletionCommand(Command): 33 | """A helper command to be used for command completion.""" 34 | name = 'completion' 35 | summary = 'A helper command to be used for command completion' 36 | hidden = True 37 | 38 | def __init__(self, *args, **kw): 39 | super(CompletionCommand, self).__init__(*args, **kw) 40 | 41 | cmd_opts = self.cmd_opts 42 | 43 | cmd_opts.add_option( 44 | '--bash', '-b', 45 | action='store_const', 46 | const='bash', 47 | dest='shell', 48 | help='Emit completion code for bash') 49 | cmd_opts.add_option( 50 | '--zsh', '-z', 51 | action='store_const', 52 | const='zsh', 53 | dest='shell', 54 | help='Emit completion code for zsh') 55 | 56 | self.parser.insert_option_group(0, cmd_opts) 57 | 58 | def run(self, options, args): 59 | """Prints the completion code of the given shell""" 60 | shells = COMPLETION_SCRIPTS.keys() 61 | shell_options = ['--' + shell for shell in sorted(shells)] 62 | if options.shell in shells: 63 | script = COMPLETION_SCRIPTS.get(options.shell, '') 64 | print(BASE_COMPLETION % {'script': script, 'shell': options.shell}) 65 | else: 66 | sys.stderr.write( 67 | 'ERROR: You must pass %s\n' % ' or '.join(shell_options) 68 | ) 69 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/commands/freeze.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import sys 4 | 5 | import pip 6 | from pip.basecommand import Command 7 | from pip.operations.freeze import freeze 8 | from pip.wheel import WheelCache 9 | 10 | 11 | class FreezeCommand(Command): 12 | """ 13 | Output installed packages in requirements format. 14 | 15 | packages are listed in a case-insensitive sorted order. 16 | """ 17 | name = 'freeze' 18 | usage = """ 19 | %prog [options]""" 20 | summary = 'Output installed packages in requirements format.' 21 | log_streams = ("ext://sys.stderr", "ext://sys.stderr") 22 | 23 | def __init__(self, *args, **kw): 24 | super(FreezeCommand, self).__init__(*args, **kw) 25 | 26 | self.cmd_opts.add_option( 27 | '-r', '--requirement', 28 | dest='requirement', 29 | action='store', 30 | default=None, 31 | metavar='file', 32 | help="Use the order in the given requirements file and its " 33 | "comments when generating output.") 34 | self.cmd_opts.add_option( 35 | '-f', '--find-links', 36 | dest='find_links', 37 | action='append', 38 | default=[], 39 | metavar='URL', 40 | help='URL for finding packages, which will be added to the ' 41 | 'output.') 42 | self.cmd_opts.add_option( 43 | '-l', '--local', 44 | dest='local', 45 | action='store_true', 46 | default=False, 47 | help='If in a virtualenv that has global access, do not output ' 48 | 'globally-installed packages.') 49 | self.cmd_opts.add_option( 50 | '--user', 51 | dest='user', 52 | action='store_true', 53 | default=False, 54 | help='Only output packages installed in user-site.') 55 | 56 | self.parser.insert_option_group(0, self.cmd_opts) 57 | 58 | def run(self, options, args): 59 | format_control = pip.index.FormatControl(set(), set()) 60 | wheel_cache = WheelCache(options.cache_dir, format_control) 61 | freeze_kwargs = dict( 62 | requirement=options.requirement, 63 | find_links=options.find_links, 64 | local_only=options.local, 65 | user_only=options.user, 66 | skip_regex=options.skip_requirements_regex, 67 | isolated=options.isolated_mode, 68 | wheel_cache=wheel_cache) 69 | 70 | for line in freeze(**freeze_kwargs): 71 | sys.stdout.write(line + '\n') 72 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/commands/help.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from pip.basecommand import Command, SUCCESS 4 | from pip.exceptions import CommandError 5 | 6 | 7 | class HelpCommand(Command): 8 | """Show help for commands""" 9 | name = 'help' 10 | usage = """ 11 | %prog """ 12 | summary = 'Show help for commands.' 13 | 14 | def run(self, options, args): 15 | from pip.commands import commands_dict, get_similar_commands 16 | 17 | try: 18 | # 'pip help' with no args is handled by pip.__init__.parseopt() 19 | cmd_name = args[0] # the command we need help for 20 | except IndexError: 21 | return SUCCESS 22 | 23 | if cmd_name not in commands_dict: 24 | guess = get_similar_commands(cmd_name) 25 | 26 | msg = ['unknown command "%s"' % cmd_name] 27 | if guess: 28 | msg.append('maybe you meant "%s"' % guess) 29 | 30 | raise CommandError(' - '.join(msg)) 31 | 32 | command = commands_dict[cmd_name]() 33 | command.parser.print_help() 34 | 35 | return SUCCESS 36 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/exceptions.py: -------------------------------------------------------------------------------- 1 | """Exceptions used throughout package""" 2 | from __future__ import absolute_import 3 | 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 RequirementsFileParseError(InstallationError): 22 | """Raised when a general error occurs parsing a requirements file line.""" 23 | 24 | 25 | class BestVersionAlreadyInstalled(PipError): 26 | """Raised when the most up-to-date version of a package is already 27 | installed.""" 28 | 29 | 30 | class BadCommand(PipError): 31 | """Raised when virtualenv or a command is not found""" 32 | 33 | 34 | class CommandError(PipError): 35 | """Raised when there is an error in command-line arguments""" 36 | 37 | 38 | class PreviousBuildDirError(PipError): 39 | """Raised when there's a previous conflicting build directory""" 40 | 41 | 42 | class HashMismatch(InstallationError): 43 | """Distribution file hash values don't match.""" 44 | 45 | 46 | class InvalidWheelFilename(InstallationError): 47 | """Invalid wheel filename.""" 48 | 49 | 50 | class UnsupportedWheel(InstallationError): 51 | """Unsupported wheel.""" 52 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/models/__init__.py: -------------------------------------------------------------------------------- 1 | from pip.models.index import Index, PyPI 2 | 3 | 4 | __all__ = ["Index", "PyPI"] 5 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/models/index.py: -------------------------------------------------------------------------------- 1 | from pip._vendor.six.moves.urllib import parse as urllib_parse 2 | 3 | 4 | class Index(object): 5 | def __init__(self, url): 6 | self.url = url 7 | self.netloc = urllib_parse.urlsplit(url).netloc 8 | self.simple_url = self.url_to_path('simple') 9 | self.pypi_url = self.url_to_path('pypi') 10 | self.pip_json_url = self.url_to_path('pypi/pip/json') 11 | 12 | def url_to_path(self, path): 13 | return urllib_parse.urljoin(self.url, path) 14 | 15 | 16 | PyPI = Index('https://pypi.python.org/') 17 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/operations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/pip-pop/pip/operations/__init__.py -------------------------------------------------------------------------------- /vendor/pip-pop/pip/req/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from .req_install import InstallRequirement 4 | from .req_set import RequirementSet, Requirements 5 | from .req_file import parse_requirements 6 | 7 | __all__ = [ 8 | "RequirementSet", "Requirements", "InstallRequirement", 9 | "parse_requirements", 10 | ] 11 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/status_codes.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | SUCCESS = 0 4 | ERROR = 1 5 | UNKNOWN_ERROR = 2 6 | VIRTUALENV_NOT_FOUND = 3 7 | PREVIOUS_BUILD_DIR_ERROR = 4 8 | NO_MATCHES_FOUND = 23 9 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/utils/build.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | import os.path 4 | import tempfile 5 | 6 | from pip.utils import rmtree 7 | 8 | 9 | class BuildDirectory(object): 10 | 11 | def __init__(self, name=None, delete=None): 12 | # If we were not given an explicit directory, and we were not given an 13 | # explicit delete option, then we'll default to deleting. 14 | if name is None and delete is None: 15 | delete = True 16 | 17 | if name is None: 18 | # We realpath here because some systems have their default tmpdir 19 | # symlinked to another directory. This tends to confuse build 20 | # scripts, so we canonicalize the path by traversing potential 21 | # symlinks here. 22 | name = os.path.realpath(tempfile.mkdtemp(prefix="pip-build-")) 23 | # If we were not given an explicit directory, and we were not given 24 | # an explicit delete option, then we'll default to deleting. 25 | if delete is None: 26 | delete = True 27 | 28 | self.name = name 29 | self.delete = delete 30 | 31 | def __repr__(self): 32 | return "<{} {!r}>".format(self.__class__.__name__, self.name) 33 | 34 | def __enter__(self): 35 | return self.name 36 | 37 | def __exit__(self, exc, value, tb): 38 | self.cleanup() 39 | 40 | def cleanup(self): 41 | if self.delete: 42 | rmtree(self.name) 43 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/utils/deprecation.py: -------------------------------------------------------------------------------- 1 | """ 2 | A module that implments tooling to enable easy warnings about deprecations. 3 | """ 4 | from __future__ import absolute_import 5 | 6 | import logging 7 | import warnings 8 | 9 | 10 | class PipDeprecationWarning(Warning): 11 | pass 12 | 13 | 14 | class RemovedInPip8Warning(PipDeprecationWarning, PendingDeprecationWarning): 15 | pass 16 | 17 | 18 | class RemovedInPip9Warning(PipDeprecationWarning, PendingDeprecationWarning): 19 | pass 20 | 21 | 22 | DEPRECATIONS = [RemovedInPip8Warning, RemovedInPip9Warning] 23 | 24 | 25 | # Warnings <-> Logging Integration 26 | 27 | 28 | _warnings_showwarning = None 29 | 30 | 31 | def _showwarning(message, category, filename, lineno, file=None, line=None): 32 | if file is not None: 33 | if _warnings_showwarning is not None: 34 | _warnings_showwarning( 35 | message, category, filename, lineno, file, line, 36 | ) 37 | else: 38 | if issubclass(category, PipDeprecationWarning): 39 | # We use a specially named logger which will handle all of the 40 | # deprecation messages for pip. 41 | logger = logging.getLogger("pip.deprecations") 42 | 43 | # This is purposely using the % formatter here instead of letting 44 | # the logging module handle the interpolation. This is because we 45 | # want it to appear as if someone typed this entire message out. 46 | log_message = "DEPRECATION: %s" % message 47 | 48 | # Things that are DeprecationWarnings will be removed in the very 49 | # next version of pip. We want these to be more obvious so we 50 | # use the ERROR logging level while the PendingDeprecationWarnings 51 | # are still have at least 2 versions to go until they are removed 52 | # so they can just be warnings. 53 | if issubclass(category, DeprecationWarning): 54 | logger.error(log_message) 55 | else: 56 | logger.warning(log_message) 57 | else: 58 | _warnings_showwarning( 59 | message, category, filename, lineno, file, line, 60 | ) 61 | 62 | 63 | def install_warning_logger(): 64 | global _warnings_showwarning 65 | 66 | if _warnings_showwarning is None: 67 | _warnings_showwarning = warnings.showwarning 68 | warnings.showwarning = _showwarning 69 | -------------------------------------------------------------------------------- /vendor/pip-pop/pip/utils/filesystem.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path 3 | 4 | from pip.compat import get_path_uid 5 | 6 | 7 | def check_path_owner(path): 8 | # If we don't have a way to check the effective uid of this process, then 9 | # we'll just assume that we own the directory. 10 | if not hasattr(os, "geteuid"): 11 | return True 12 | 13 | previous = None 14 | while path != previous: 15 | if os.path.lexists(path): 16 | # Check if path is writable by current user. 17 | if os.geteuid() == 0: 18 | # Special handling for root user in order to handle properly 19 | # cases where users use sudo without -H flag. 20 | try: 21 | path_uid = get_path_uid(path) 22 | except OSError: 23 | return False 24 | return path_uid == 0 25 | else: 26 | return os.access(path, os.W_OK) 27 | else: 28 | previous, path = path, os.path.dirname(path) 29 | -------------------------------------------------------------------------------- /vendor/python.gunicorn.sh: -------------------------------------------------------------------------------- 1 | case $(ulimit -u) in 2 | 3 | # Automatic configuration for Gunicorn's Workers setting. 4 | 5 | # Standard-1X (+Free, +Hobby) Dyno 6 | 256) 7 | export DYNO_RAM=512 8 | export WEB_CONCURRENCY=${WEB_CONCURRENCY:-2} 9 | ;; 10 | 11 | # Standard-2X Dyno 12 | 512) 13 | export DYNO_RAM=1024 14 | export WEB_CONCURRENCY=${WEB_CONCURRENCY:-4} 15 | ;; 16 | 17 | # Performance-M Dyno 18 | 16384) 19 | export DYNO_RAM=2560 20 | export WEB_CONCURRENCY=${WEB_CONCURRENCY:-8} 21 | ;; 22 | 23 | # Performance-L Dyno 24 | 32768) 25 | export DYNO_RAM=6656 26 | export WEB_CONCURRENCY=${WEB_CONCURRENCY:-11} 27 | ;; 28 | 29 | esac 30 | 31 | # Automatic configuration for Gunicorn's ForwardedAllowIPS setting. 32 | export FORWARDED_ALLOW_IPS='*' -------------------------------------------------------------------------------- /vendor/setuptools-20.4.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/megacool/heroku-buildpack-python-nltk/a9ff961792f240ecd79d66d6c037848790b06b1e/vendor/setuptools-20.4.tar.gz --------------------------------------------------------------------------------