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.
Files changed (354) hide show
  1. package/package.json +4 -2
  2. package/python3.4.2/lib/python3.4/site-packages/pip/__init__.py +1 -277
  3. package/python3.4.2/lib/python3.4/site-packages/pip/__main__.py +19 -7
  4. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/__init__.py +246 -0
  5. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/basecommand.py +373 -0
  6. package/python3.4.2/lib/python3.4/site-packages/pip/{baseparser.py → _internal/baseparser.py} +240 -224
  7. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/build_env.py +92 -0
  8. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cache.py +202 -0
  9. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/cmdoptions.py +609 -0
  10. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/__init__.py +79 -0
  11. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/check.py +42 -0
  12. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/completion.py +94 -0
  13. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/configuration.py +227 -0
  14. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/download.py +233 -0
  15. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/freeze.py +96 -0
  16. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/hash.py +57 -0
  17. package/python3.4.2/lib/python3.4/site-packages/pip/{commands → _internal/commands}/help.py +36 -33
  18. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/install.py +477 -0
  19. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/list.py +343 -0
  20. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/search.py +135 -0
  21. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/show.py +164 -0
  22. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/uninstall.py +71 -0
  23. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/commands/wheel.py +179 -0
  24. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/compat.py +235 -0
  25. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/configuration.py +378 -0
  26. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/download.py +922 -0
  27. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/exceptions.py +249 -0
  28. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/index.py +1117 -0
  29. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/locations.py +194 -0
  30. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/__init__.py +4 -0
  31. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/models/index.py +15 -0
  32. package/python3.4.2/lib/python3.4/site-packages/pip/{_vendor/requests/packages/urllib3/contrib → _internal/operations}/__init__.py +0 -0
  33. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/check.py +106 -0
  34. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/freeze.py +252 -0
  35. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/operations/prepare.py +378 -0
  36. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/pep425tags.py +317 -0
  37. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/__init__.py +69 -0
  38. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_file.py +338 -0
  39. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_install.py +1115 -0
  40. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_set.py +164 -0
  41. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/req/req_uninstall.py +455 -0
  42. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/resolve.py +354 -0
  43. package/python3.4.2/lib/python3.4/site-packages/pip/{status_codes.py → _internal/status_codes.py} +8 -6
  44. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/__init__.py +0 -0
  45. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/appdirs.py +258 -0
  46. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/deprecation.py +77 -0
  47. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/encoding.py +33 -0
  48. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/filesystem.py +28 -0
  49. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/glibc.py +84 -0
  50. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/hashes.py +94 -0
  51. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/logging.py +132 -0
  52. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/misc.py +851 -0
  53. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/outdated.py +163 -0
  54. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/packaging.py +70 -0
  55. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/setuptools_build.py +8 -0
  56. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/temp_dir.py +82 -0
  57. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/typing.py +29 -0
  58. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/utils/ui.py +421 -0
  59. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/__init__.py +471 -0
  60. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/bazaar.py +113 -0
  61. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/git.py +311 -0
  62. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/mercurial.py +105 -0
  63. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/vcs/subversion.py +271 -0
  64. package/python3.4.2/lib/python3.4/site-packages/pip/_internal/wheel.py +817 -0
  65. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/__init__.py +109 -8
  66. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/appdirs.py +604 -0
  67. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/__init__.py +11 -0
  68. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/_cmd.py +60 -0
  69. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py +134 -0
  70. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/cache.py +39 -0
  71. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +2 -0
  72. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +133 -0
  73. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +43 -0
  74. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/compat.py +29 -0
  75. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py +373 -0
  76. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/filewrapper.py +78 -0
  77. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/heuristics.py +138 -0
  78. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py +194 -0
  79. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/cachecontrol/wrapper.py +27 -0
  80. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__init__.py +3 -0
  81. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/__main__.py +2 -0
  82. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests → certifi}/cacert.pem +1765 -2358
  83. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/certifi/core.py +37 -0
  84. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/__init__.py +39 -32
  85. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
  86. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/big5prober.py +47 -42
  87. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/chardistribution.py +233 -231
  88. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
  89. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
  90. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
  91. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/cli/chardetect.py +85 -0
  92. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
  93. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/compat.py +34 -34
  94. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/cp949prober.py +49 -44
  95. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/enums.py +76 -0
  96. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escprober.py +101 -0
  97. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/escsm.py +246 -0
  98. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
  99. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
  100. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euckrprober.py +47 -42
  101. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwfreq.py +387 -428
  102. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/euctwprober.py +46 -41
  103. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312freq.py +283 -472
  104. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/gb2312prober.py +46 -41
  105. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/hebrewprober.py +292 -283
  106. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jisfreq.py +325 -569
  107. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/jpcntx.py +233 -219
  108. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langbulgarianmodel.py +228 -229
  109. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langcyrillicmodel.py +333 -329
  110. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langgreekmodel.py +225 -225
  111. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhebrewmodel.py +200 -201
  112. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langhungarianmodel.py +225 -225
  113. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/langthaimodel.py +199 -200
  114. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/langturkishmodel.py +193 -0
  115. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/latin1prober.py +145 -139
  116. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
  117. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/mbcsgroupprober.py +54 -54
  118. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
  119. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sbcharsetprober.py +132 -0
  120. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/sbcsgroupprober.py +73 -69
  121. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
  122. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
  123. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/chardet → chardet}/utf8prober.py +82 -76
  124. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/chardet/version.py +9 -0
  125. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/__init__.py +7 -7
  126. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansi.py +102 -50
  127. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansitowin32.py +236 -190
  128. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/initialise.py +82 -56
  129. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/win32.py +156 -137
  130. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py +162 -120
  131. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/__init__.py +23 -23
  132. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -6
  133. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -41
  134. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/shutil.py +761 -761
  135. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -84
  136. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +788 -788
  137. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -2607
  138. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py +1117 -1064
  139. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/database.py +1318 -1301
  140. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/index.py +516 -488
  141. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/locators.py +1292 -1194
  142. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/manifest.py +393 -364
  143. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py +131 -190
  144. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/metadata.py +1068 -1026
  145. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/resources.py +355 -317
  146. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/scripts.py +415 -323
  147. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t32.exe +0 -0
  148. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t64.exe +0 -0
  149. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/util.py +1755 -1575
  150. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/version.py +736 -721
  151. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w32.exe +0 -0
  152. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w64.exe +0 -0
  153. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/wheel.py +984 -958
  154. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distro.py +1104 -0
  155. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/__init__.py +35 -23
  156. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{ihatexml.py → _ihatexml.py} +288 -285
  157. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{inputstream.py → _inputstream.py} +923 -881
  158. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{tokenizer.py → _tokenizer.py} +1721 -1731
  159. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/__init__.py +14 -12
  160. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/_base.py +37 -37
  161. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/datrie.py +44 -44
  162. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{trie → _trie}/py.py +67 -67
  163. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/{utils.py → _utils.py} +124 -82
  164. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/constants.py +2947 -3104
  165. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -20
  166. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/{_base.py → base.py} +12 -12
  167. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -65
  168. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -93
  169. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -205
  170. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +896 -12
  171. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -38
  172. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/html5parser.py +2791 -2713
  173. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
  174. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
  175. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
  176. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -44
  177. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -76
  178. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/{_base.py → base.py} +417 -377
  179. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +236 -227
  180. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +340 -337
  181. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +366 -369
  182. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -57
  183. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{_base.py → base.py} +252 -200
  184. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -46
  185. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +130 -138
  186. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{lxmletree.py → etree_lxml.py} +213 -208
  187. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/{genshistream.py → genshi.py} +69 -69
  188. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/__init__.py +2 -0
  189. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/codec.py +118 -0
  190. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/compat.py +12 -0
  191. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/core.py +387 -0
  192. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/idnadata.py +1585 -0
  193. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/intranges.py +53 -0
  194. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/package_data.py +2 -0
  195. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/idna/uts46data.py +7634 -0
  196. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/ipaddress.py +2419 -0
  197. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/__init__.py +347 -0
  198. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/linklockfile.py +73 -0
  199. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/mkdirlockfile.py +84 -0
  200. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/pidlockfile.py +190 -0
  201. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/sqlitelockfile.py +156 -0
  202. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/lockfile/symlinklockfile.py +70 -0
  203. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/__init__.py +66 -0
  204. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/_version.py +1 -0
  205. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/exceptions.py +41 -0
  206. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/msgpack/fallback.py +971 -0
  207. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__about__.py +21 -0
  208. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/__init__.py +14 -0
  209. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_compat.py +30 -0
  210. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/_structures.py +70 -0
  211. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/markers.py +301 -0
  212. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/requirements.py +130 -0
  213. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/specifiers.py +774 -0
  214. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/utils.py +63 -0
  215. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/packaging/version.py +441 -0
  216. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{pkg_resources.py → pkg_resources/__init__.py} +3125 -2762
  217. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pkg_resources/py31compat.py +22 -0
  218. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/__init__.py +127 -0
  219. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/bar.py +88 -0
  220. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/counter.py +48 -0
  221. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/helpers.py +91 -0
  222. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/progress/spinner.py +44 -0
  223. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pyparsing.py +5720 -0
  224. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/__init__.py +3 -0
  225. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/core.py +13 -0
  226. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/parser.py +374 -0
  227. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pytoml/writer.py +127 -0
  228. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__init__.py +123 -77
  229. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__version__.py +14 -0
  230. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
  231. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/adapters.py +525 -388
  232. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/api.py +152 -120
  233. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/auth.py +293 -193
  234. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/certs.py +18 -24
  235. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/compat.py +73 -115
  236. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/cookies.py +542 -454
  237. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/exceptions.py +122 -75
  238. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/help.py +120 -0
  239. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/hooks.py +34 -45
  240. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/models.py +948 -803
  241. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages.py +16 -0
  242. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py +737 -637
  243. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/status_codes.py +91 -88
  244. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/structures.py +105 -127
  245. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/utils.py +904 -673
  246. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/retrying.py +267 -0
  247. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/six.py +891 -646
  248. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/__init__.py +97 -0
  249. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/_collections.py +319 -0
  250. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/connection.py +373 -0
  251. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/connectionpool.py +905 -710
  252. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  253. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  254. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +593 -0
  255. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +343 -0
  256. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/appengine.py +296 -0
  257. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/contrib/ntlmpool.py +112 -120
  258. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +455 -0
  259. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +810 -0
  260. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/contrib/socks.py +188 -0
  261. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/exceptions.py +246 -0
  262. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/fields.py +178 -177
  263. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/filepost.py +94 -100
  264. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/__init__.py +5 -4
  265. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  266. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +53 -0
  267. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ordered_dict.py +259 -260
  268. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/packages/six.py +868 -0
  269. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/__init__.py +19 -13
  270. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/packages/ssl_match_hostname/_implementation.py +157 -105
  271. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/poolmanager.py +440 -0
  272. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/request.py +148 -141
  273. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/response.py +626 -0
  274. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/__init__.py +54 -0
  275. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/connection.py +130 -0
  276. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/request.py +118 -0
  277. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/response.py +81 -0
  278. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/retry.py +401 -0
  279. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/selectors.py +581 -0
  280. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/ssl_.py +341 -0
  281. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/timeout.py +242 -234
  282. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/{requests/packages/urllib3 → urllib3}/util/url.py +230 -162
  283. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/urllib3/util/wait.py +40 -0
  284. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
  285. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/labels.py +231 -0
  286. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
  287. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/tests.py +153 -0
  288. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
  289. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/__init__.py +0 -16
  290. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/markers.py +0 -119
  291. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/sanitizer.py +0 -271
  292. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/__init__.py +0 -16
  293. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py +0 -320
  294. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py +0 -63
  295. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/re-vendor.py +0 -34
  296. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/__init__.py +0 -3
  297. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py +0 -925
  298. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py +0 -46
  299. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py +0 -106
  300. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py +0 -62
  301. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py +0 -61
  302. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/constants.py +0 -39
  303. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escprober.py +0 -86
  304. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escsm.py +0 -242
  305. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py +0 -90
  306. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py +0 -596
  307. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py +0 -86
  308. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py +0 -575
  309. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py +0 -120
  310. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py +0 -91
  311. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py +0 -170
  312. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py +0 -58
  313. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py +0 -205
  314. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/connection.py +0 -204
  315. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py +0 -422
  316. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py +0 -126
  317. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py +0 -385
  318. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py +0 -258
  319. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py +0 -308
  320. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py +0 -27
  321. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py +0 -45
  322. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py +0 -68
  323. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py +0 -13
  324. package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py +0 -133
  325. package/python3.4.2/lib/python3.4/site-packages/pip/backwardcompat/__init__.py +0 -138
  326. package/python3.4.2/lib/python3.4/site-packages/pip/basecommand.py +0 -201
  327. package/python3.4.2/lib/python3.4/site-packages/pip/cmdoptions.py +0 -371
  328. package/python3.4.2/lib/python3.4/site-packages/pip/commands/__init__.py +0 -88
  329. package/python3.4.2/lib/python3.4/site-packages/pip/commands/bundle.py +0 -42
  330. package/python3.4.2/lib/python3.4/site-packages/pip/commands/completion.py +0 -59
  331. package/python3.4.2/lib/python3.4/site-packages/pip/commands/freeze.py +0 -114
  332. package/python3.4.2/lib/python3.4/site-packages/pip/commands/install.py +0 -314
  333. package/python3.4.2/lib/python3.4/site-packages/pip/commands/list.py +0 -162
  334. package/python3.4.2/lib/python3.4/site-packages/pip/commands/search.py +0 -132
  335. package/python3.4.2/lib/python3.4/site-packages/pip/commands/show.py +0 -80
  336. package/python3.4.2/lib/python3.4/site-packages/pip/commands/uninstall.py +0 -59
  337. package/python3.4.2/lib/python3.4/site-packages/pip/commands/unzip.py +0 -7
  338. package/python3.4.2/lib/python3.4/site-packages/pip/commands/wheel.py +0 -195
  339. package/python3.4.2/lib/python3.4/site-packages/pip/commands/zip.py +0 -351
  340. package/python3.4.2/lib/python3.4/site-packages/pip/download.py +0 -644
  341. package/python3.4.2/lib/python3.4/site-packages/pip/exceptions.py +0 -46
  342. package/python3.4.2/lib/python3.4/site-packages/pip/index.py +0 -990
  343. package/python3.4.2/lib/python3.4/site-packages/pip/locations.py +0 -171
  344. package/python3.4.2/lib/python3.4/site-packages/pip/log.py +0 -276
  345. package/python3.4.2/lib/python3.4/site-packages/pip/pep425tags.py +0 -102
  346. package/python3.4.2/lib/python3.4/site-packages/pip/req.py +0 -1931
  347. package/python3.4.2/lib/python3.4/site-packages/pip/runner.py +0 -18
  348. package/python3.4.2/lib/python3.4/site-packages/pip/util.py +0 -720
  349. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/__init__.py +0 -251
  350. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/bazaar.py +0 -131
  351. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/git.py +0 -194
  352. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/mercurial.py +0 -151
  353. package/python3.4.2/lib/python3.4/site-packages/pip/vcs/subversion.py +0 -273
  354. package/python3.4.2/lib/python3.4/site-packages/pip/wheel.py +0 -560
