rigid 0.2.0

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 (364) hide show
  1. checksums.yaml +7 -0
  2. data/bin/rigid +4 -0
  3. data/rigid +16 -0
  4. data/vendor/PyYAML-3.12.dist-info/DESCRIPTION.rst +12 -0
  5. data/vendor/PyYAML-3.12.dist-info/INSTALLER +1 -0
  6. data/vendor/PyYAML-3.12.dist-info/METADATA +35 -0
  7. data/vendor/PyYAML-3.12.dist-info/RECORD +42 -0
  8. data/vendor/PyYAML-3.12.dist-info/WHEEL +5 -0
  9. data/vendor/PyYAML-3.12.dist-info/metadata.json +1 -0
  10. data/vendor/PyYAML-3.12.dist-info/top_level.txt +2 -0
  11. data/vendor/_yaml.so +0 -0
  12. data/vendor/click/__init__.py +98 -0
  13. data/vendor/click/__init__.pyc +0 -0
  14. data/vendor/click/_bashcomplete.py +83 -0
  15. data/vendor/click/_bashcomplete.pyc +0 -0
  16. data/vendor/click/_compat.py +642 -0
  17. data/vendor/click/_compat.pyc +0 -0
  18. data/vendor/click/_termui_impl.py +547 -0
  19. data/vendor/click/_termui_impl.pyc +0 -0
  20. data/vendor/click/_textwrap.py +38 -0
  21. data/vendor/click/_textwrap.pyc +0 -0
  22. data/vendor/click/_unicodefun.py +119 -0
  23. data/vendor/click/_unicodefun.pyc +0 -0
  24. data/vendor/click/_winconsole.py +273 -0
  25. data/vendor/click/_winconsole.pyc +0 -0
  26. data/vendor/click/core.py +1738 -0
  27. data/vendor/click/core.pyc +0 -0
  28. data/vendor/click/decorators.py +304 -0
  29. data/vendor/click/decorators.pyc +0 -0
  30. data/vendor/click/exceptions.py +201 -0
  31. data/vendor/click/exceptions.pyc +0 -0
  32. data/vendor/click/formatting.py +256 -0
  33. data/vendor/click/formatting.pyc +0 -0
  34. data/vendor/click/globals.py +48 -0
  35. data/vendor/click/globals.pyc +0 -0
  36. data/vendor/click/parser.py +426 -0
  37. data/vendor/click/parser.pyc +0 -0
  38. data/vendor/click/termui.py +539 -0
  39. data/vendor/click/termui.pyc +0 -0
  40. data/vendor/click/testing.py +322 -0
  41. data/vendor/click/testing.pyc +0 -0
  42. data/vendor/click/types.py +550 -0
  43. data/vendor/click/types.pyc +0 -0
  44. data/vendor/click/utils.py +415 -0
  45. data/vendor/click/utils.pyc +0 -0
  46. data/vendor/click-6.6.dist-info/DESCRIPTION.rst +3 -0
  47. data/vendor/click-6.6.dist-info/INSTALLER +1 -0
  48. data/vendor/click-6.6.dist-info/METADATA +16 -0
  49. data/vendor/click-6.6.dist-info/RECORD +41 -0
  50. data/vendor/click-6.6.dist-info/WHEEL +6 -0
  51. data/vendor/click-6.6.dist-info/metadata.json +1 -0
  52. data/vendor/click-6.6.dist-info/top_level.txt +1 -0
  53. data/vendor/easy_install.py +5 -0
  54. data/vendor/easy_install.pyc +0 -0
  55. data/vendor/pip-9.0.1.dist-info/DESCRIPTION.rst +39 -0
  56. data/vendor/pip-9.0.1.dist-info/INSTALLER +1 -0
  57. data/vendor/pip-9.0.1.dist-info/METADATA +69 -0
  58. data/vendor/pip-9.0.1.dist-info/RECORD +501 -0
  59. data/vendor/pip-9.0.1.dist-info/WHEEL +6 -0
  60. data/vendor/pip-9.0.1.dist-info/entry_points.txt +5 -0
  61. data/vendor/pip-9.0.1.dist-info/metadata.json +1 -0
  62. data/vendor/pip-9.0.1.dist-info/top_level.txt +1 -0
  63. data/vendor/pkg_resources/__init__.py +3051 -0
  64. data/vendor/pkg_resources/__init__.pyc +0 -0
  65. data/vendor/pkg_resources/_vendor/__init__.py +0 -0
  66. data/vendor/pkg_resources/_vendor/__init__.pyc +0 -0
  67. data/vendor/pkg_resources/_vendor/appdirs.py +552 -0
  68. data/vendor/pkg_resources/_vendor/appdirs.pyc +0 -0
  69. data/vendor/pkg_resources/_vendor/packaging/__about__.py +21 -0
  70. data/vendor/pkg_resources/_vendor/packaging/__about__.pyc +0 -0
  71. data/vendor/pkg_resources/_vendor/packaging/__init__.py +14 -0
  72. data/vendor/pkg_resources/_vendor/packaging/__init__.pyc +0 -0
  73. data/vendor/pkg_resources/_vendor/packaging/_compat.py +30 -0
  74. data/vendor/pkg_resources/_vendor/packaging/_compat.pyc +0 -0
  75. data/vendor/pkg_resources/_vendor/packaging/_structures.py +68 -0
  76. data/vendor/pkg_resources/_vendor/packaging/_structures.pyc +0 -0
  77. data/vendor/pkg_resources/_vendor/packaging/markers.py +287 -0
  78. data/vendor/pkg_resources/_vendor/packaging/markers.pyc +0 -0
  79. data/vendor/pkg_resources/_vendor/packaging/requirements.py +127 -0
  80. data/vendor/pkg_resources/_vendor/packaging/requirements.pyc +0 -0
  81. data/vendor/pkg_resources/_vendor/packaging/specifiers.py +774 -0
  82. data/vendor/pkg_resources/_vendor/packaging/specifiers.pyc +0 -0
  83. data/vendor/pkg_resources/_vendor/packaging/utils.py +14 -0
  84. data/vendor/pkg_resources/_vendor/packaging/utils.pyc +0 -0
  85. data/vendor/pkg_resources/_vendor/packaging/version.py +393 -0
  86. data/vendor/pkg_resources/_vendor/packaging/version.pyc +0 -0
  87. data/vendor/pkg_resources/_vendor/pyparsing.py +5696 -0
  88. data/vendor/pkg_resources/_vendor/pyparsing.pyc +0 -0
  89. data/vendor/pkg_resources/_vendor/six.py +868 -0
  90. data/vendor/pkg_resources/_vendor/six.pyc +0 -0
  91. data/vendor/pkg_resources/extern/__init__.py +73 -0
  92. data/vendor/pkg_resources/extern/__init__.pyc +0 -0
  93. data/vendor/requests/__init__.py +86 -0
  94. data/vendor/requests/__init__.pyc +0 -0
  95. data/vendor/requests/adapters.py +503 -0
  96. data/vendor/requests/adapters.pyc +0 -0
  97. data/vendor/requests/api.py +148 -0
  98. data/vendor/requests/api.pyc +0 -0
  99. data/vendor/requests/auth.py +252 -0
  100. data/vendor/requests/auth.pyc +0 -0
  101. data/vendor/requests/cacert.pem +5616 -0
  102. data/vendor/requests/certs.py +25 -0
  103. data/vendor/requests/certs.pyc +0 -0
  104. data/vendor/requests/compat.py +66 -0
  105. data/vendor/requests/compat.pyc +0 -0
  106. data/vendor/requests/cookies.py +540 -0
  107. data/vendor/requests/cookies.pyc +0 -0
  108. data/vendor/requests/exceptions.py +114 -0
  109. data/vendor/requests/exceptions.pyc +0 -0
  110. data/vendor/requests/hooks.py +34 -0
  111. data/vendor/requests/hooks.pyc +0 -0
  112. data/vendor/requests/models.py +873 -0
  113. data/vendor/requests/models.pyc +0 -0
  114. data/vendor/requests/packages/__init__.py +36 -0
  115. data/vendor/requests/packages/__init__.pyc +0 -0
  116. data/vendor/requests/packages/chardet/__init__.py +32 -0
  117. data/vendor/requests/packages/chardet/__init__.pyc +0 -0
  118. data/vendor/requests/packages/chardet/big5freq.py +925 -0
  119. data/vendor/requests/packages/chardet/big5freq.pyc +0 -0
  120. data/vendor/requests/packages/chardet/big5prober.py +42 -0
  121. data/vendor/requests/packages/chardet/big5prober.pyc +0 -0
  122. data/vendor/requests/packages/chardet/chardetect.py +80 -0
  123. data/vendor/requests/packages/chardet/chardetect.pyc +0 -0
  124. data/vendor/requests/packages/chardet/chardistribution.py +231 -0
  125. data/vendor/requests/packages/chardet/chardistribution.pyc +0 -0
  126. data/vendor/requests/packages/chardet/charsetgroupprober.py +106 -0
  127. data/vendor/requests/packages/chardet/charsetgroupprober.pyc +0 -0
  128. data/vendor/requests/packages/chardet/charsetprober.py +62 -0
  129. data/vendor/requests/packages/chardet/charsetprober.pyc +0 -0
  130. data/vendor/requests/packages/chardet/codingstatemachine.py +61 -0
  131. data/vendor/requests/packages/chardet/codingstatemachine.pyc +0 -0
  132. data/vendor/requests/packages/chardet/compat.py +34 -0
  133. data/vendor/requests/packages/chardet/compat.pyc +0 -0
  134. data/vendor/requests/packages/chardet/constants.py +39 -0
  135. data/vendor/requests/packages/chardet/constants.pyc +0 -0
  136. data/vendor/requests/packages/chardet/cp949prober.py +44 -0
  137. data/vendor/requests/packages/chardet/cp949prober.pyc +0 -0
  138. data/vendor/requests/packages/chardet/escprober.py +86 -0
  139. data/vendor/requests/packages/chardet/escprober.pyc +0 -0
  140. data/vendor/requests/packages/chardet/escsm.py +242 -0
  141. data/vendor/requests/packages/chardet/escsm.pyc +0 -0
  142. data/vendor/requests/packages/chardet/eucjpprober.py +90 -0
  143. data/vendor/requests/packages/chardet/eucjpprober.pyc +0 -0
  144. data/vendor/requests/packages/chardet/euckrfreq.py +596 -0
  145. data/vendor/requests/packages/chardet/euckrfreq.pyc +0 -0
  146. data/vendor/requests/packages/chardet/euckrprober.py +42 -0
  147. data/vendor/requests/packages/chardet/euckrprober.pyc +0 -0
  148. data/vendor/requests/packages/chardet/euctwfreq.py +428 -0
  149. data/vendor/requests/packages/chardet/euctwfreq.pyc +0 -0
  150. data/vendor/requests/packages/chardet/euctwprober.py +41 -0
  151. data/vendor/requests/packages/chardet/euctwprober.pyc +0 -0
  152. data/vendor/requests/packages/chardet/gb2312freq.py +472 -0
  153. data/vendor/requests/packages/chardet/gb2312freq.pyc +0 -0
  154. data/vendor/requests/packages/chardet/gb2312prober.py +41 -0
  155. data/vendor/requests/packages/chardet/gb2312prober.pyc +0 -0
  156. data/vendor/requests/packages/chardet/hebrewprober.py +283 -0
  157. data/vendor/requests/packages/chardet/hebrewprober.pyc +0 -0
  158. data/vendor/requests/packages/chardet/jisfreq.py +569 -0
  159. data/vendor/requests/packages/chardet/jisfreq.pyc +0 -0
  160. data/vendor/requests/packages/chardet/jpcntx.py +227 -0
  161. data/vendor/requests/packages/chardet/jpcntx.pyc +0 -0
  162. data/vendor/requests/packages/chardet/langbulgarianmodel.py +229 -0
  163. data/vendor/requests/packages/chardet/langbulgarianmodel.pyc +0 -0
  164. data/vendor/requests/packages/chardet/langcyrillicmodel.py +329 -0
  165. data/vendor/requests/packages/chardet/langcyrillicmodel.pyc +0 -0
  166. data/vendor/requests/packages/chardet/langgreekmodel.py +225 -0
  167. data/vendor/requests/packages/chardet/langgreekmodel.pyc +0 -0
  168. data/vendor/requests/packages/chardet/langhebrewmodel.py +201 -0
  169. data/vendor/requests/packages/chardet/langhebrewmodel.pyc +0 -0
  170. data/vendor/requests/packages/chardet/langhungarianmodel.py +225 -0
  171. data/vendor/requests/packages/chardet/langhungarianmodel.pyc +0 -0
  172. data/vendor/requests/packages/chardet/langthaimodel.py +200 -0
  173. data/vendor/requests/packages/chardet/langthaimodel.pyc +0 -0
  174. data/vendor/requests/packages/chardet/latin1prober.py +139 -0
  175. data/vendor/requests/packages/chardet/latin1prober.pyc +0 -0
  176. data/vendor/requests/packages/chardet/mbcharsetprober.py +86 -0
  177. data/vendor/requests/packages/chardet/mbcharsetprober.pyc +0 -0
  178. data/vendor/requests/packages/chardet/mbcsgroupprober.py +54 -0
  179. data/vendor/requests/packages/chardet/mbcsgroupprober.pyc +0 -0
  180. data/vendor/requests/packages/chardet/mbcssm.py +572 -0
  181. data/vendor/requests/packages/chardet/mbcssm.pyc +0 -0
  182. data/vendor/requests/packages/chardet/sbcharsetprober.py +120 -0
  183. data/vendor/requests/packages/chardet/sbcharsetprober.pyc +0 -0
  184. data/vendor/requests/packages/chardet/sbcsgroupprober.py +69 -0
  185. data/vendor/requests/packages/chardet/sbcsgroupprober.pyc +0 -0
  186. data/vendor/requests/packages/chardet/sjisprober.py +91 -0
  187. data/vendor/requests/packages/chardet/sjisprober.pyc +0 -0
  188. data/vendor/requests/packages/chardet/universaldetector.py +170 -0
  189. data/vendor/requests/packages/chardet/universaldetector.pyc +0 -0
  190. data/vendor/requests/packages/chardet/utf8prober.py +76 -0
  191. data/vendor/requests/packages/chardet/utf8prober.pyc +0 -0
  192. data/vendor/requests/packages/urllib3/__init__.py +96 -0
  193. data/vendor/requests/packages/urllib3/__init__.pyc +0 -0
  194. data/vendor/requests/packages/urllib3/_collections.py +324 -0
  195. data/vendor/requests/packages/urllib3/_collections.pyc +0 -0
  196. data/vendor/requests/packages/urllib3/connection.py +330 -0
  197. data/vendor/requests/packages/urllib3/connection.pyc +0 -0
  198. data/vendor/requests/packages/urllib3/connectionpool.py +866 -0
  199. data/vendor/requests/packages/urllib3/connectionpool.pyc +0 -0
  200. data/vendor/requests/packages/urllib3/contrib/__init__.py +0 -0
  201. data/vendor/requests/packages/urllib3/contrib/__init__.pyc +0 -0
  202. data/vendor/requests/packages/urllib3/contrib/appengine.py +231 -0
  203. data/vendor/requests/packages/urllib3/contrib/appengine.pyc +0 -0
  204. data/vendor/requests/packages/urllib3/contrib/ntlmpool.py +115 -0
  205. data/vendor/requests/packages/urllib3/contrib/ntlmpool.pyc +0 -0
  206. data/vendor/requests/packages/urllib3/contrib/pyopenssl.py +358 -0
  207. data/vendor/requests/packages/urllib3/contrib/pyopenssl.pyc +0 -0
  208. data/vendor/requests/packages/urllib3/contrib/socks.py +172 -0
  209. data/vendor/requests/packages/urllib3/contrib/socks.pyc +0 -0
  210. data/vendor/requests/packages/urllib3/exceptions.py +209 -0
  211. data/vendor/requests/packages/urllib3/exceptions.pyc +0 -0
  212. data/vendor/requests/packages/urllib3/fields.py +178 -0
  213. data/vendor/requests/packages/urllib3/fields.pyc +0 -0
  214. data/vendor/requests/packages/urllib3/filepost.py +94 -0
  215. data/vendor/requests/packages/urllib3/filepost.pyc +0 -0
  216. data/vendor/requests/packages/urllib3/packages/__init__.py +5 -0
  217. data/vendor/requests/packages/urllib3/packages/__init__.pyc +0 -0
  218. data/vendor/requests/packages/urllib3/packages/ordered_dict.py +259 -0
  219. data/vendor/requests/packages/urllib3/packages/ordered_dict.pyc +0 -0
  220. data/vendor/requests/packages/urllib3/packages/six.py +868 -0
  221. data/vendor/requests/packages/urllib3/packages/six.pyc +0 -0
  222. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py +13 -0
  223. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyc +0 -0
  224. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py +105 -0
  225. data/vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyc +0 -0
  226. data/vendor/requests/packages/urllib3/poolmanager.py +367 -0
  227. data/vendor/requests/packages/urllib3/poolmanager.pyc +0 -0
  228. data/vendor/requests/packages/urllib3/request.py +151 -0
  229. data/vendor/requests/packages/urllib3/request.pyc +0 -0
  230. data/vendor/requests/packages/urllib3/response.py +530 -0
  231. data/vendor/requests/packages/urllib3/response.pyc +0 -0
  232. data/vendor/requests/packages/urllib3/util/__init__.py +46 -0
  233. data/vendor/requests/packages/urllib3/util/__init__.pyc +0 -0
  234. data/vendor/requests/packages/urllib3/util/connection.py +144 -0
  235. data/vendor/requests/packages/urllib3/util/connection.pyc +0 -0
  236. data/vendor/requests/packages/urllib3/util/request.py +72 -0
  237. data/vendor/requests/packages/urllib3/util/request.pyc +0 -0
  238. data/vendor/requests/packages/urllib3/util/response.py +74 -0
  239. data/vendor/requests/packages/urllib3/util/response.pyc +0 -0
  240. data/vendor/requests/packages/urllib3/util/retry.py +300 -0
  241. data/vendor/requests/packages/urllib3/util/retry.pyc +0 -0
  242. data/vendor/requests/packages/urllib3/util/ssl_.py +320 -0
  243. data/vendor/requests/packages/urllib3/util/ssl_.pyc +0 -0
  244. data/vendor/requests/packages/urllib3/util/timeout.py +242 -0
  245. data/vendor/requests/packages/urllib3/util/timeout.pyc +0 -0
  246. data/vendor/requests/packages/urllib3/util/url.py +217 -0
  247. data/vendor/requests/packages/urllib3/util/url.pyc +0 -0
  248. data/vendor/requests/sessions.py +712 -0
  249. data/vendor/requests/sessions.pyc +0 -0
  250. data/vendor/requests/status_codes.py +91 -0
  251. data/vendor/requests/status_codes.pyc +0 -0
  252. data/vendor/requests/structures.py +105 -0
  253. data/vendor/requests/structures.pyc +0 -0
  254. data/vendor/requests/utils.py +817 -0
  255. data/vendor/requests/utils.pyc +0 -0
  256. data/vendor/requests-2.11.1.dist-info/DESCRIPTION.rst +1294 -0
  257. data/vendor/requests-2.11.1.dist-info/INSTALLER +1 -0
  258. data/vendor/requests-2.11.1.dist-info/METADATA +1323 -0
  259. data/vendor/requests-2.11.1.dist-info/RECORD +170 -0
  260. data/vendor/requests-2.11.1.dist-info/WHEEL +6 -0
  261. data/vendor/requests-2.11.1.dist-info/metadata.json +1 -0
  262. data/vendor/requests-2.11.1.dist-info/top_level.txt +1 -0
  263. data/vendor/rigid/__init__.py +1 -0
  264. data/vendor/rigid/__init__.pyc +0 -0
  265. data/vendor/rigid/api.py +129 -0
  266. data/vendor/rigid/api.pyc +0 -0
  267. data/vendor/rigid/commands/__init__.py +260 -0
  268. data/vendor/rigid/commands/__init__.pyc +0 -0
  269. data/vendor/rigid/commands/deploy.py +0 -0
  270. data/vendor/rigid/commands/deploy.pyc +0 -0
  271. data/vendor/rigid/deploy.py +70 -0
  272. data/vendor/rigid/deploy.pyc +0 -0
  273. data/vendor/rigid/file_scanner.py +63 -0
  274. data/vendor/rigid/file_scanner.pyc +0 -0
  275. data/vendor/rigid/utils.py +17 -0
  276. data/vendor/rigid/utils.pyc +0 -0
  277. data/vendor/rigid-0.2.0.dist-info/DESCRIPTION.rst +3 -0
  278. data/vendor/rigid-0.2.0.dist-info/INSTALLER +1 -0
  279. data/vendor/rigid-0.2.0.dist-info/METADATA +23 -0
  280. data/vendor/rigid-0.2.0.dist-info/RECORD +49 -0
  281. data/vendor/rigid-0.2.0.dist-info/WHEEL +5 -0
  282. data/vendor/rigid-0.2.0.dist-info/entry_points.txt +3 -0
  283. data/vendor/rigid-0.2.0.dist-info/metadata.json +1 -0
  284. data/vendor/rigid-0.2.0.dist-info/top_level.txt +2 -0
  285. data/vendor/setuptools-28.8.0.dist-info/DESCRIPTION.rst +243 -0
  286. data/vendor/setuptools-28.8.0.dist-info/INSTALLER +1 -0
  287. data/vendor/setuptools-28.8.0.dist-info/METADATA +272 -0
  288. data/vendor/setuptools-28.8.0.dist-info/RECORD +143 -0
  289. data/vendor/setuptools-28.8.0.dist-info/WHEEL +6 -0
  290. data/vendor/setuptools-28.8.0.dist-info/dependency_links.txt +2 -0
  291. data/vendor/setuptools-28.8.0.dist-info/entry_points.txt +63 -0
  292. data/vendor/setuptools-28.8.0.dist-info/metadata.json +1 -0
  293. data/vendor/setuptools-28.8.0.dist-info/top_level.txt +3 -0
  294. data/vendor/setuptools-28.8.0.dist-info/zip-safe +1 -0
  295. data/vendor/tests/__init__.py +0 -0
  296. data/vendor/tests/__init__.pyc +0 -0
  297. data/vendor/tests/integration/__init__.py +0 -0
  298. data/vendor/tests/integration/__init__.pyc +0 -0
  299. data/vendor/tests/integration/test_app.py +63 -0
  300. data/vendor/tests/integration/test_app.pyc +0 -0
  301. data/vendor/tests/integration/test_apps.py +27 -0
  302. data/vendor/tests/integration/test_apps.pyc +0 -0
  303. data/vendor/tests/integration/test_deploy.py +128 -0
  304. data/vendor/tests/integration/test_deploy.pyc +0 -0
  305. data/vendor/tests/integration/test_domains.py +35 -0
  306. data/vendor/tests/integration/test_domains.pyc +0 -0
  307. data/vendor/tests/integration/test_login.py +37 -0
  308. data/vendor/tests/integration/test_login.pyc +0 -0
  309. data/vendor/tests/integration/test_promote.py +24 -0
  310. data/vendor/tests/integration/test_promote.pyc +0 -0
  311. data/vendor/tests/integration/test_token.py +33 -0
  312. data/vendor/tests/integration/test_token.pyc +0 -0
  313. data/vendor/tests/integration/test_whoami.py +24 -0
  314. data/vendor/tests/integration/test_whoami.pyc +0 -0
  315. data/vendor/tests/test_deploy.py +33 -0
  316. data/vendor/tests/test_deploy.pyc +0 -0
  317. data/vendor/tests/test_file_scanner.py +89 -0
  318. data/vendor/tests/test_file_scanner.pyc +0 -0
  319. data/vendor/tests/utils.py +78 -0
  320. data/vendor/tests/utils.pyc +0 -0
  321. data/vendor/wheel-0.30.0a0.dist-info/DESCRIPTION.rst +325 -0
  322. data/vendor/wheel-0.30.0a0.dist-info/INSTALLER +1 -0
  323. data/vendor/wheel-0.30.0a0.dist-info/LICENSE.txt +22 -0
  324. data/vendor/wheel-0.30.0a0.dist-info/METADATA +357 -0
  325. data/vendor/wheel-0.30.0a0.dist-info/RECORD +86 -0
  326. data/vendor/wheel-0.30.0a0.dist-info/WHEEL +6 -0
  327. data/vendor/wheel-0.30.0a0.dist-info/entry_points.txt +6 -0
  328. data/vendor/wheel-0.30.0a0.dist-info/metadata.json +1 -0
  329. data/vendor/wheel-0.30.0a0.dist-info/top_level.txt +1 -0
  330. data/vendor/yaml/__init__.py +315 -0
  331. data/vendor/yaml/__init__.pyc +0 -0
  332. data/vendor/yaml/composer.py +139 -0
  333. data/vendor/yaml/composer.pyc +0 -0
  334. data/vendor/yaml/constructor.py +675 -0
  335. data/vendor/yaml/constructor.pyc +0 -0
  336. data/vendor/yaml/cyaml.py +85 -0
  337. data/vendor/yaml/cyaml.pyc +0 -0
  338. data/vendor/yaml/dumper.py +62 -0
  339. data/vendor/yaml/dumper.pyc +0 -0
  340. data/vendor/yaml/emitter.py +1140 -0
  341. data/vendor/yaml/emitter.pyc +0 -0
  342. data/vendor/yaml/error.py +75 -0
  343. data/vendor/yaml/error.pyc +0 -0
  344. data/vendor/yaml/events.py +86 -0
  345. data/vendor/yaml/events.pyc +0 -0
  346. data/vendor/yaml/loader.py +40 -0
  347. data/vendor/yaml/loader.pyc +0 -0
  348. data/vendor/yaml/nodes.py +49 -0
  349. data/vendor/yaml/nodes.pyc +0 -0
  350. data/vendor/yaml/parser.py +589 -0
  351. data/vendor/yaml/parser.pyc +0 -0
  352. data/vendor/yaml/reader.py +190 -0
  353. data/vendor/yaml/reader.pyc +0 -0
  354. data/vendor/yaml/representer.py +486 -0
  355. data/vendor/yaml/representer.pyc +0 -0
  356. data/vendor/yaml/resolver.py +227 -0
  357. data/vendor/yaml/resolver.pyc +0 -0
  358. data/vendor/yaml/scanner.py +1453 -0
  359. data/vendor/yaml/scanner.pyc +0 -0
  360. data/vendor/yaml/serializer.py +111 -0
  361. data/vendor/yaml/serializer.pyc +0 -0
  362. data/vendor/yaml/tokens.py +104 -0
  363. data/vendor/yaml/tokens.pyc +0 -0
  364. metadata +407 -0
