com.googler.python 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -2
- package/python3.4.2/lib/python3.4/site-packages/pip/__init__.py +1 -277
- package/python3.4.2/lib/python3.4/site-packages/pip/__main__.py +19 -7
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/__init__.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/basecommand.py +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{baseparser.py → _internal/baseparser.py} +240 -224
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/build_env.py +92 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cache.py +202 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cmdoptions.py +609 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/__init__.py +79 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/check.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/completion.py +94 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/configuration.py +227 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/download.py +233 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/freeze.py +96 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/hash.py +57 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{commands → _internal/commands}/help.py +36 -33
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/install.py +477 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/list.py +343 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/search.py +135 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/show.py +164 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/uninstall.py +71 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/wheel.py +179 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/compat.py +235 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/configuration.py +378 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/download.py +922 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/exceptions.py +249 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/index.py +1117 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/locations.py +194 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/__init__.py +4 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/index.py +15 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{_vendor/requests/packages/urllib3/contrib → _internal/operations}/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/check.py +106 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/freeze.py +252 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/prepare.py +378 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/pep425tags.py +317 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/__init__.py +69 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_file.py +338 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_install.py +1115 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_set.py +164 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_uninstall.py +455 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/resolve.py +354 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/{status_codes.py → _internal/status_codes.py} +8 -6
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/appdirs.py +258 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/deprecation.py +77 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/encoding.py +33 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/filesystem.py +28 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/glibc.py +84 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/hashes.py +94 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/logging.py +132 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/misc.py +851 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/outdated.py +163 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/packaging.py +70 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/setuptools_build.py +8 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/temp_dir.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/typing.py +29 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/ui.py +421 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/__init__.py +471 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/bazaar.py +113 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/git.py +311 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/mercurial.py +105 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/subversion.py +271 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_internal/wheel.py +817 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/__init__.py +109 -8
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/appdirs.py +604 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/__init__.py +11 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/_cmd.py +60 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py +134 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/cache.py +39 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +133 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +43 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/compat.py +29 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/filewrapper.py +78 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/heuristics.py +138 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py +194 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/wrapper.py +27 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__init__.py +3 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__main__.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests → certifi}/cacert.pem +1765 -2358
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/core.py +37 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/__init__.py +39 -32
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/big5prober.py +47 -42
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/chardistribution.py +233 -231
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/chardetect.py +85 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/compat.py +34 -34
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/cp949prober.py +49 -44
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/enums.py +76 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escprober.py +101 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escsm.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euckrprober.py +47 -42
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwfreq.py +387 -428
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwprober.py +46 -41
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312freq.py +283 -472
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312prober.py +46 -41
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/hebrewprober.py +292 -283
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jisfreq.py +325 -569
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jpcntx.py +233 -219
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langbulgarianmodel.py +228 -229
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langcyrillicmodel.py +333 -329
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langgreekmodel.py +225 -225
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhebrewmodel.py +200 -201
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhungarianmodel.py +225 -225
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langthaimodel.py +199 -200
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/langturkishmodel.py +193 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/latin1prober.py +145 -139
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/mbcsgroupprober.py +54 -54
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sbcharsetprober.py +132 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/sbcsgroupprober.py +73 -69
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/utf8prober.py +82 -76
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/version.py +9 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/__init__.py +7 -7
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansi.py +102 -50
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansitowin32.py +236 -190
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/initialise.py +82 -56
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/win32.py +156 -137
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py +162 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/__init__.py +23 -23
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -6
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -41
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/shutil.py +761 -761
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -84
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +788 -788
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -2607
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py +1117 -1064
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/database.py +1318 -1301
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/index.py +516 -488
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/locators.py +1292 -1194
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/manifest.py +393 -364
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py +131 -190
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/metadata.py +1068 -1026
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/resources.py +355 -317
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/scripts.py +415 -323
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/util.py +1755 -1575
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/version.py +736 -721
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/wheel.py +984 -958
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distro.py +1104 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/__init__.py +35 -23
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{ihatexml.py → _ihatexml.py} +288 -285
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{inputstream.py → _inputstream.py} +923 -881
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{tokenizer.py → _tokenizer.py} +1721 -1731
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/__init__.py +14 -12
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/_base.py +37 -37
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/datrie.py +44 -44
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/py.py +67 -67
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{utils.py → _utils.py} +124 -82
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/constants.py +2947 -3104
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -20
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/{_base.py → base.py} +12 -12
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -65
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -93
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -205
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +896 -12
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -38
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/html5parser.py +2791 -2713
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -44
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -76
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/{_base.py → base.py} +417 -377
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +236 -227
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +340 -337
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +366 -369
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -57
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{_base.py → base.py} +252 -200
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -46
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +130 -138
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{lxmletree.py → etree_lxml.py} +213 -208
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{genshistream.py → genshi.py} +69 -69
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/__init__.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/codec.py +118 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/compat.py +12 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/core.py +387 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/idnadata.py +1585 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/intranges.py +53 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/package_data.py +2 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/uts46data.py +7634 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/ipaddress.py +2419 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/__init__.py +347 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/linklockfile.py +73 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/mkdirlockfile.py +84 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/pidlockfile.py +190 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/sqlitelockfile.py +156 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/symlinklockfile.py +70 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/__init__.py +66 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/_version.py +1 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/exceptions.py +41 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/fallback.py +971 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__about__.py +21 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__init__.py +14 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_compat.py +30 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_structures.py +70 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/markers.py +301 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py +130 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/specifiers.py +774 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/utils.py +63 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/version.py +441 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{pkg_resources.py → pkg_resources/__init__.py} +3125 -2762
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pkg_resources/py31compat.py +22 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/__init__.py +127 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/bar.py +88 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/counter.py +48 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/helpers.py +91 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/spinner.py +44 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pyparsing.py +5720 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/__init__.py +3 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/core.py +13 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/parser.py +374 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/writer.py +127 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__init__.py +123 -77
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__version__.py +14 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/adapters.py +525 -388
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/api.py +152 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/auth.py +293 -193
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/certs.py +18 -24
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/compat.py +73 -115
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/cookies.py +542 -454
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/exceptions.py +122 -75
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/help.py +120 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/hooks.py +34 -45
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/models.py +948 -803
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages.py +16 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py +737 -637
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/status_codes.py +91 -88
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/structures.py +105 -127
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/utils.py +904 -673
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/retrying.py +267 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/six.py +891 -646
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/__init__.py +97 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/_collections.py +319 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/connection.py +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/connectionpool.py +905 -710
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +593 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +343 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/appengine.py +296 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/contrib/ntlmpool.py +112 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +455 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +810 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/socks.py +188 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/exceptions.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/fields.py +178 -177
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/filepost.py +94 -100
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/__init__.py +5 -4
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +53 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ordered_dict.py +259 -260
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/six.py +868 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/__init__.py +19 -13
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/_implementation.py +157 -105
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/poolmanager.py +440 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/request.py +148 -141
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/response.py +626 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/__init__.py +54 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/connection.py +130 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/request.py +118 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/response.py +81 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/retry.py +401 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/selectors.py +581 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/ssl_.py +341 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/timeout.py +242 -234
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/url.py +230 -162
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/wait.py +40 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/labels.py +231 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/tests.py +153 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/__init__.py +0 -16
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/markers.py +0 -119
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/sanitizer.py +0 -271
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/__init__.py +0 -16
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py +0 -320
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py +0 -63
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/re-vendor.py +0 -34
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/__init__.py +0 -3
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py +0 -925
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py +0 -46
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py +0 -106
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py +0 -62
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py +0 -61
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/constants.py +0 -39
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escprober.py +0 -86
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escsm.py +0 -242
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py +0 -90
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py +0 -596
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py +0 -86
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py +0 -575
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py +0 -120
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py +0 -91
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py +0 -170
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py +0 -58
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py +0 -205
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/connection.py +0 -204
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py +0 -422
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py +0 -126
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py +0 -385
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py +0 -258
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py +0 -308
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py +0 -27
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py +0 -45
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py +0 -68
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py +0 -13
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py +0 -133
- package/python3.4.2/lib/python3.4/site-packages/pip/backwardcompat/__init__.py +0 -138
- package/python3.4.2/lib/python3.4/site-packages/pip/basecommand.py +0 -201
- package/python3.4.2/lib/python3.4/site-packages/pip/cmdoptions.py +0 -371
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/__init__.py +0 -88
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/bundle.py +0 -42
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/completion.py +0 -59
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/freeze.py +0 -114
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/install.py +0 -314
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/list.py +0 -162
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/search.py +0 -132
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/show.py +0 -80
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/uninstall.py +0 -59
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/unzip.py +0 -7
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/wheel.py +0 -195
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/zip.py +0 -351
- package/python3.4.2/lib/python3.4/site-packages/pip/download.py +0 -644
- package/python3.4.2/lib/python3.4/site-packages/pip/exceptions.py +0 -46
- package/python3.4.2/lib/python3.4/site-packages/pip/index.py +0 -990
- package/python3.4.2/lib/python3.4/site-packages/pip/locations.py +0 -171
- package/python3.4.2/lib/python3.4/site-packages/pip/log.py +0 -276
- package/python3.4.2/lib/python3.4/site-packages/pip/pep425tags.py +0 -102
- package/python3.4.2/lib/python3.4/site-packages/pip/req.py +0 -1931
- package/python3.4.2/lib/python3.4/site-packages/pip/runner.py +0 -18
- package/python3.4.2/lib/python3.4/site-packages/pip/util.py +0 -720
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/__init__.py +0 -251
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/bazaar.py +0 -131
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/git.py +0 -194
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/mercurial.py +0 -151
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/subversion.py +0 -273
- package/python3.4.2/lib/python3.4/site-packages/pip/wheel.py +0 -560
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os.path
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
from pip._vendor.packaging.version import parse as parse_version
|
|
8
|
+
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
|
9
|
+
from pip._vendor.six.moves.urllib import request as urllib_request
|
|
10
|
+
|
|
11
|
+
from pip._internal.compat import samefile
|
|
12
|
+
from pip._internal.exceptions import BadCommand
|
|
13
|
+
from pip._internal.utils.misc import display_path
|
|
14
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
15
|
+
from pip._internal.vcs import VersionControl, vcs
|
|
16
|
+
|
|
17
|
+
urlsplit = urllib_parse.urlsplit
|
|
18
|
+
urlunsplit = urllib_parse.urlunsplit
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
logger = logging.getLogger(__name__)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
HASH_REGEX = re.compile('[a-fA-F0-9]{40}')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def looks_like_hash(sha):
|
|
28
|
+
return bool(HASH_REGEX.match(sha))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Git(VersionControl):
|
|
32
|
+
name = 'git'
|
|
33
|
+
dirname = '.git'
|
|
34
|
+
repo_name = 'clone'
|
|
35
|
+
schemes = (
|
|
36
|
+
'git', 'git+http', 'git+https', 'git+ssh', 'git+git', 'git+file',
|
|
37
|
+
)
|
|
38
|
+
# Prevent the user's environment variables from interfering with pip:
|
|
39
|
+
# https://github.com/pypa/pip/issues/1130
|
|
40
|
+
unset_environ = ('GIT_DIR', 'GIT_WORK_TREE')
|
|
41
|
+
default_arg_rev = 'HEAD'
|
|
42
|
+
|
|
43
|
+
def __init__(self, url=None, *args, **kwargs):
|
|
44
|
+
|
|
45
|
+
# Works around an apparent Git bug
|
|
46
|
+
# (see http://article.gmane.org/gmane.comp.version-control.git/146500)
|
|
47
|
+
if url:
|
|
48
|
+
scheme, netloc, path, query, fragment = urlsplit(url)
|
|
49
|
+
if scheme.endswith('file'):
|
|
50
|
+
initial_slashes = path[:-len(path.lstrip('/'))]
|
|
51
|
+
newpath = (
|
|
52
|
+
initial_slashes +
|
|
53
|
+
urllib_request.url2pathname(path)
|
|
54
|
+
.replace('\\', '/').lstrip('/')
|
|
55
|
+
)
|
|
56
|
+
url = urlunsplit((scheme, netloc, newpath, query, fragment))
|
|
57
|
+
after_plus = scheme.find('+') + 1
|
|
58
|
+
url = scheme[:after_plus] + urlunsplit(
|
|
59
|
+
(scheme[after_plus:], netloc, newpath, query, fragment),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
super(Git, self).__init__(url, *args, **kwargs)
|
|
63
|
+
|
|
64
|
+
def get_base_rev_args(self, rev):
|
|
65
|
+
return [rev]
|
|
66
|
+
|
|
67
|
+
def get_git_version(self):
|
|
68
|
+
VERSION_PFX = 'git version '
|
|
69
|
+
version = self.run_command(['version'], show_stdout=False)
|
|
70
|
+
if version.startswith(VERSION_PFX):
|
|
71
|
+
version = version[len(VERSION_PFX):].split()[0]
|
|
72
|
+
else:
|
|
73
|
+
version = ''
|
|
74
|
+
# get first 3 positions of the git version becasue
|
|
75
|
+
# on windows it is x.y.z.windows.t, and this parses as
|
|
76
|
+
# LegacyVersion which always smaller than a Version.
|
|
77
|
+
version = '.'.join(version.split('.')[:3])
|
|
78
|
+
return parse_version(version)
|
|
79
|
+
|
|
80
|
+
def export(self, location):
|
|
81
|
+
"""Export the Git repository at the url to the destination location"""
|
|
82
|
+
if not location.endswith('/'):
|
|
83
|
+
location = location + '/'
|
|
84
|
+
|
|
85
|
+
with TempDirectory(kind="export") as temp_dir:
|
|
86
|
+
self.unpack(temp_dir.path)
|
|
87
|
+
self.run_command(
|
|
88
|
+
['checkout-index', '-a', '-f', '--prefix', location],
|
|
89
|
+
show_stdout=False, cwd=temp_dir.path
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
def get_revision_sha(self, dest, rev):
|
|
93
|
+
"""
|
|
94
|
+
Return a commit hash for the given revision if it names a remote
|
|
95
|
+
branch or tag. Otherwise, return None.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
dest: the repository directory.
|
|
99
|
+
rev: the revision name.
|
|
100
|
+
"""
|
|
101
|
+
# Pass rev to pre-filter the list.
|
|
102
|
+
output = self.run_command(['show-ref', rev], cwd=dest,
|
|
103
|
+
show_stdout=False, on_returncode='ignore')
|
|
104
|
+
refs = {}
|
|
105
|
+
for line in output.strip().splitlines():
|
|
106
|
+
try:
|
|
107
|
+
sha, ref = line.split()
|
|
108
|
+
except ValueError:
|
|
109
|
+
# Include the offending line to simplify troubleshooting if
|
|
110
|
+
# this error ever occurs.
|
|
111
|
+
raise ValueError('unexpected show-ref line: {!r}'.format(line))
|
|
112
|
+
|
|
113
|
+
refs[ref] = sha
|
|
114
|
+
|
|
115
|
+
branch_ref = 'refs/remotes/origin/{}'.format(rev)
|
|
116
|
+
tag_ref = 'refs/tags/{}'.format(rev)
|
|
117
|
+
|
|
118
|
+
return refs.get(branch_ref) or refs.get(tag_ref)
|
|
119
|
+
|
|
120
|
+
def check_rev_options(self, dest, rev_options):
|
|
121
|
+
"""Check the revision options before checkout.
|
|
122
|
+
|
|
123
|
+
Returns a new RevOptions object for the SHA1 of the branch or tag
|
|
124
|
+
if found.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
rev_options: a RevOptions object.
|
|
128
|
+
"""
|
|
129
|
+
rev = rev_options.arg_rev
|
|
130
|
+
sha = self.get_revision_sha(dest, rev)
|
|
131
|
+
|
|
132
|
+
if sha is not None:
|
|
133
|
+
return rev_options.make_new(sha)
|
|
134
|
+
|
|
135
|
+
# Do not show a warning for the common case of something that has
|
|
136
|
+
# the form of a Git commit hash.
|
|
137
|
+
if not looks_like_hash(rev):
|
|
138
|
+
logger.warning(
|
|
139
|
+
"Did not find branch or tag '%s', assuming revision or ref.",
|
|
140
|
+
rev,
|
|
141
|
+
)
|
|
142
|
+
return rev_options
|
|
143
|
+
|
|
144
|
+
def is_commit_id_equal(self, dest, name):
|
|
145
|
+
"""
|
|
146
|
+
Return whether the current commit hash equals the given name.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
dest: the repository directory.
|
|
150
|
+
name: a string name.
|
|
151
|
+
"""
|
|
152
|
+
if not name:
|
|
153
|
+
# Then avoid an unnecessary subprocess call.
|
|
154
|
+
return False
|
|
155
|
+
|
|
156
|
+
return self.get_revision(dest) == name
|
|
157
|
+
|
|
158
|
+
def switch(self, dest, url, rev_options):
|
|
159
|
+
self.run_command(['config', 'remote.origin.url', url], cwd=dest)
|
|
160
|
+
cmd_args = ['checkout', '-q'] + rev_options.to_args()
|
|
161
|
+
self.run_command(cmd_args, cwd=dest)
|
|
162
|
+
|
|
163
|
+
self.update_submodules(dest)
|
|
164
|
+
|
|
165
|
+
def update(self, dest, rev_options):
|
|
166
|
+
# First fetch changes from the default remote
|
|
167
|
+
if self.get_git_version() >= parse_version('1.9.0'):
|
|
168
|
+
# fetch tags in addition to everything else
|
|
169
|
+
self.run_command(['fetch', '-q', '--tags'], cwd=dest)
|
|
170
|
+
else:
|
|
171
|
+
self.run_command(['fetch', '-q'], cwd=dest)
|
|
172
|
+
# Then reset to wanted revision (maybe even origin/master)
|
|
173
|
+
rev_options = self.check_rev_options(dest, rev_options)
|
|
174
|
+
cmd_args = ['reset', '--hard', '-q'] + rev_options.to_args()
|
|
175
|
+
self.run_command(cmd_args, cwd=dest)
|
|
176
|
+
#: update submodules
|
|
177
|
+
self.update_submodules(dest)
|
|
178
|
+
|
|
179
|
+
def obtain(self, dest):
|
|
180
|
+
url, rev = self.get_url_rev()
|
|
181
|
+
rev_options = self.make_rev_options(rev)
|
|
182
|
+
if self.check_destination(dest, url, rev_options):
|
|
183
|
+
rev_display = rev_options.to_display()
|
|
184
|
+
logger.info(
|
|
185
|
+
'Cloning %s%s to %s', url, rev_display, display_path(dest),
|
|
186
|
+
)
|
|
187
|
+
self.run_command(['clone', '-q', url, dest])
|
|
188
|
+
|
|
189
|
+
if rev:
|
|
190
|
+
rev_options = self.check_rev_options(dest, rev_options)
|
|
191
|
+
# Only do a checkout if the current commit id doesn't match
|
|
192
|
+
# the requested revision.
|
|
193
|
+
if not self.is_commit_id_equal(dest, rev_options.rev):
|
|
194
|
+
rev = rev_options.rev
|
|
195
|
+
# Only fetch the revision if it's a ref
|
|
196
|
+
if rev.startswith('refs/'):
|
|
197
|
+
self.run_command(
|
|
198
|
+
['fetch', '-q', url] + rev_options.to_args(),
|
|
199
|
+
cwd=dest,
|
|
200
|
+
)
|
|
201
|
+
# Change the revision to the SHA of the ref we fetched
|
|
202
|
+
rev = 'FETCH_HEAD'
|
|
203
|
+
self.run_command(['checkout', '-q', rev], cwd=dest)
|
|
204
|
+
|
|
205
|
+
#: repo may contain submodules
|
|
206
|
+
self.update_submodules(dest)
|
|
207
|
+
|
|
208
|
+
def get_url(self, location):
|
|
209
|
+
"""Return URL of the first remote encountered."""
|
|
210
|
+
remotes = self.run_command(
|
|
211
|
+
['config', '--get-regexp', r'remote\..*\.url'],
|
|
212
|
+
show_stdout=False, cwd=location,
|
|
213
|
+
)
|
|
214
|
+
remotes = remotes.splitlines()
|
|
215
|
+
found_remote = remotes[0]
|
|
216
|
+
for remote in remotes:
|
|
217
|
+
if remote.startswith('remote.origin.url '):
|
|
218
|
+
found_remote = remote
|
|
219
|
+
break
|
|
220
|
+
url = found_remote.split(' ')[1]
|
|
221
|
+
return url.strip()
|
|
222
|
+
|
|
223
|
+
def get_revision(self, location):
|
|
224
|
+
current_rev = self.run_command(
|
|
225
|
+
['rev-parse', 'HEAD'], show_stdout=False, cwd=location,
|
|
226
|
+
)
|
|
227
|
+
return current_rev.strip()
|
|
228
|
+
|
|
229
|
+
def _get_subdirectory(self, location):
|
|
230
|
+
"""Return the relative path of setup.py to the git repo root."""
|
|
231
|
+
# find the repo root
|
|
232
|
+
git_dir = self.run_command(['rev-parse', '--git-dir'],
|
|
233
|
+
show_stdout=False, cwd=location).strip()
|
|
234
|
+
if not os.path.isabs(git_dir):
|
|
235
|
+
git_dir = os.path.join(location, git_dir)
|
|
236
|
+
root_dir = os.path.join(git_dir, '..')
|
|
237
|
+
# find setup.py
|
|
238
|
+
orig_location = location
|
|
239
|
+
while not os.path.exists(os.path.join(location, 'setup.py')):
|
|
240
|
+
last_location = location
|
|
241
|
+
location = os.path.dirname(location)
|
|
242
|
+
if location == last_location:
|
|
243
|
+
# We've traversed up to the root of the filesystem without
|
|
244
|
+
# finding setup.py
|
|
245
|
+
logger.warning(
|
|
246
|
+
"Could not find setup.py for directory %s (tried all "
|
|
247
|
+
"parent directories)",
|
|
248
|
+
orig_location,
|
|
249
|
+
)
|
|
250
|
+
return None
|
|
251
|
+
# relative path of setup.py to repo root
|
|
252
|
+
if samefile(root_dir, location):
|
|
253
|
+
return None
|
|
254
|
+
return os.path.relpath(location, root_dir)
|
|
255
|
+
|
|
256
|
+
def get_src_requirement(self, dist, location):
|
|
257
|
+
repo = self.get_url(location)
|
|
258
|
+
if not repo.lower().startswith('git:'):
|
|
259
|
+
repo = 'git+' + repo
|
|
260
|
+
egg_project_name = dist.egg_name().split('-', 1)[0]
|
|
261
|
+
if not repo:
|
|
262
|
+
return None
|
|
263
|
+
current_rev = self.get_revision(location)
|
|
264
|
+
req = '%s@%s#egg=%s' % (repo, current_rev, egg_project_name)
|
|
265
|
+
subdirectory = self._get_subdirectory(location)
|
|
266
|
+
if subdirectory:
|
|
267
|
+
req += '&subdirectory=' + subdirectory
|
|
268
|
+
return req
|
|
269
|
+
|
|
270
|
+
def get_url_rev(self):
|
|
271
|
+
"""
|
|
272
|
+
Prefixes stub URLs like 'user@hostname:user/repo.git' with 'ssh://'.
|
|
273
|
+
That's required because although they use SSH they sometimes doesn't
|
|
274
|
+
work with a ssh:// scheme (e.g. Github). But we need a scheme for
|
|
275
|
+
parsing. Hence we remove it again afterwards and return it as a stub.
|
|
276
|
+
"""
|
|
277
|
+
if '://' not in self.url:
|
|
278
|
+
assert 'file:' not in self.url
|
|
279
|
+
self.url = self.url.replace('git+', 'git+ssh://')
|
|
280
|
+
url, rev = super(Git, self).get_url_rev()
|
|
281
|
+
url = url.replace('ssh://', '')
|
|
282
|
+
else:
|
|
283
|
+
url, rev = super(Git, self).get_url_rev()
|
|
284
|
+
|
|
285
|
+
return url, rev
|
|
286
|
+
|
|
287
|
+
def update_submodules(self, location):
|
|
288
|
+
if not os.path.exists(os.path.join(location, '.gitmodules')):
|
|
289
|
+
return
|
|
290
|
+
self.run_command(
|
|
291
|
+
['submodule', 'update', '--init', '--recursive', '-q'],
|
|
292
|
+
cwd=location,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
@classmethod
|
|
296
|
+
def controls_location(cls, location):
|
|
297
|
+
if super(Git, cls).controls_location(location):
|
|
298
|
+
return True
|
|
299
|
+
try:
|
|
300
|
+
r = cls().run_command(['rev-parse'],
|
|
301
|
+
cwd=location,
|
|
302
|
+
show_stdout=False,
|
|
303
|
+
on_returncode='ignore')
|
|
304
|
+
return not r
|
|
305
|
+
except BadCommand:
|
|
306
|
+
logger.debug("could not determine if %s is under git control "
|
|
307
|
+
"because git is not available", location)
|
|
308
|
+
return False
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
vcs.register(Git)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
|
|
6
|
+
from pip._vendor.six.moves import configparser
|
|
7
|
+
|
|
8
|
+
from pip._internal.download import path_to_url
|
|
9
|
+
from pip._internal.utils.misc import display_path
|
|
10
|
+
from pip._internal.utils.temp_dir import TempDirectory
|
|
11
|
+
from pip._internal.vcs import VersionControl, vcs
|
|
12
|
+
|
|
13
|
+
logger = logging.getLogger(__name__)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Mercurial(VersionControl):
|
|
17
|
+
name = 'hg'
|
|
18
|
+
dirname = '.hg'
|
|
19
|
+
repo_name = 'clone'
|
|
20
|
+
schemes = ('hg', 'hg+http', 'hg+https', 'hg+ssh', 'hg+static-http')
|
|
21
|
+
|
|
22
|
+
def get_base_rev_args(self, rev):
|
|
23
|
+
return [rev]
|
|
24
|
+
|
|
25
|
+
def export(self, location):
|
|
26
|
+
"""Export the Hg repository at the url to the destination location"""
|
|
27
|
+
with TempDirectory(kind="export") as temp_dir:
|
|
28
|
+
self.unpack(temp_dir.path)
|
|
29
|
+
|
|
30
|
+
self.run_command(
|
|
31
|
+
['archive', location], show_stdout=False, cwd=temp_dir.path
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
def switch(self, dest, url, rev_options):
|
|
35
|
+
repo_config = os.path.join(dest, self.dirname, 'hgrc')
|
|
36
|
+
config = configparser.SafeConfigParser()
|
|
37
|
+
try:
|
|
38
|
+
config.read(repo_config)
|
|
39
|
+
config.set('paths', 'default', url)
|
|
40
|
+
with open(repo_config, 'w') as config_file:
|
|
41
|
+
config.write(config_file)
|
|
42
|
+
except (OSError, configparser.NoSectionError) as exc:
|
|
43
|
+
logger.warning(
|
|
44
|
+
'Could not switch Mercurial repository to %s: %s', url, exc,
|
|
45
|
+
)
|
|
46
|
+
else:
|
|
47
|
+
cmd_args = ['update', '-q'] + rev_options.to_args()
|
|
48
|
+
self.run_command(cmd_args, cwd=dest)
|
|
49
|
+
|
|
50
|
+
def update(self, dest, rev_options):
|
|
51
|
+
self.run_command(['pull', '-q'], cwd=dest)
|
|
52
|
+
cmd_args = ['update', '-q'] + rev_options.to_args()
|
|
53
|
+
self.run_command(cmd_args, cwd=dest)
|
|
54
|
+
|
|
55
|
+
def obtain(self, dest):
|
|
56
|
+
url, rev = self.get_url_rev()
|
|
57
|
+
rev_options = self.make_rev_options(rev)
|
|
58
|
+
if self.check_destination(dest, url, rev_options):
|
|
59
|
+
rev_display = rev_options.to_display()
|
|
60
|
+
logger.info(
|
|
61
|
+
'Cloning hg %s%s to %s',
|
|
62
|
+
url,
|
|
63
|
+
rev_display,
|
|
64
|
+
display_path(dest),
|
|
65
|
+
)
|
|
66
|
+
self.run_command(['clone', '--noupdate', '-q', url, dest])
|
|
67
|
+
cmd_args = ['update', '-q'] + rev_options.to_args()
|
|
68
|
+
self.run_command(cmd_args, cwd=dest)
|
|
69
|
+
|
|
70
|
+
def get_url(self, location):
|
|
71
|
+
url = self.run_command(
|
|
72
|
+
['showconfig', 'paths.default'],
|
|
73
|
+
show_stdout=False, cwd=location).strip()
|
|
74
|
+
if self._is_local_repository(url):
|
|
75
|
+
url = path_to_url(url)
|
|
76
|
+
return url.strip()
|
|
77
|
+
|
|
78
|
+
def get_revision(self, location):
|
|
79
|
+
current_revision = self.run_command(
|
|
80
|
+
['parents', '--template={rev}'],
|
|
81
|
+
show_stdout=False, cwd=location).strip()
|
|
82
|
+
return current_revision
|
|
83
|
+
|
|
84
|
+
def get_revision_hash(self, location):
|
|
85
|
+
current_rev_hash = self.run_command(
|
|
86
|
+
['parents', '--template={node}'],
|
|
87
|
+
show_stdout=False, cwd=location).strip()
|
|
88
|
+
return current_rev_hash
|
|
89
|
+
|
|
90
|
+
def get_src_requirement(self, dist, location):
|
|
91
|
+
repo = self.get_url(location)
|
|
92
|
+
if not repo.lower().startswith('hg:'):
|
|
93
|
+
repo = 'hg+' + repo
|
|
94
|
+
egg_project_name = dist.egg_name().split('-', 1)[0]
|
|
95
|
+
if not repo:
|
|
96
|
+
return None
|
|
97
|
+
current_rev_hash = self.get_revision_hash(location)
|
|
98
|
+
return '%s@%s#egg=%s' % (repo, current_rev_hash, egg_project_name)
|
|
99
|
+
|
|
100
|
+
def is_commit_id_equal(self, dest, name):
|
|
101
|
+
"""Always assume the versions don't match"""
|
|
102
|
+
return False
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
vcs.register(Mercurial)
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
from pip._vendor.six.moves.urllib import parse as urllib_parse
|
|
8
|
+
|
|
9
|
+
from pip._internal.index import Link
|
|
10
|
+
from pip._internal.utils.logging import indent_log
|
|
11
|
+
from pip._internal.utils.misc import display_path, rmtree
|
|
12
|
+
from pip._internal.vcs import VersionControl, vcs
|
|
13
|
+
|
|
14
|
+
_svn_xml_url_re = re.compile('url="([^"]+)"')
|
|
15
|
+
_svn_rev_re = re.compile(r'committed-rev="(\d+)"')
|
|
16
|
+
_svn_url_re = re.compile(r'URL: (.+)')
|
|
17
|
+
_svn_revision_re = re.compile(r'Revision: (.+)')
|
|
18
|
+
_svn_info_xml_rev_re = re.compile(r'\s*revision="(\d+)"')
|
|
19
|
+
_svn_info_xml_url_re = re.compile(r'<url>(.*)</url>')
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger(__name__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Subversion(VersionControl):
|
|
26
|
+
name = 'svn'
|
|
27
|
+
dirname = '.svn'
|
|
28
|
+
repo_name = 'checkout'
|
|
29
|
+
schemes = ('svn', 'svn+ssh', 'svn+http', 'svn+https', 'svn+svn')
|
|
30
|
+
|
|
31
|
+
def get_base_rev_args(self, rev):
|
|
32
|
+
return ['-r', rev]
|
|
33
|
+
|
|
34
|
+
def get_info(self, location):
|
|
35
|
+
"""Returns (url, revision), where both are strings"""
|
|
36
|
+
assert not location.rstrip('/').endswith(self.dirname), \
|
|
37
|
+
'Bad directory: %s' % location
|
|
38
|
+
output = self.run_command(
|
|
39
|
+
['info', location],
|
|
40
|
+
show_stdout=False,
|
|
41
|
+
extra_environ={'LANG': 'C'},
|
|
42
|
+
)
|
|
43
|
+
match = _svn_url_re.search(output)
|
|
44
|
+
if not match:
|
|
45
|
+
logger.warning(
|
|
46
|
+
'Cannot determine URL of svn checkout %s',
|
|
47
|
+
display_path(location),
|
|
48
|
+
)
|
|
49
|
+
logger.debug('Output that cannot be parsed: \n%s', output)
|
|
50
|
+
return None, None
|
|
51
|
+
url = match.group(1).strip()
|
|
52
|
+
match = _svn_revision_re.search(output)
|
|
53
|
+
if not match:
|
|
54
|
+
logger.warning(
|
|
55
|
+
'Cannot determine revision of svn checkout %s',
|
|
56
|
+
display_path(location),
|
|
57
|
+
)
|
|
58
|
+
logger.debug('Output that cannot be parsed: \n%s', output)
|
|
59
|
+
return url, None
|
|
60
|
+
return url, match.group(1)
|
|
61
|
+
|
|
62
|
+
def export(self, location):
|
|
63
|
+
"""Export the svn repository at the url to the destination location"""
|
|
64
|
+
url, rev = self.get_url_rev()
|
|
65
|
+
rev_options = get_rev_options(self, url, rev)
|
|
66
|
+
url = self.remove_auth_from_url(url)
|
|
67
|
+
logger.info('Exporting svn repository %s to %s', url, location)
|
|
68
|
+
with indent_log():
|
|
69
|
+
if os.path.exists(location):
|
|
70
|
+
# Subversion doesn't like to check out over an existing
|
|
71
|
+
# directory --force fixes this, but was only added in svn 1.5
|
|
72
|
+
rmtree(location)
|
|
73
|
+
cmd_args = ['export'] + rev_options.to_args() + [url, location]
|
|
74
|
+
self.run_command(cmd_args, show_stdout=False)
|
|
75
|
+
|
|
76
|
+
def switch(self, dest, url, rev_options):
|
|
77
|
+
cmd_args = ['switch'] + rev_options.to_args() + [url, dest]
|
|
78
|
+
self.run_command(cmd_args)
|
|
79
|
+
|
|
80
|
+
def update(self, dest, rev_options):
|
|
81
|
+
cmd_args = ['update'] + rev_options.to_args() + [dest]
|
|
82
|
+
self.run_command(cmd_args)
|
|
83
|
+
|
|
84
|
+
def obtain(self, dest):
|
|
85
|
+
url, rev = self.get_url_rev()
|
|
86
|
+
rev_options = get_rev_options(self, url, rev)
|
|
87
|
+
url = self.remove_auth_from_url(url)
|
|
88
|
+
if self.check_destination(dest, url, rev_options):
|
|
89
|
+
rev_display = rev_options.to_display()
|
|
90
|
+
logger.info(
|
|
91
|
+
'Checking out %s%s to %s',
|
|
92
|
+
url,
|
|
93
|
+
rev_display,
|
|
94
|
+
display_path(dest),
|
|
95
|
+
)
|
|
96
|
+
cmd_args = ['checkout', '-q'] + rev_options.to_args() + [url, dest]
|
|
97
|
+
self.run_command(cmd_args)
|
|
98
|
+
|
|
99
|
+
def get_location(self, dist, dependency_links):
|
|
100
|
+
for url in dependency_links:
|
|
101
|
+
egg_fragment = Link(url).egg_fragment
|
|
102
|
+
if not egg_fragment:
|
|
103
|
+
continue
|
|
104
|
+
if '-' in egg_fragment:
|
|
105
|
+
# FIXME: will this work when a package has - in the name?
|
|
106
|
+
key = '-'.join(egg_fragment.split('-')[:-1]).lower()
|
|
107
|
+
else:
|
|
108
|
+
key = egg_fragment
|
|
109
|
+
if key == dist.key:
|
|
110
|
+
return url.split('#', 1)[0]
|
|
111
|
+
return None
|
|
112
|
+
|
|
113
|
+
def get_revision(self, location):
|
|
114
|
+
"""
|
|
115
|
+
Return the maximum revision for all files under a given location
|
|
116
|
+
"""
|
|
117
|
+
# Note: taken from setuptools.command.egg_info
|
|
118
|
+
revision = 0
|
|
119
|
+
|
|
120
|
+
for base, dirs, files in os.walk(location):
|
|
121
|
+
if self.dirname not in dirs:
|
|
122
|
+
dirs[:] = []
|
|
123
|
+
continue # no sense walking uncontrolled subdirs
|
|
124
|
+
dirs.remove(self.dirname)
|
|
125
|
+
entries_fn = os.path.join(base, self.dirname, 'entries')
|
|
126
|
+
if not os.path.exists(entries_fn):
|
|
127
|
+
# FIXME: should we warn?
|
|
128
|
+
continue
|
|
129
|
+
|
|
130
|
+
dirurl, localrev = self._get_svn_url_rev(base)
|
|
131
|
+
|
|
132
|
+
if base == location:
|
|
133
|
+
base = dirurl + '/' # save the root url
|
|
134
|
+
elif not dirurl or not dirurl.startswith(base):
|
|
135
|
+
dirs[:] = []
|
|
136
|
+
continue # not part of the same svn tree, skip it
|
|
137
|
+
revision = max(revision, localrev)
|
|
138
|
+
return revision
|
|
139
|
+
|
|
140
|
+
def get_url_rev(self):
|
|
141
|
+
# hotfix the URL scheme after removing svn+ from svn+ssh:// readd it
|
|
142
|
+
url, rev = super(Subversion, self).get_url_rev()
|
|
143
|
+
if url.startswith('ssh://'):
|
|
144
|
+
url = 'svn+' + url
|
|
145
|
+
return url, rev
|
|
146
|
+
|
|
147
|
+
def get_url(self, location):
|
|
148
|
+
# In cases where the source is in a subdirectory, not alongside
|
|
149
|
+
# setup.py we have to look up in the location until we find a real
|
|
150
|
+
# setup.py
|
|
151
|
+
orig_location = location
|
|
152
|
+
while not os.path.exists(os.path.join(location, 'setup.py')):
|
|
153
|
+
last_location = location
|
|
154
|
+
location = os.path.dirname(location)
|
|
155
|
+
if location == last_location:
|
|
156
|
+
# We've traversed up to the root of the filesystem without
|
|
157
|
+
# finding setup.py
|
|
158
|
+
logger.warning(
|
|
159
|
+
"Could not find setup.py for directory %s (tried all "
|
|
160
|
+
"parent directories)",
|
|
161
|
+
orig_location,
|
|
162
|
+
)
|
|
163
|
+
return None
|
|
164
|
+
|
|
165
|
+
return self._get_svn_url_rev(location)[0]
|
|
166
|
+
|
|
167
|
+
def _get_svn_url_rev(self, location):
|
|
168
|
+
from pip._internal.exceptions import InstallationError
|
|
169
|
+
|
|
170
|
+
entries_path = os.path.join(location, self.dirname, 'entries')
|
|
171
|
+
if os.path.exists(entries_path):
|
|
172
|
+
with open(entries_path) as f:
|
|
173
|
+
data = f.read()
|
|
174
|
+
else: # subversion >= 1.7 does not have the 'entries' file
|
|
175
|
+
data = ''
|
|
176
|
+
|
|
177
|
+
if (data.startswith('8') or
|
|
178
|
+
data.startswith('9') or
|
|
179
|
+
data.startswith('10')):
|
|
180
|
+
data = list(map(str.splitlines, data.split('\n\x0c\n')))
|
|
181
|
+
del data[0][0] # get rid of the '8'
|
|
182
|
+
url = data[0][3]
|
|
183
|
+
revs = [int(d[9]) for d in data if len(d) > 9 and d[9]] + [0]
|
|
184
|
+
elif data.startswith('<?xml'):
|
|
185
|
+
match = _svn_xml_url_re.search(data)
|
|
186
|
+
if not match:
|
|
187
|
+
raise ValueError('Badly formatted data: %r' % data)
|
|
188
|
+
url = match.group(1) # get repository URL
|
|
189
|
+
revs = [int(m.group(1)) for m in _svn_rev_re.finditer(data)] + [0]
|
|
190
|
+
else:
|
|
191
|
+
try:
|
|
192
|
+
# subversion >= 1.7
|
|
193
|
+
xml = self.run_command(
|
|
194
|
+
['info', '--xml', location],
|
|
195
|
+
show_stdout=False,
|
|
196
|
+
)
|
|
197
|
+
url = _svn_info_xml_url_re.search(xml).group(1)
|
|
198
|
+
revs = [
|
|
199
|
+
int(m.group(1)) for m in _svn_info_xml_rev_re.finditer(xml)
|
|
200
|
+
]
|
|
201
|
+
except InstallationError:
|
|
202
|
+
url, revs = None, []
|
|
203
|
+
|
|
204
|
+
if revs:
|
|
205
|
+
rev = max(revs)
|
|
206
|
+
else:
|
|
207
|
+
rev = 0
|
|
208
|
+
|
|
209
|
+
return url, rev
|
|
210
|
+
|
|
211
|
+
def get_src_requirement(self, dist, location):
|
|
212
|
+
repo = self.get_url(location)
|
|
213
|
+
if repo is None:
|
|
214
|
+
return None
|
|
215
|
+
# FIXME: why not project name?
|
|
216
|
+
egg_project_name = dist.egg_name().split('-', 1)[0]
|
|
217
|
+
rev = self.get_revision(location)
|
|
218
|
+
return 'svn+%s@%s#egg=%s' % (repo, rev, egg_project_name)
|
|
219
|
+
|
|
220
|
+
def is_commit_id_equal(self, dest, name):
|
|
221
|
+
"""Always assume the versions don't match"""
|
|
222
|
+
return False
|
|
223
|
+
|
|
224
|
+
@staticmethod
|
|
225
|
+
def remove_auth_from_url(url):
|
|
226
|
+
# Return a copy of url with 'username:password@' removed.
|
|
227
|
+
# username/pass params are passed to subversion through flags
|
|
228
|
+
# and are not recognized in the url.
|
|
229
|
+
|
|
230
|
+
# parsed url
|
|
231
|
+
purl = urllib_parse.urlsplit(url)
|
|
232
|
+
stripped_netloc = \
|
|
233
|
+
purl.netloc.split('@')[-1]
|
|
234
|
+
|
|
235
|
+
# stripped url
|
|
236
|
+
url_pieces = (
|
|
237
|
+
purl.scheme, stripped_netloc, purl.path, purl.query, purl.fragment
|
|
238
|
+
)
|
|
239
|
+
surl = urllib_parse.urlunsplit(url_pieces)
|
|
240
|
+
return surl
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def get_rev_options(vcs, url, rev):
|
|
244
|
+
"""
|
|
245
|
+
Return a RevOptions object.
|
|
246
|
+
"""
|
|
247
|
+
r = urllib_parse.urlsplit(url)
|
|
248
|
+
if hasattr(r, 'username'):
|
|
249
|
+
# >= Python-2.5
|
|
250
|
+
username, password = r.username, r.password
|
|
251
|
+
else:
|
|
252
|
+
netloc = r[1]
|
|
253
|
+
if '@' in netloc:
|
|
254
|
+
auth = netloc.split('@')[0]
|
|
255
|
+
if ':' in auth:
|
|
256
|
+
username, password = auth.split(':', 1)
|
|
257
|
+
else:
|
|
258
|
+
username, password = auth, None
|
|
259
|
+
else:
|
|
260
|
+
username, password = None, None
|
|
261
|
+
|
|
262
|
+
extra_args = []
|
|
263
|
+
if username:
|
|
264
|
+
extra_args += ['--username', username]
|
|
265
|
+
if password:
|
|
266
|
+
extra_args += ['--password', password]
|
|
267
|
+
|
|
268
|
+
return vcs.make_rev_options(rev, extra_args=extra_args)
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
vcs.register(Subversion)
|