@@ -1,364 +1,393 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2013 Python Software Foundation.
4
- # See LICENSE.txt and CONTRIBUTORS.txt.
5
- #
6
- """
7
- Class representing the list of files in a distribution.
8
-
9
- Equivalent to distutils.filelist, but fixes some problems.
10
- """
11
- import fnmatch
12
- import logging
13
- import os
14
- import re
15
-
16
- from . import DistlibException
17
- from .compat import fsdecode
18
- from .util import convert_path
19
-
20
-
21
- __all__ = ['Manifest']
22
-
23
- logger = logging.getLogger(__name__)
24
-
25
- # a \ followed by some spaces + EOL
26
- _COLLAPSE_PATTERN = re.compile('\\\w*\n', re.M)
27
- _COMMENTED_LINE = re.compile('#.*?(?=\n)|\n(?=$)', re.M | re.S)
28
-
29
-
30
- class Manifest(object):
31
- """A list of files built by on exploring the filesystem and filtered by
32
- applying various patterns to what we find there.
33
- """
34
-
35
- def __init__(self, base=None):
36
- """
37
- Initialise an instance.
38
-
39
- :param base: The base directory to explore under.
40
- """
41
- self.base = os.path.abspath(os.path.normpath(base or os.getcwd()))
42
- self.prefix = self.base + os.sep
43
- self.allfiles = None
44
- self.files = set()
45
-
46
- #
47
- # Public API
48
- #
49
-
50
- def findall(self):
51
- """Find all files under the base and set ``allfiles`` to the absolute
52
- pathnames of files found.
53
- """
54
- from stat import S_ISREG, S_ISDIR, S_ISLNK
55
-
56
- self.allfiles = allfiles = []
57
- root = self.base
58
- stack = [root]
59
- pop = stack.pop
60
- push = stack.append
61
-
62
- while stack:
63
- root = pop()
64
- names = os.listdir(root)
65
-
66
- for name in names:
67
- fullname = os.path.join(root, name)
68
-
69
- # Avoid excess stat calls -- just one will do, thank you!
70
- stat = os.stat(fullname)
71
- mode = stat.st_mode
72
- if S_ISREG(mode):
73
- allfiles.append(fsdecode(fullname))
74
- elif S_ISDIR(mode) and not S_ISLNK(mode):
75
- push(fullname)
76
-
77
- def add(self, item):
78
- """
79
- Add a file to the manifest.
80
-
81
- :param item: The pathname to add. This can be relative to the base.
82
- """
83
- if not item.startswith(self.prefix):
84
- item = os.path.join(self.base, item)
85
- self.files.add(os.path.normpath(item))
86
-
87
- def add_many(self, items):
88
- """
89
- Add a list of files to the manifest.
90
-
91
- :param items: The pathnames to add. These can be relative to the base.
92
- """
93
- for item in items:
94
- self.add(item)
95
-
96
- def sorted(self, wantdirs=False):
97
- """
98
- Return sorted files in directory order
99
- """
100
-
101
- def add_dir(dirs, d):
102
- dirs.add(d)
103
- logger.debug('add_dir added %s', d)
104
- if d != self.base:
105
- parent, _ = os.path.split(d)
106
- assert parent not in ('', '/')
107
- add_dir(dirs, parent)
108
-
109
- result = set(self.files) # make a copy!
110
- if wantdirs:
111
- dirs = set()
112
- for f in result:
113
- add_dir(dirs, os.path.dirname(f))
114
- result |= dirs
115
- return [os.path.join(*path_tuple) for path_tuple in
116
- sorted(os.path.split(path) for path in result)]
117
-
118
- def clear(self):
119
- """Clear all collected files."""
120
- self.files = set()
121
- self.allfiles = []
122
-
123
- def process_directive(self, directive):
124
- """
125
- Process a directive which either adds some files from ``allfiles`` to
126
- ``files``, or removes some files from ``files``.
127
-
128
- :param directive: The directive to process. This should be in a format
129
- compatible with distutils ``MANIFEST.in`` files:
130
-
131
- http://docs.python.org/distutils/sourcedist.html#commands
132
- """
133
- # Parse the line: split it up, make sure the right number of words
134
- # is there, and return the relevant words. 'action' is always
135
- # defined: it's the first word of the line. Which of the other
136
- # three are defined depends on the action; it'll be either
137
- # patterns, (dir and patterns), or (dirpattern).
138
- action, patterns, thedir, dirpattern = self._parse_directive(directive)
139
-
140
- # OK, now we know that the action is valid and we have the
141
- # right number of words on the line for that action -- so we
142
- # can proceed with minimal error-checking.
143
- if action == 'include':
144
- for pattern in patterns:
145
- if not self._include_pattern(pattern, anchor=True):
146
- logger.warning('no files found matching %r', pattern)
147
-
148
- elif action == 'exclude':
149
- for pattern in patterns:
150
- if not self._exclude_pattern(pattern, anchor=True):
151
- logger.warning('no previously-included files '
152
- 'found matching %r', pattern)
153
-
154
- elif action == 'global-include':
155
- for pattern in patterns:
156
- if not self._include_pattern(pattern, anchor=False):
157
- logger.warning('no files found matching %r '
158
- 'anywhere in distribution', pattern)
159
-
160
- elif action == 'global-exclude':
161
- for pattern in patterns:
162
- if not self._exclude_pattern(pattern, anchor=False):
163
- logger.warning('no previously-included files '
164
- 'matching %r found anywhere in '
165
- 'distribution', pattern)
166
-
167
- elif action == 'recursive-include':
168
- for pattern in patterns:
169
- if not self._include_pattern(pattern, prefix=thedir):
170
- logger.warning('no files found matching %r '
171
- 'under directory %r', pattern, thedir)
172
-
173
- elif action == 'recursive-exclude':
174
- for pattern in patterns:
175
- if not self._exclude_pattern(pattern, prefix=thedir):
176
- logger.warning('no previously-included files '
177
- 'matching %r found under directory %r',
178
- pattern, thedir)
179
-
180
- elif action == 'graft':
181
- if not self._include_pattern(None, prefix=dirpattern):
182
- logger.warning('no directories found matching %r',
183
- dirpattern)
184
-
185
- elif action == 'prune':
186
- if not self._exclude_pattern(None, prefix=dirpattern):
187
- logger.warning('no previously-included directories found '
188
- 'matching %r', dirpattern)
189
- else: # pragma: no cover
190
- # This should never happen, as it should be caught in
191
- # _parse_template_line
192
- raise DistlibException(
193
- 'invalid action %r' % action)
194
-
195
- #
196
- # Private API
197
- #
198
-
199
- def _parse_directive(self, directive):
200
- """
201
- Validate a directive.
202
- :param directive: The directive to validate.
203
- :return: A tuple of action, patterns, thedir, dir_patterns
204
- """
205
- words = directive.split()
206
- if len(words) == 1 and words[0] not in ('include', 'exclude',
207
- 'global-include',
208
- 'global-exclude',
209
- 'recursive-include',
210
- 'recursive-exclude',
211
- 'graft', 'prune'):
212
- # no action given, let's use the default 'include'
213
- words.insert(0, 'include')
214
-
215
- action = words[0]
216
- patterns = thedir = dir_pattern = None
217
-
218
- if action in ('include', 'exclude',
219
- 'global-include', 'global-exclude'):
220
- if len(words) < 2:
221
- raise DistlibException(
222
- '%r expects <pattern1> <pattern2> ...' % action)
223
-
224
- patterns = [convert_path(word) for word in words[1:]]
225
-
226
- elif action in ('recursive-include', 'recursive-exclude'):
227
- if len(words) < 3:
228
- raise DistlibException(
229
- '%r expects <dir> <pattern1> <pattern2> ...' % action)
230
-
231
- thedir = convert_path(words[1])
232
- patterns = [convert_path(word) for word in words[2:]]
233
-
234
- elif action in ('graft', 'prune'):
235
- if len(words) != 2:
236
- raise DistlibException(
237
- '%r expects a single <dir_pattern>' % action)
238
-
239
- dir_pattern = convert_path(words[1])
240
-
241
- else:
242
- raise DistlibException('unknown action %r' % action)
243
-
244
- return action, patterns, thedir, dir_pattern
245
-
246
- def _include_pattern(self, pattern, anchor=True, prefix=None,
247
- is_regex=False):
248
- """Select strings (presumably filenames) from 'self.files' that
249
- match 'pattern', a Unix-style wildcard (glob) pattern.
250
-
251
- Patterns are not quite the same as implemented by the 'fnmatch'
252
- module: '*' and '?' match non-special characters, where "special"
253
- is platform-dependent: slash on Unix; colon, slash, and backslash on
254
- DOS/Windows; and colon on Mac OS.
255
-
256
- If 'anchor' is true (the default), then the pattern match is more
257
- stringent: "*.py" will match "foo.py" but not "foo/bar.py". If
258
- 'anchor' is false, both of these will match.
259
-
260
- If 'prefix' is supplied, then only filenames starting with 'prefix'
261
- (itself a pattern) and ending with 'pattern', with anything in between
262
- them, will match. 'anchor' is ignored in this case.
263
-
264
- If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
265
- 'pattern' is assumed to be either a string containing a regex or a
266
- regex object -- no translation is done, the regex is just compiled
267
- and used as-is.
268
-
269
- Selected strings will be added to self.files.
270
-
271
- Return True if files are found.
272
- """
273
- # XXX docstring lying about what the special chars are?
274
- found = False
275
- pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex)
276
-
277
- # delayed loading of allfiles list
278
- if self.allfiles is None:
279
- self.findall()
280
-
281
- for name in self.allfiles:
282
- if pattern_re.search(name):
283
- self.files.add(name)
284
- found = True
285
- return found
286
-
287
- def _exclude_pattern(self, pattern, anchor=True, prefix=None,
288
- is_regex=False):
289
- """Remove strings (presumably filenames) from 'files' that match
290
- 'pattern'.
291
-
292
- Other parameters are the same as for 'include_pattern()', above.
293
- The list 'self.files' is modified in place. Return True if files are
294
- found.
295
-
296
- This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
297
- packaging source distributions
298
- """
299
- found = False
300
- pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex)
301
- for f in list(self.files):
302
- if pattern_re.search(f):
303
- self.files.remove(f)
304
- found = True
305
- return found
306
-
307
- def _translate_pattern(self, pattern, anchor=True, prefix=None,
308
- is_regex=False):
309
- """Translate a shell-like wildcard pattern to a compiled regular
310
- expression.
311
-
312
- Return the compiled regex. If 'is_regex' true,
313
- then 'pattern' is directly compiled to a regex (if it's a string)
314
- or just returned as-is (assumes it's a regex object).
315
- """
316
- if is_regex:
317
- if isinstance(pattern, str):
318
- return re.compile(pattern)
319
- else:
320
- return pattern
321
-
322
- if pattern:
323
- pattern_re = self._glob_to_re(pattern)
324
- else:
325
- pattern_re = ''
326
-
327
- base = re.escape(os.path.join(self.base, ''))
328
- if prefix is not None:
329
- # ditch end of pattern character
330
- empty_pattern = self._glob_to_re('')
331
- prefix_re = self._glob_to_re(prefix)[:-len(empty_pattern)]
332
- sep = os.sep
333
- if os.sep == '\\':
334
- sep = r'\\'
335
- pattern_re = '^' + base + sep.join((prefix_re,
336
- '.*' + pattern_re))
337
- else: # no prefix -- respect anchor flag
338
- if anchor:
339
- pattern_re = '^' + base + pattern_re
340
-
341
- return re.compile(pattern_re)
342
-
343
- def _glob_to_re(self, pattern):
344
- """Translate a shell-like glob pattern to a regular expression.
345
-
346
- Return a string containing the regex. Differs from
347
- 'fnmatch.translate()' in that '*' does not match "special characters"
348
- (which are platform-specific).
349
- """
350
- pattern_re = fnmatch.translate(pattern)
351
-
352
- # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which
353
- # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,
354
- # and by extension they shouldn't match such "special characters" under
355
- # any OS. So change all non-escaped dots in the RE to match any
356
- # character except the special characters (currently: just os.sep).
357
- sep = os.sep
358
- if os.sep == '\\':
359
- # we're using a regex to manipulate a regex, so we need
360
- # to escape the backslash twice
361
- sep = r'\\\\'
362
- escaped = r'\1[^%s]' % sep
363
- pattern_re = re.sub(r'((?<!\\)(\\\\)*)\.', escaped, pattern_re)
364
- return pattern_re
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # Copyright (C) 2012-2013 Python Software Foundation.
4
+ # See LICENSE.txt and CONTRIBUTORS.txt.
5
+ #
6
+ """
7
+ Class representing the list of files in a distribution.
8
+
9
+ Equivalent to distutils.filelist, but fixes some problems.
10
+ """
11
+ import fnmatch
12
+ import logging
13
+ import os
14
+ import re
15
+ import sys
16
+
17
+ from . import DistlibException
18
+ from .compat import fsdecode
19
+ from .util import convert_path
20
+
21
+
22
+ __all__ = ['Manifest']
23
+
24
+ logger = logging.getLogger(__name__)
25
+
26
+ # a \ followed by some spaces + EOL
27
+ _COLLAPSE_PATTERN = re.compile('\\\\w*\n', re.M)
28
+ _COMMENTED_LINE = re.compile('#.*?(?=\n)|\n(?=$)', re.M | re.S)
29
+
30
+ #
31
+ # Due to the different results returned by fnmatch.translate, we need
32
+ # to do slightly different processing for Python 2.7 and 3.2 ... this needed
33
+ # to be brought in for Python 3.6 onwards.
34
+ #
35
+ _PYTHON_VERSION = sys.version_info[:2]
36
+
37
+ class Manifest(object):
38
+ """A list of files built by on exploring the filesystem and filtered by
39
+ applying various patterns to what we find there.
40
+ """
41
+
42
+ def __init__(self, base=None):
43
+ """
44
+ Initialise an instance.
45
+
46
+ :param base: The base directory to explore under.
47
+ """
48
+ self.base = os.path.abspath(os.path.normpath(base or os.getcwd()))
49
+ self.prefix = self.base + os.sep
50
+ self.allfiles = None
51
+ self.files = set()
52
+
53
+ #
54
+ # Public API
55
+ #
56
+
57
+ def findall(self):
58
+ """Find all files under the base and set ``allfiles`` to the absolute
59
+ pathnames of files found.
60
+ """
61
+ from stat import S_ISREG, S_ISDIR, S_ISLNK
62
+
63
+ self.allfiles = allfiles = []
64
+ root = self.base
65
+ stack = [root]
66
+ pop = stack.pop
67
+ push = stack.append
68
+
69
+ while stack:
70
+ root = pop()
71
+ names = os.listdir(root)
72
+
73
+ for name in names:
74
+ fullname = os.path.join(root, name)
75
+
76
+ # Avoid excess stat calls -- just one will do, thank you!
77
+ stat = os.stat(fullname)
78
+ mode = stat.st_mode
79
+ if S_ISREG(mode):
80
+ allfiles.append(fsdecode(fullname))
81
+ elif S_ISDIR(mode) and not S_ISLNK(mode):
82
+ push(fullname)
83
+
84
+ def add(self, item):
85
+ """
86
+ Add a file to the manifest.
87
+
88
+ :param item: The pathname to add. This can be relative to the base.
89
+ """
90
+ if not item.startswith(self.prefix):
91
+ item = os.path.join(self.base, item)
92
+ self.files.add(os.path.normpath(item))
93
+
94
+ def add_many(self, items):
95
+ """
96
+ Add a list of files to the manifest.
97
+
98
+ :param items: The pathnames to add. These can be relative to the base.
99
+ """
100
+ for item in items:
101
+ self.add(item)
102
+
103
+ def sorted(self, wantdirs=False):
104
+ """
105
+ Return sorted files in directory order
106
+ """
107
+
108
+ def add_dir(dirs, d):
109
+ dirs.add(d)
110
+ logger.debug('add_dir added %s', d)
111
+ if d != self.base:
112
+ parent, _ = os.path.split(d)
113
+ assert parent not in ('', '/')
114
+ add_dir(dirs, parent)
115
+
116
+ result = set(self.files) # make a copy!
117
+ if wantdirs:
118
+ dirs = set()
119
+ for f in result:
120
+ add_dir(dirs, os.path.dirname(f))
121
+ result |= dirs
122
+ return [os.path.join(*path_tuple) for path_tuple in
123
+ sorted(os.path.split(path) for path in result)]
124
+
125
+ def clear(self):
126
+ """Clear all collected files."""
127
+ self.files = set()
128
+ self.allfiles = []
129
+
130
+ def process_directive(self, directive):
131
+ """
132
+ Process a directive which either adds some files from ``allfiles`` to
133
+ ``files``, or removes some files from ``files``.
134
+
135
+ :param directive: The directive to process. This should be in a format
136
+ compatible with distutils ``MANIFEST.in`` files:
137
+
138
+ http://docs.python.org/distutils/sourcedist.html#commands
139
+ """
140
+ # Parse the line: split it up, make sure the right number of words
141
+ # is there, and return the relevant words. 'action' is always
142
+ # defined: it's the first word of the line. Which of the other
143
+ # three are defined depends on the action; it'll be either
144
+ # patterns, (dir and patterns), or (dirpattern).
145
+ action, patterns, thedir, dirpattern = self._parse_directive(directive)
146
+
147
+ # OK, now we know that the action is valid and we have the
148
+ # right number of words on the line for that action -- so we
149
+ # can proceed with minimal error-checking.
150
+ if action == 'include':
151
+ for pattern in patterns:
152
+ if not self._include_pattern(pattern, anchor=True):
153
+ logger.warning('no files found matching %r', pattern)
154
+
155
+ elif action == 'exclude':
156
+ for pattern in patterns:
157
+ found = self._exclude_pattern(pattern, anchor=True)
158
+ #if not found:
159
+ # logger.warning('no previously-included files '
160
+ # 'found matching %r', pattern)
161
+
162
+ elif action == 'global-include':
163
+ for pattern in patterns:
164
+ if not self._include_pattern(pattern, anchor=False):
165
+ logger.warning('no files found matching %r '
166
+ 'anywhere in distribution', pattern)
167
+
168
+ elif action == 'global-exclude':
169
+ for pattern in patterns:
170
+ found = self._exclude_pattern(pattern, anchor=False)
171
+ #if not found:
172
+ # logger.warning('no previously-included files '
173
+ # 'matching %r found anywhere in '
174
+ # 'distribution', pattern)
175
+
176
+ elif action == 'recursive-include':
177
+ for pattern in patterns:
178
+ if not self._include_pattern(pattern, prefix=thedir):
179
+ logger.warning('no files found matching %r '
180
+ 'under directory %r', pattern, thedir)
181
+
182
+ elif action == 'recursive-exclude':
183
+ for pattern in patterns:
184
+ found = self._exclude_pattern(pattern, prefix=thedir)
185
+ #if not found:
186
+ # logger.warning('no previously-included files '
187
+ # 'matching %r found under directory %r',
188
+ # pattern, thedir)
189
+
190
+ elif action == 'graft':
191
+ if not self._include_pattern(None, prefix=dirpattern):
192
+ logger.warning('no directories found matching %r',
193
+ dirpattern)
194
+
195
+ elif action == 'prune':
196
+ if not self._exclude_pattern(None, prefix=dirpattern):
197
+ logger.warning('no previously-included directories found '
198
+ 'matching %r', dirpattern)
199
+ else: # pragma: no cover
200
+ # This should never happen, as it should be caught in
201
+ # _parse_template_line
202
+ raise DistlibException(
203
+ 'invalid action %r' % action)
204
+
205
+ #
206
+ # Private API
207
+ #
208
+
209
+ def _parse_directive(self, directive):
210
+ """
211
+ Validate a directive.
212
+ :param directive: The directive to validate.
213
+ :return: A tuple of action, patterns, thedir, dir_patterns
214
+ """
215
+ words = directive.split()
216
+ if len(words) == 1 and words[0] not in ('include', 'exclude',
217
+ 'global-include',
218
+ 'global-exclude',
219
+ 'recursive-include',
220
+ 'recursive-exclude',
221
+ 'graft', 'prune'):
222
+ # no action given, let's use the default 'include'
223
+ words.insert(0, 'include')
224
+
225
+ action = words[0]
226
+ patterns = thedir = dir_pattern = None
227
+
228
+ if action in ('include', 'exclude',
229
+ 'global-include', 'global-exclude'):
230
+ if len(words) < 2:
231
+ raise DistlibException(
232
+ '%r expects <pattern1> <pattern2> ...' % action)
233
+
234
+ patterns = [convert_path(word) for word in words[1:]]
235
+
236
+ elif action in ('recursive-include', 'recursive-exclude'):
237
+ if len(words) < 3:
238
+ raise DistlibException(
239
+ '%r expects <dir> <pattern1> <pattern2> ...' % action)
240
+
241
+ thedir = convert_path(words[1])
242
+ patterns = [convert_path(word) for word in words[2:]]
243
+
244
+ elif action in ('graft', 'prune'):
245
+ if len(words) != 2:
246
+ raise DistlibException(
247
+ '%r expects a single <dir_pattern>' % action)
248
+
249
+ dir_pattern = convert_path(words[1])
250
+
251
+ else:
252
+ raise DistlibException('unknown action %r' % action)
253
+
254
+ return action, patterns, thedir, dir_pattern
255
+
256
+ def _include_pattern(self, pattern, anchor=True, prefix=None,
257
+ is_regex=False):
258
+ """Select strings (presumably filenames) from 'self.files' that
259
+ match 'pattern', a Unix-style wildcard (glob) pattern.
260
+
261
+ Patterns are not quite the same as implemented by the 'fnmatch'
262
+ module: '*' and '?' match non-special characters, where "special"
263
+ is platform-dependent: slash on Unix; colon, slash, and backslash on
264
+ DOS/Windows; and colon on Mac OS.
265
+
266
+ If 'anchor' is true (the default), then the pattern match is more
267
+ stringent: "*.py" will match "foo.py" but not "foo/bar.py". If
268
+ 'anchor' is false, both of these will match.
269
+
270
+ If 'prefix' is supplied, then only filenames starting with 'prefix'
271
+ (itself a pattern) and ending with 'pattern', with anything in between
272
+ them, will match. 'anchor' is ignored in this case.
273
+
274
+ If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
275
+ 'pattern' is assumed to be either a string containing a regex or a
276
+ regex object -- no translation is done, the regex is just compiled
277
+ and used as-is.
278
+
279
+ Selected strings will be added to self.files.
280
+
281
+ Return True if files are found.
282
+ """
283
+ # XXX docstring lying about what the special chars are?
284
+ found = False
285
+ pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex)
286
+
287
+ # delayed loading of allfiles list
288
+ if self.allfiles is None:
289
+ self.findall()
290
+
291
+ for name in self.allfiles:
292
+ if pattern_re.search(name):
293
+ self.files.add(name)
294
+ found = True
295
+ return found
296
+
297
+ def _exclude_pattern(self, pattern, anchor=True, prefix=None,
298
+ is_regex=False):
299
+ """Remove strings (presumably filenames) from 'files' that match
300
+ 'pattern'.
301
+
302
+ Other parameters are the same as for 'include_pattern()', above.
303
+ The list 'self.files' is modified in place. Return True if files are
304
+ found.
305
+
306
+ This API is public to allow e.g. exclusion of SCM subdirs, e.g. when
307
+ packaging source distributions
308
+ """
309
+ found = False
310
+ pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex)
311
+ for f in list(self.files):
312
+ if pattern_re.search(f):
313
+ self.files.remove(f)
314
+ found = True
315
+ return found
316
+
317
+ def _translate_pattern(self, pattern, anchor=True, prefix=None,
318
+ is_regex=False):
319
+ """Translate a shell-like wildcard pattern to a compiled regular
320
+ expression.
321
+
322
+ Return the compiled regex. If 'is_regex' true,
323
+ then 'pattern' is directly compiled to a regex (if it's a string)
324
+ or just returned as-is (assumes it's a regex object).
325
+ """
326
+ if is_regex:
327
+ if isinstance(pattern, str):
328
+ return re.compile(pattern)
329
+ else:
330
+ return pattern
331
+
332
+ if _PYTHON_VERSION > (3, 2):
333
+ # ditch start and end characters
334
+ start, _, end = self._glob_to_re('_').partition('_')
335
+
336
+ if pattern:
337
+ pattern_re = self._glob_to_re(pattern)
338
+ if _PYTHON_VERSION > (3, 2):
339
+ assert pattern_re.startswith(start) and pattern_re.endswith(end)
340
+ else:
341
+ pattern_re = ''
342
+
343
+ base = re.escape(os.path.join(self.base, ''))
344
+ if prefix is not None:
345
+ # ditch end of pattern character
346
+ if _PYTHON_VERSION <= (3, 2):
347
+ empty_pattern = self._glob_to_re('')
348
+ prefix_re = self._glob_to_re(prefix)[:-len(empty_pattern)]
349
+ else:
350
+ prefix_re = self._glob_to_re(prefix)
351
+ assert prefix_re.startswith(start) and prefix_re.endswith(end)
352
+ prefix_re = prefix_re[len(start): len(prefix_re) - len(end)]
353
+ sep = os.sep
354
+ if os.sep == '\\':
355
+ sep = r'\\'
356
+ if _PYTHON_VERSION <= (3, 2):
357
+ pattern_re = '^' + base + sep.join((prefix_re,
358
+ '.*' + pattern_re))
359
+ else:
360
+ pattern_re = pattern_re[len(start): len(pattern_re) - len(end)]
361
+ pattern_re = r'%s%s%s%s.*%s%s' % (start, base, prefix_re, sep,
362
+ pattern_re, end)
363
+ else: # no prefix -- respect anchor flag
364
+ if anchor:
365
+ if _PYTHON_VERSION <= (3, 2):
366
+ pattern_re = '^' + base + pattern_re
367
+ else:
368
+ pattern_re = r'%s%s%s' % (start, base, pattern_re[len(start):])
369
+
370
+ return re.compile(pattern_re)
371
+
372
+ def _glob_to_re(self, pattern):
373
+ """Translate a shell-like glob pattern to a regular expression.
374
+
375
+ Return a string containing the regex. Differs from
376
+ 'fnmatch.translate()' in that '*' does not match "special characters"
377
+ (which are platform-specific).
378
+ """
379
+ pattern_re = fnmatch.translate(pattern)
380
+
381
+ # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which
382
+ # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,
383
+ # and by extension they shouldn't match such "special characters" under
384
+ # any OS. So change all non-escaped dots in the RE to match any
385
+ # character except the special characters (currently: just os.sep).
386
+ sep = os.sep
387
+ if os.sep == '\\':
388
+ # we're using a regex to manipulate a regex, so we need
389
+ # to escape the backslash twice
390
+ sep = r'\\\\'
391
+ escaped = r'\1[^%s]' % sep
392
+ pattern_re = re.sub(r'((?<!\\)(\\\\)*)\.', escaped, pattern_re)
393
+ return pattern_re