@@ -0,0 +1,774 @@
1
+ # This file is dual licensed under the terms of the Apache License, Version
2
+ # 2.0, and the BSD License. See the LICENSE file in the root of this repository
3
+ # for complete details.
4
+ from __future__ import absolute_import, division, print_function
5
+
6
+ import abc
7
+ import functools
8
+ import itertools
9
+ import re
10
+
11
+ from ._compat import string_types, with_metaclass
12
+ from .version import Version, LegacyVersion, parse
13
+
14
+
15
+ class InvalidSpecifier(ValueError):
16
+ """
17
+ An invalid specifier was found, users should refer to PEP 440.
18
+ """
19
+
20
+
21
+ class BaseSpecifier(with_metaclass(abc.ABCMeta, object)):
22
+
23
+ @abc.abstractmethod
24
+ def __str__(self):
25
+ """
26
+ Returns the str representation of this Specifier like object. This
27
+ should be representative of the Specifier itself.
28
+ """
29
+
30
+ @abc.abstractmethod
31
+ def __hash__(self):
32
+ """
33
+ Returns a hash value for this Specifier like object.
34
+ """
35
+
36
+ @abc.abstractmethod
37
+ def __eq__(self, other):
38
+ """
39
+ Returns a boolean representing whether or not the two Specifier like
40
+ objects are equal.
41
+ """
42
+
43
+ @abc.abstractmethod
44
+ def __ne__(self, other):
45
+ """
46
+ Returns a boolean representing whether or not the two Specifier like
47
+ objects are not equal.
48
+ """
49
+
50
+ @abc.abstractproperty
51
+ def prereleases(self):
52
+ """
53
+ Returns whether or not pre-releases as a whole are allowed by this
54
+ specifier.
55
+ """
56
+
57
+ @prereleases.setter
58
+ def prereleases(self, value):
59
+ """
60
+ Sets whether or not pre-releases as a whole are allowed by this
61
+ specifier.
62
+ """
63
+
64
+ @abc.abstractmethod
65
+ def contains(self, item, prereleases=None):
66
+ """
67
+ Determines if the given item is contained within this specifier.
68
+ """
69
+
70
+ @abc.abstractmethod
71
+ def filter(self, iterable, prereleases=None):
72
+ """
73
+ Takes an iterable of items and filters them so that only items which
74
+ are contained within this specifier are allowed in it.
75
+ """
76
+
77
+
78
+ class _IndividualSpecifier(BaseSpecifier):
79
+
80
+ _operators = {}
81
+
82
+ def __init__(self, spec="", prereleases=None):
83
+ match = self._regex.search(spec)
84
+ if not match:
85
+ raise InvalidSpecifier("Invalid specifier: '{0}'".format(spec))
86
+
87
+ self._spec = (
88
+ match.group("operator").strip(),
89
+ match.group("version").strip(),
90
+ )
91
+
92
+ # Store whether or not this Specifier should accept prereleases
93
+ self._prereleases = prereleases
94
+
95
+ def __repr__(self):
96
+ pre = (
97
+ ", prereleases={0!r}".format(self.prereleases)
98
+ if self._prereleases is not None
99
+ else ""
100
+ )
101
+
102
+ return "<{0}({1!r}{2})>".format(
103
+ self.__class__.__name__,
104
+ str(self),
105
+ pre,
106
+ )
107
+
108
+ def __str__(self):
109
+ return "{0}{1}".format(*self._spec)
110
+
111
+ def __hash__(self):
112
+ return hash(self._spec)
113
+
114
+ def __eq__(self, other):
115
+ if isinstance(other, string_types):
116
+ try:
117
+ other = self.__class__(other)
118
+ except InvalidSpecifier:
119
+ return NotImplemented
120
+ elif not isinstance(other, self.__class__):
121
+ return NotImplemented
122
+
123
+ return self._spec == other._spec
124
+
125
+ def __ne__(self, other):
126
+ if isinstance(other, string_types):
127
+ try:
128
+ other = self.__class__(other)
129
+ except InvalidSpecifier:
130
+ return NotImplemented
131
+ elif not isinstance(other, self.__class__):
132
+ return NotImplemented
133
+
134
+ return self._spec != other._spec
135
+
136
+ def _get_operator(self, op):
137
+ return getattr(self, "_compare_{0}".format(self._operators[op]))
138
+
139
+ def _coerce_version(self, version):
140
+ if not isinstance(version, (LegacyVersion, Version)):
141
+ version = parse(version)
142
+ return version
143
+
144
+ @property
145
+ def operator(self):
146
+ return self._spec[0]
147
+
148
+ @property
149
+ def version(self):
150
+ return self._spec[1]
151
+
152
+ @property
153
+ def prereleases(self):
154
+ return self._prereleases
155
+
156
+ @prereleases.setter
157
+ def prereleases(self, value):
158
+ self._prereleases = value
159
+
160
+ def __contains__(self, item):
161
+ return self.contains(item)
162
+
163
+ def contains(self, item, prereleases=None):
164
+ # Determine if prereleases are to be allowed or not.
165
+ if prereleases is None:
166
+ prereleases = self.prereleases
167
+
168
+ # Normalize item to a Version or LegacyVersion, this allows us to have
169
+ # a shortcut for ``"2.0" in Specifier(">=2")
170
+ item = self._coerce_version(item)
171
+
172
+ # Determine if we should be supporting prereleases in this specifier
173
+ # or not, if we do not support prereleases than we can short circuit
174
+ # logic if this version is a prereleases.
175
+ if item.is_prerelease and not prereleases:
176
+ return False
177
+
178
+ # Actually do the comparison to determine if this item is contained
179
+ # within this Specifier or not.
180
+ return self._get_operator(self.operator)(item, self.version)
181
+
182
+ def filter(self, iterable, prereleases=None):
183
+ yielded = False
184
+ found_prereleases = []
185
+
186
+ kw = {"prereleases": prereleases if prereleases is not None else True}
187
+
188
+ # Attempt to iterate over all the values in the iterable and if any of
189
+ # them match, yield them.
190
+ for version in iterable:
191
+ parsed_version = self._coerce_version(version)
192
+
193
+ if self.contains(parsed_version, **kw):
194
+ # If our version is a prerelease, and we were not set to allow
195
+ # prereleases, then we'll store it for later incase nothing
196
+ # else matches this specifier.
197
+ if (parsed_version.is_prerelease and not
198
+ (prereleases or self.prereleases)):
199
+ found_prereleases.append(version)
200
+ # Either this is not a prerelease, or we should have been
201
+ # accepting prereleases from the begining.
202
+ else:
203
+ yielded = True
204
+ yield version
205
+
206
+ # Now that we've iterated over everything, determine if we've yielded
207
+ # any values, and if we have not and we have any prereleases stored up
208
+ # then we will go ahead and yield the prereleases.
209
+ if not yielded and found_prereleases:
210
+ for version in found_prereleases:
211
+ yield version
212
+
213
+
214
+ class LegacySpecifier(_IndividualSpecifier):
215
+
216
+ _regex_str = (
217
+ r"""
218
+ (?P<operator>(==|!=|<=|>=|<|>))
219
+ \s*
220
+ (?P<version>
221
+ [^,;\s)]* # Since this is a "legacy" specifier, and the version
222
+ # string can be just about anything, we match everything
223
+ # except for whitespace, a semi-colon for marker support,
224
+ # a closing paren since versions can be enclosed in
225
+ # them, and a comma since it's a version separator.
226
+ )
227
+ """
228
+ )
229
+
230
+ _regex = re.compile(
231
+ r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE)
232
+
233
+ _operators = {
234
+ "==": "equal",
235
+ "!=": "not_equal",
236
+ "<=": "less_than_equal",
237
+ ">=": "greater_than_equal",
238
+ "<": "less_than",
239
+ ">": "greater_than",
240
+ }
241
+
242
+ def _coerce_version(self, version):
243
+ if not isinstance(version, LegacyVersion):
244
+ version = LegacyVersion(str(version))
245
+ return version
246
+
247
+ def _compare_equal(self, prospective, spec):
248
+ return prospective == self._coerce_version(spec)
249
+
250
+ def _compare_not_equal(self, prospective, spec):
251
+ return prospective != self._coerce_version(spec)
252
+
253
+ def _compare_less_than_equal(self, prospective, spec):
254
+ return prospective <= self._coerce_version(spec)
255
+
256
+ def _compare_greater_than_equal(self, prospective, spec):
257
+ return prospective >= self._coerce_version(spec)
258
+
259
+ def _compare_less_than(self, prospective, spec):
260
+ return prospective < self._coerce_version(spec)
261
+
262
+ def _compare_greater_than(self, prospective, spec):
263
+ return prospective > self._coerce_version(spec)
264
+
265
+
266
+ def _require_version_compare(fn):
267
+ @functools.wraps(fn)
268
+ def wrapped(self, prospective, spec):
269
+ if not isinstance(prospective, Version):
270
+ return False
271
+ return fn(self, prospective, spec)
272
+ return wrapped
273
+
274
+
275
+ class Specifier(_IndividualSpecifier):
276
+
277
+ _regex_str = (
278
+ r"""
279
+ (?P<operator>(~=|==|!=|<=|>=|<|>|===))
280
+ (?P<version>
281
+ (?:
282
+ # The identity operators allow for an escape hatch that will
283
+ # do an exact string match of the version you wish to install.
284
+ # This will not be parsed by PEP 440 and we cannot determine
285
+ # any semantic meaning from it. This operator is discouraged
286
+ # but included entirely as an escape hatch.
287
+ (?<====) # Only match for the identity operator
288
+ \s*
289
+ [^\s]* # We just match everything, except for whitespace
290
+ # since we are only testing for strict identity.
291
+ )
292
+ |
293
+ (?:
294
+ # The (non)equality operators allow for wild card and local
295
+ # versions to be specified so we have to define these two
296
+ # operators separately to enable that.
297
+ (?<===|!=) # Only match for equals and not equals
298
+
299
+ \s*
300
+ v?
301
+ (?:[0-9]+!)? # epoch
302
+ [0-9]+(?:\.[0-9]+)* # release
303
+ (?: # pre release
304
+ [-_\.]?
305
+ (a|b|c|rc|alpha|beta|pre|preview)
306
+ [-_\.]?
307
+ [0-9]*
308
+ )?
309
+ (?: # post release
310
+ (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
311
+ )?
312
+
313
+ # You cannot use a wild card and a dev or local version
314
+ # together so group them with a | and make them optional.
315
+ (?:
316
+ (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release
317
+ (?:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local
318
+ |
319
+ \.\* # Wild card syntax of .*
320
+ )?
321
+ )
322
+ |
323
+ (?:
324
+ # The compatible operator requires at least two digits in the
325
+ # release segment.
326
+ (?<=~=) # Only match for the compatible operator
327
+
328
+ \s*
329
+ v?
330
+ (?:[0-9]+!)? # epoch
331
+ [0-9]+(?:\.[0-9]+)+ # release (We have a + instead of a *)
332
+ (?: # pre release
333
+ [-_\.]?
334
+ (a|b|c|rc|alpha|beta|pre|preview)
335
+ [-_\.]?
336
+ [0-9]*
337
+ )?
338
+ (?: # post release
339
+ (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
340
+ )?
341
+ (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release
342
+ )
343
+ |
344
+ (?:
345
+ # All other operators only allow a sub set of what the
346
+ # (non)equality operators do. Specifically they do not allow
347
+ # local versions to be specified nor do they allow the prefix
348
+ # matching wild cards.
349
+ (?<!==|!=|~=) # We have special cases for these
350
+ # operators so we want to make sure they
351
+ # don't match here.
352
+
353
+ \s*
354
+ v?
355
+ (?:[0-9]+!)? # epoch
356
+ [0-9]+(?:\.[0-9]+)* # release
357
+ (?: # pre release
358
+ [-_\.]?
359
+ (a|b|c|rc|alpha|beta|pre|preview)
360
+ [-_\.]?
361
+ [0-9]*
362
+ )?
363
+ (?: # post release
364
+ (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*)
365
+ )?
366
+ (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release
367
+ )
368
+ )
369
+ """
370
+ )
371
+
372
+ _regex = re.compile(
373
+ r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE)
374
+
375
+ _operators = {
376
+ "~=": "compatible",
377
+ "==": "equal",
378
+ "!=": "not_equal",
379
+ "<=": "less_than_equal",
380
+ ">=": "greater_than_equal",
381
+ "<": "less_than",
382
+ ">": "greater_than",
383
+ "===": "arbitrary",
384
+ }
385
+
386
+ @_require_version_compare
387
+ def _compare_compatible(self, prospective, spec):
388
+ # Compatible releases have an equivalent combination of >= and ==. That
389
+ # is that ~=2.2 is equivalent to >=2.2,==2.*. This allows us to
390
+ # implement this in terms of the other specifiers instead of
391
+ # implementing it ourselves. The only thing we need to do is construct
392
+ # the other specifiers.
393
+
394
+ # We want everything but the last item in the version, but we want to
395
+ # ignore post and dev releases and we want to treat the pre-release as
396
+ # it's own separate segment.
397
+ prefix = ".".join(
398
+ list(
399
+ itertools.takewhile(
400
+ lambda x: (not x.startswith("post") and not
401
+ x.startswith("dev")),
402
+ _version_split(spec),
403
+ )
404
+ )[:-1]
405
+ )
406
+
407
+ # Add the prefix notation to the end of our string
408
+ prefix += ".*"
409
+
410
+ return (self._get_operator(">=")(prospective, spec) and
411
+ self._get_operator("==")(prospective, prefix))
412
+
413
+ @_require_version_compare
414
+ def _compare_equal(self, prospective, spec):
415
+ # We need special logic to handle prefix matching
416
+ if spec.endswith(".*"):
417
+ # In the case of prefix matching we want to ignore local segment.
418
+ prospective = Version(prospective.public)
419
+ # Split the spec out by dots, and pretend that there is an implicit
420
+ # dot in between a release segment and a pre-release segment.
421
+ spec = _version_split(spec[:-2]) # Remove the trailing .*
422
+
423
+ # Split the prospective version out by dots, and pretend that there
424
+ # is an implicit dot in between a release segment and a pre-release
425
+ # segment.
426
+ prospective = _version_split(str(prospective))
427
+
428
+ # Shorten the prospective version to be the same length as the spec
429
+ # so that we can determine if the specifier is a prefix of the
430
+ # prospective version or not.
431
+ prospective = prospective[:len(spec)]
432
+
433
+ # Pad out our two sides with zeros so that they both equal the same
434
+ # length.
435
+ spec, prospective = _pad_version(spec, prospective)
436
+ else:
437
+ # Convert our spec string into a Version
438
+ spec = Version(spec)
439
+
440
+ # If the specifier does not have a local segment, then we want to
441
+ # act as if the prospective version also does not have a local
442
+ # segment.
443
+ if not spec.local:
444
+ prospective = Version(prospective.public)
445
+
446
+ return prospective == spec
447
+
448
+ @_require_version_compare
449
+ def _compare_not_equal(self, prospective, spec):
450
+ return not self._compare_equal(prospective, spec)
451
+
452
+ @_require_version_compare
453
+ def _compare_less_than_equal(self, prospective, spec):
454
+ return prospective <= Version(spec)
455
+
456
+ @_require_version_compare
457
+ def _compare_greater_than_equal(self, prospective, spec):
458
+ return prospective >= Version(spec)
459
+
460
+ @_require_version_compare
461
+ def _compare_less_than(self, prospective, spec):
462
+ # Convert our spec to a Version instance, since we'll want to work with
463
+ # it as a version.
464
+ spec = Version(spec)
465
+
466
+ # Check to see if the prospective version is less than the spec
467
+ # version. If it's not we can short circuit and just return False now
468
+ # instead of doing extra unneeded work.
469
+ if not prospective < spec:
470
+ return False
471
+
472
+ # This special case is here so that, unless the specifier itself
473
+ # includes is a pre-release version, that we do not accept pre-release
474
+ # versions for the version mentioned in the specifier (e.g. <3.1 should
475
+ # not match 3.1.dev0, but should match 3.0.dev0).
476
+ if not spec.is_prerelease and prospective.is_prerelease:
477
+ if Version(prospective.base_version) == Version(spec.base_version):
478
+ return False
479
+
480
+ # If we've gotten to here, it means that prospective version is both
481
+ # less than the spec version *and* it's not a pre-release of the same
482
+ # version in the spec.
483
+ return True
484
+
485
+ @_require_version_compare
486
+ def _compare_greater_than(self, prospective, spec):
487
+ # Convert our spec to a Version instance, since we'll want to work with
488
+ # it as a version.
489
+ spec = Version(spec)
490
+
491
+ # Check to see if the prospective version is greater than the spec
492
+ # version. If it's not we can short circuit and just return False now
493
+ # instead of doing extra unneeded work.
494
+ if not prospective > spec:
495
+ return False
496
+
497
+ # This special case is here so that, unless the specifier itself
498
+ # includes is a post-release version, that we do not accept
499
+ # post-release versions for the version mentioned in the specifier
500
+ # (e.g. >3.1 should not match 3.0.post0, but should match 3.2.post0).
501
+ if not spec.is_postrelease and prospective.is_postrelease:
502
+ if Version(prospective.base_version) == Version(spec.base_version):
503
+ return False
504
+
505
+ # Ensure that we do not allow a local version of the version mentioned
506
+ # in the specifier, which is techincally greater than, to match.
507
+ if prospective.local is not None:
508
+ if Version(prospective.base_version) == Version(spec.base_version):
509
+ return False
510
+
511
+ # If we've gotten to here, it means that prospective version is both
512
+ # greater than the spec version *and* it's not a pre-release of the
513
+ # same version in the spec.
514
+ return True
515
+
516
+ def _compare_arbitrary(self, prospective, spec):
517
+ return str(prospective).lower() == str(spec).lower()
518
+
519
+ @property
520
+ def prereleases(self):
521
+ # If there is an explicit prereleases set for this, then we'll just
522
+ # blindly use that.
523
+ if self._prereleases is not None:
524
+ return self._prereleases
525
+
526
+ # Look at all of our specifiers and determine if they are inclusive
527
+ # operators, and if they are if they are including an explicit
528
+ # prerelease.
529
+ operator, version = self._spec
530
+ if operator in ["==", ">=", "<=", "~=", "==="]:
531
+ # The == specifier can include a trailing .*, if it does we
532
+ # want to remove before parsing.
533
+ if operator == "==" and version.endswith(".*"):
534
+ version = version[:-2]
535
+
536
+ # Parse the version, and if it is a pre-release than this
537
+ # specifier allows pre-releases.
538
+ if parse(version).is_prerelease:
539
+ return True
540
+
541
+ return False
542
+
543
+ @prereleases.setter
544
+ def prereleases(self, value):
545
+ self._prereleases = value
546
+
547
+
548
+ _prefix_regex = re.compile(r"^([0-9]+)((?:a|b|c|rc)[0-9]+)$")
549
+
550
+
551
+ def _version_split(version):
552
+ result = []
553
+ for item in version.split("."):
554
+ match = _prefix_regex.search(item)
555
+ if match:
556
+ result.extend(match.groups())
557
+ else:
558
+ result.append(item)
559
+ return result
560
+
561
+
562
+ def _pad_version(left, right):
563
+ left_split, right_split = [], []
564
+
565
+ # Get the release segment of our versions
566
+ left_split.append(list(itertools.takewhile(lambda x: x.isdigit(), left)))
567
+ right_split.append(list(itertools.takewhile(lambda x: x.isdigit(), right)))
568
+
569
+ # Get the rest of our versions
570
+ left_split.append(left[len(left_split[0]):])
571
+ right_split.append(right[len(right_split[0]):])
572
+
573
+ # Insert our padding
574
+ left_split.insert(
575
+ 1,
576
+ ["0"] * max(0, len(right_split[0]) - len(left_split[0])),
577
+ )
578
+ right_split.insert(
579
+ 1,
580
+ ["0"] * max(0, len(left_split[0]) - len(right_split[0])),
581
+ )
582
+
583
+ return (
584
+ list(itertools.chain(*left_split)),
585
+ list(itertools.chain(*right_split)),
586
+ )
587
+
588
+
589
+ class SpecifierSet(BaseSpecifier):
590
+
591
+ def __init__(self, specifiers="", prereleases=None):
592
+ # Split on , to break each indidivual specifier into it's own item, and
593
+ # strip each item to remove leading/trailing whitespace.
594
+ specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
595
+
596
+ # Parsed each individual specifier, attempting first to make it a
597
+ # Specifier and falling back to a LegacySpecifier.
598
+ parsed = set()
599
+ for specifier in specifiers:
600
+ try:
601
+ parsed.add(Specifier(specifier))
602
+ except InvalidSpecifier:
603
+ parsed.add(LegacySpecifier(specifier))
604
+
605
+ # Turn our parsed specifiers into a frozen set and save them for later.
606
+ self._specs = frozenset(parsed)
607
+
608
+ # Store our prereleases value so we can use it later to determine if
609
+ # we accept prereleases or not.
610
+ self._prereleases = prereleases
611
+
612
+ def __repr__(self):
613
+ pre = (
614
+ ", prereleases={0!r}".format(self.prereleases)
615
+ if self._prereleases is not None
616
+ else ""
617
+ )
618
+
619
+ return "<SpecifierSet({0!r}{1})>".format(str(self), pre)
620
+
621
+ def __str__(self):
622
+ return ",".join(sorted(str(s) for s in self._specs))
623
+
624
+ def __hash__(self):
625
+ return hash(self._specs)
626
+
627
+ def __and__(self, other):
628
+ if isinstance(other, string_types):
629
+ other = SpecifierSet(other)
630
+ elif not isinstance(other, SpecifierSet):
631
+ return NotImplemented
632
+
633
+ specifier = SpecifierSet()
634
+ specifier._specs = frozenset(self._specs | other._specs)
635
+
636
+ if self._prereleases is None and other._prereleases is not None:
637
+ specifier._prereleases = other._prereleases
638
+ elif self._prereleases is not None and other._prereleases is None:
639
+ specifier._prereleases = self._prereleases
640
+ elif self._prereleases == other._prereleases:
641
+ specifier._prereleases = self._prereleases
642
+ else:
643
+ raise ValueError(
644
+ "Cannot combine SpecifierSets with True and False prerelease "
645
+ "overrides."
646
+ )
647
+
648
+ return specifier
649
+
650
+ def __eq__(self, other):
651
+ if isinstance(other, string_types):
652
+ other = SpecifierSet(other)
653
+ elif isinstance(other, _IndividualSpecifier):
654
+ other = SpecifierSet(str(other))
655
+ elif not isinstance(other, SpecifierSet):
656
+ return NotImplemented
657
+
658
+ return self._specs == other._specs
659
+
660
+ def __ne__(self, other):
661
+ if isinstance(other, string_types):
662
+ other = SpecifierSet(other)
663
+ elif isinstance(other, _IndividualSpecifier):
664
+ other = SpecifierSet(str(other))
665
+ elif not isinstance(other, SpecifierSet):
666
+ return NotImplemented
667
+
668
+ return self._specs != other._specs
669
+
670
+ def __len__(self):
671
+ return len(self._specs)
672
+
673
+ def __iter__(self):
674
+ return iter(self._specs)
675
+
676
+ @property
677
+ def prereleases(self):
678
+ # If we have been given an explicit prerelease modifier, then we'll
679
+ # pass that through here.
680
+ if self._prereleases is not None:
681
+ return self._prereleases
682
+
683
+ # If we don't have any specifiers, and we don't have a forced value,
684
+ # then we'll just return None since we don't know if this should have
685
+ # pre-releases or not.
686
+ if not self._specs:
687
+ return None
688
+
689
+ # Otherwise we'll see if any of the given specifiers accept
690
+ # prereleases, if any of them do we'll return True, otherwise False.
691
+ return any(s.prereleases for s in self._specs)
692
+
693
+ @prereleases.setter
694
+ def prereleases(self, value):
695
+ self._prereleases = value
696
+
697
+ def __contains__(self, item):
698
+ return self.contains(item)
699
+
700
+ def contains(self, item, prereleases=None):
701
+ # Ensure that our item is a Version or LegacyVersion instance.
702
+ if not isinstance(item, (LegacyVersion, Version)):
703
+ item = parse(item)
704
+
705
+ # Determine if we're forcing a prerelease or not, if we're not forcing
706
+ # one for this particular filter call, then we'll use whatever the
707
+ # SpecifierSet thinks for whether or not we should support prereleases.
708
+ if prereleases is None:
709
+ prereleases = self.prereleases
710
+
711
+ # We can determine if we're going to allow pre-releases by looking to
712
+ # see if any of the underlying items supports them. If none of them do
713
+ # and this item is a pre-release then we do not allow it and we can
714
+ # short circuit that here.
715
+ # Note: This means that 1.0.dev1 would not be contained in something
716
+ # like >=1.0.devabc however it would be in >=1.0.debabc,>0.0.dev0
717
+ if not prereleases and item.is_prerelease:
718
+ return False
719
+
720
+ # We simply dispatch to the underlying specs here to make sure that the
721
+ # given version is contained within all of them.
722
+ # Note: This use of all() here means that an empty set of specifiers
723
+ # will always return True, this is an explicit design decision.
724
+ return all(
725
+ s.contains(item, prereleases=prereleases)
726
+ for s in self._specs
727
+ )
728
+
729
+ def filter(self, iterable, prereleases=None):
730
+ # Determine if we're forcing a prerelease or not, if we're not forcing
731
+ # one for this particular filter call, then we'll use whatever the
732
+ # SpecifierSet thinks for whether or not we should support prereleases.
733
+ if prereleases is None:
734
+ prereleases = self.prereleases
735
+
736
+ # If we have any specifiers, then we want to wrap our iterable in the
737
+ # filter method for each one, this will act as a logical AND amongst
738
+ # each specifier.
739
+ if self._specs:
740
+ for spec in self._specs:
741
+ iterable = spec.filter(iterable, prereleases=bool(prereleases))
742
+ return iterable
743
+ # If we do not have any specifiers, then we need to have a rough filter
744
+ # which will filter out any pre-releases, unless there are no final
745
+ # releases, and which will filter out LegacyVersion in general.
746
+ else:
747
+ filtered = []
748
+ found_prereleases = []
749
+
750
+ for item in iterable:
751
+ # Ensure that we some kind of Version class for this item.
752
+ if not isinstance(item, (LegacyVersion, Version)):
753
+ parsed_version = parse(item)
754
+ else:
755
+ parsed_version = item
756
+
757
+ # Filter out any item which is parsed as a LegacyVersion
758
+ if isinstance(parsed_version, LegacyVersion):
759
+ continue
760
+
761
+ # Store any item which is a pre-release for later unless we've
762
+ # already found a final version or we are accepting prereleases
763
+ if parsed_version.is_prerelease and not prereleases:
764
+ if not filtered:
765
+ found_prereleases.append(item)
766
+ else:
767
+ filtered.append(item)
768
+
769
+ # If we've found no items except for pre-releases, then we'll go
770
+ # ahead and use the pre-releases
771
+ if not filtered and found_prereleases and prereleases is None:
772
+ return found_prereleases
773
+
774
+ return filtered