quarchpy 2.1.13.dev1__py2.py3-none-any.whl → 2.1.14__py2.py3-none-any.whl

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 (837) hide show
  1. quarchpy/.idea/.name +1 -1
  2. quarchpy/.idea/modules.xml +1 -0
  3. quarchpy/.idea/quarchpy.iml +4 -1
  4. quarchpy/.idea/workspace.xml +208 -11
  5. quarchpy/__pycache__/__init__.cpython-311.pyc +0 -0
  6. quarchpy/__pycache__/_version.cpython-311.pyc +0 -0
  7. quarchpy/__pycache__/connection.cpython-311.pyc +0 -0
  8. quarchpy/__pycache__/run.cpython-311.pyc +0 -0
  9. quarchpy/_version.py +1 -1
  10. quarchpy/config_files/__pycache__/__init__.cpython-311.pyc +0 -0
  11. quarchpy/config_files/__pycache__/quarch_config_parser.cpython-311.pyc +0 -0
  12. quarchpy/connection_specific/QPS/commandLineOptions.txt +12 -10
  13. quarchpy/connection_specific/QPS/qis/qis.jar +0 -0
  14. quarchpy/connection_specific/QPS/qis/qis_lib/{CInterface-1.7.03.jar → CInterface-1.7.04.jar} +0 -0
  15. quarchpy/connection_specific/QPS/qis/qis_lib/{QuarchCommon-0.2.5.jar → QuarchCommon-0.2.6.jar} +0 -0
  16. quarchpy/connection_specific/QPS/qis/qis_lib/commons-lang3-3.2.1.jar +0 -0
  17. quarchpy/connection_specific/QPS/qps.jar +0 -0
  18. quarchpy/connection_specific/QPS/qps_lib/QuarchCommon-0.2.6.jar +0 -0
  19. quarchpy/connection_specific/QPS/qps_lib/istack-commons-runtime-3.0.11.jar +0 -0
  20. quarchpy/connection_specific/QPS/qps_lib/jakarta.activation-api-2.1.0.jar +0 -0
  21. quarchpy/connection_specific/QPS/qps_lib/jakarta.xml.bind-api-3.0.0.jar +0 -0
  22. quarchpy/connection_specific/QPS/qps_lib/jaxb-core-3.0.0.jar +0 -0
  23. quarchpy/connection_specific/QPS/qps_lib/jaxb-impl-3.0.0.jar +0 -0
  24. quarchpy/connection_specific/QPS/qps_lib/jaxb-runtime-3.0.0.jar +0 -0
  25. quarchpy/connection_specific/QPS/qps_lib/qis-1.39.jar +0 -0
  26. quarchpy/connection_specific/QPS/qps_lib/txw2-3.0.0.jar +0 -0
  27. quarchpy/connection_specific/QPS/scriptCommands.txt +2 -2
  28. quarchpy/connection_specific/__pycache__/StreamChannels.cpython-311.pyc +0 -0
  29. quarchpy/connection_specific/__pycache__/__init__.cpython-311.pyc +0 -0
  30. quarchpy/connection_specific/__pycache__/connection_QIS.cpython-311.pyc +0 -0
  31. quarchpy/connection_specific/__pycache__/connection_QPS.cpython-311.pyc +0 -0
  32. quarchpy/connection_specific/__pycache__/connection_ReST.cpython-311.pyc +0 -0
  33. quarchpy/connection_specific/__pycache__/connection_Serial.cpython-311.pyc +0 -0
  34. quarchpy/connection_specific/__pycache__/connection_TCP.cpython-311.pyc +0 -0
  35. quarchpy/connection_specific/__pycache__/connection_Telnet.cpython-311.pyc +0 -0
  36. quarchpy/connection_specific/__pycache__/connection_USB.cpython-311.pyc +0 -0
  37. quarchpy/connection_specific/__pycache__/connection_mDNS.cpython-311.pyc +0 -0
  38. quarchpy/connection_specific/connection_QIS.py +246 -331
  39. quarchpy/connection_specific/connection_QPS.py +1 -1
  40. quarchpy/connection_specific/connection_ReST.py +26 -16
  41. quarchpy/connection_specific/connection_TCP.py +1 -1
  42. quarchpy/connection_specific/connection_mDNS.py +46 -0
  43. quarchpy/connection_specific/serial/__pycache__/__init__.cpython-311.pyc +0 -0
  44. quarchpy/connection_specific/serial/__pycache__/serialutil.cpython-311.pyc +0 -0
  45. quarchpy/connection_specific/serial/__pycache__/serialwin32.cpython-311.pyc +0 -0
  46. quarchpy/connection_specific/serial/__pycache__/win32.cpython-311.pyc +0 -0
  47. quarchpy/connection_specific/serial/tools/__pycache__/__init__.cpython-311.pyc +0 -0
  48. quarchpy/connection_specific/serial/tools/__pycache__/list_ports.cpython-311.pyc +0 -0
  49. quarchpy/connection_specific/serial/tools/__pycache__/list_ports_common.cpython-311.pyc +0 -0
  50. quarchpy/connection_specific/serial/tools/__pycache__/list_ports_windows.cpython-311.pyc +0 -0
  51. quarchpy/debug/__pycache__/SystemTest.cpython-311.pyc +0 -0
  52. quarchpy/debug/__pycache__/__init__.cpython-311.pyc +0 -0
  53. quarchpy/debug/__pycache__/module_debug.cpython-311.pyc +0 -0
  54. quarchpy/debug/__pycache__/simple_terminal.cpython-311.pyc +0 -0
  55. quarchpy/debug/__pycache__/upgrade_quarchpy.cpython-311.pyc +0 -0
  56. quarchpy/debug/__pycache__/versionCompare.cpython-311.pyc +0 -0
  57. quarchpy/device/__pycache__/__init__.cpython-311.pyc +0 -0
  58. quarchpy/device/__pycache__/device.cpython-311.pyc +0 -0
  59. quarchpy/device/__pycache__/quarchArray.cpython-311.pyc +0 -0
  60. quarchpy/device/__pycache__/quarchPPM.cpython-311.pyc +0 -0
  61. quarchpy/device/__pycache__/quarchQPS.cpython-311.pyc +0 -0
  62. quarchpy/device/__pycache__/scanDevices.cpython-311.pyc +0 -0
  63. quarchpy/device/device.py +2 -0
  64. quarchpy/device/quarchPPM.py +2 -2
  65. quarchpy/device/quarchQPS.py +95 -86
  66. quarchpy/device/scanDevices.py +13 -3
  67. quarchpy/disk_test/__pycache__/AbsDiskFinder.cpython-311.pyc +0 -0
  68. quarchpy/disk_test/__pycache__/DiskTargetSelection.cpython-311.pyc +0 -0
  69. quarchpy/disk_test/__pycache__/__init__.cpython-311.pyc +0 -0
  70. quarchpy/disk_test/__pycache__/iometerDiskFinder.cpython-311.pyc +0 -0
  71. quarchpy/docs/CHANGES.rst +11 -1
  72. quarchpy/docs/_build/doctrees/CHANGES.doctree +0 -0
  73. quarchpy/docs/_build/doctrees/environment.pickle +0 -0
  74. quarchpy/docs/_build/doctrees/index.doctree +0 -0
  75. quarchpy/docs/_build/doctrees/readme.doctree +0 -0
  76. quarchpy/docs/_build/doctrees/source/changelog.doctree +0 -0
  77. quarchpy/docs/_build/doctrees/source/licenses.doctree +0 -0
  78. quarchpy/docs/_build/doctrees/source/modules.doctree +0 -0
  79. quarchpy/docs/_build/doctrees/source/quarchpy.calibration.doctree +0 -0
  80. quarchpy/docs/_build/doctrees/source/quarchpy.config_files.doctree +0 -0
  81. quarchpy/docs/_build/doctrees/source/quarchpy.connection_specific.doctree +0 -0
  82. quarchpy/docs/_build/doctrees/source/quarchpy.debug.doctree +0 -0
  83. quarchpy/docs/_build/doctrees/source/quarchpy.device.doctree +0 -0
  84. quarchpy/docs/_build/doctrees/source/quarchpy.disk_test.doctree +0 -0
  85. quarchpy/docs/_build/doctrees/source/quarchpy.doctree +0 -0
  86. quarchpy/docs/_build/doctrees/source/quarchpy.fio.doctree +0 -0
  87. quarchpy/docs/_build/doctrees/source/quarchpy.iometer.doctree +0 -0
  88. quarchpy/docs/_build/doctrees/source/quarchpy.qis.doctree +0 -0
  89. quarchpy/docs/_build/doctrees/source/quarchpy.qps.doctree +0 -0
  90. quarchpy/docs/_build/doctrees/source/quarchpy.user_interface.doctree +0 -0
  91. quarchpy/docs/_build/doctrees/source/quarchpy.utilities.doctree +0 -0
  92. quarchpy/docs/_build/doctrees/source/readme.doctree +0 -0
  93. quarchpy/docs/_build/html/.buildinfo +1 -1
  94. quarchpy/docs/_build/html/CHANGES.html +198 -156
  95. quarchpy/docs/_build/html/_sources/CHANGES.rst.txt +30 -0
  96. quarchpy/docs/_build/html/_static/alabaster.css +3 -1
  97. quarchpy/docs/_build/html/_static/basic.css +47 -27
  98. quarchpy/docs/_build/html/_static/doctools.js +107 -274
  99. quarchpy/docs/_build/html/_static/documentation_options.js +5 -4
  100. quarchpy/docs/_build/html/_static/language_data.js +2 -100
  101. quarchpy/docs/_build/html/_static/pygments.css +1 -0
  102. quarchpy/docs/_build/html/_static/searchtools.js +440 -395
  103. quarchpy/docs/_build/html/_static/sphinx_highlight.js +154 -0
  104. quarchpy/docs/_build/html/genindex.html +263 -87
  105. quarchpy/docs/_build/html/index.html +68 -63
  106. quarchpy/docs/_build/html/objects.inv +0 -0
  107. quarchpy/docs/_build/html/py-modindex.html +9 -11
  108. quarchpy/docs/_build/html/readme.html +26 -27
  109. quarchpy/docs/_build/html/search.html +8 -10
  110. quarchpy/docs/_build/html/searchindex.js +1 -1
  111. quarchpy/docs/_build/html/source/changelog.html +249 -201
  112. quarchpy/docs/_build/html/source/licenses.html +23 -24
  113. quarchpy/docs/_build/html/source/modules.html +24 -17
  114. quarchpy/docs/_build/html/source/quarchpy.calibration.html +44 -45
  115. quarchpy/docs/_build/html/source/quarchpy.config_files.html +25 -26
  116. quarchpy/docs/_build/html/source/quarchpy.connection_specific.html +239 -133
  117. quarchpy/docs/_build/html/source/quarchpy.debug.html +57 -54
  118. quarchpy/docs/_build/html/source/quarchpy.device.html +245 -211
  119. quarchpy/docs/_build/html/source/quarchpy.disk_test.html +75 -76
  120. quarchpy/docs/_build/html/source/quarchpy.fio.html +33 -34
  121. quarchpy/docs/_build/html/source/quarchpy.html +518 -61
  122. quarchpy/docs/_build/html/source/quarchpy.iometer.html +130 -44
  123. quarchpy/docs/_build/html/source/quarchpy.qis.html +420 -44
  124. quarchpy/docs/_build/html/source/quarchpy.qps.html +44 -43
  125. quarchpy/docs/_build/html/source/quarchpy.user_interface.html +70 -120
  126. quarchpy/docs/_build/html/source/quarchpy.utilities.html +39 -40
  127. quarchpy/docs/_build/html/source/readme.html +26 -27
  128. quarchpy/fio/__pycache__/FIO_interface.cpython-311.pyc +0 -0
  129. quarchpy/fio/__pycache__/__init__.cpython-311.pyc +0 -0
  130. quarchpy/fio/__pycache__/fioDiskFinder.cpython-311.pyc +0 -0
  131. quarchpy/iometer/__pycache__/__init__.cpython-311.pyc +0 -0
  132. quarchpy/iometer/__pycache__/gen_iometer_template.cpython-311.pyc +0 -0
  133. quarchpy/iometer/__pycache__/iometerFuncs.cpython-311.pyc +0 -0
  134. quarchpy/qis/__pycache__/StreamHeaderInfo.cpython-311.pyc +0 -0
  135. quarchpy/qis/__pycache__/__init__.cpython-311.pyc +0 -0
  136. quarchpy/qis/__pycache__/qisFuncs.cpython-311.pyc +0 -0
  137. quarchpy/qis/qisFuncs.py +25 -42
  138. quarchpy/qps/__pycache__/__init__.cpython-311.pyc +0 -0
  139. quarchpy/qps/__pycache__/qpsFuncs.cpython-311.pyc +0 -0
  140. quarchpy/qps/qpsFuncs.py +18 -19
  141. quarchpy/user_interface/__pycache__/__init__.cpython-311.pyc +0 -0
  142. quarchpy/user_interface/__pycache__/user_interface.cpython-311.pyc +0 -0
  143. quarchpy/user_interface/user_interface.py +156 -137
  144. quarchpy/utilities/TestCenter.py +11 -16
  145. quarchpy/utilities/Version.py +50 -0
  146. quarchpy/utilities/__pycache__/TestCenter.cpython-311.pyc +0 -0
  147. quarchpy/utilities/__pycache__/TimeValue.cpython-311.pyc +0 -0
  148. quarchpy/utilities/__pycache__/Version.cpython-311.pyc +0 -0
  149. quarchpy/utilities/__pycache__/__init__.cpython-311.pyc +0 -0
  150. quarchpy/venv/.gitignore +2 -0
  151. quarchpy/venv/Include/Python-ast.h +535 -0
  152. quarchpy/venv/Include/Python.h +181 -0
  153. quarchpy/venv/Include/abstract.h +1396 -0
  154. quarchpy/venv/Include/asdl.h +45 -0
  155. quarchpy/venv/Include/ast.h +13 -0
  156. quarchpy/venv/Include/bitset.h +32 -0
  157. quarchpy/venv/Include/boolobject.h +36 -0
  158. quarchpy/venv/Include/bufferobject.h +33 -0
  159. quarchpy/venv/Include/bytearrayobject.h +57 -0
  160. quarchpy/venv/Include/bytes_methods.h +75 -0
  161. quarchpy/venv/Include/bytesobject.h +27 -0
  162. quarchpy/venv/Include/cStringIO.h +73 -0
  163. quarchpy/venv/Include/cellobject.h +28 -0
  164. quarchpy/venv/Include/ceval.h +154 -0
  165. quarchpy/venv/Include/classobject.h +83 -0
  166. quarchpy/venv/Include/cobject.h +89 -0
  167. quarchpy/venv/Include/code.h +116 -0
  168. quarchpy/venv/Include/codecs.h +212 -0
  169. quarchpy/venv/Include/compile.h +40 -0
  170. quarchpy/venv/Include/complexobject.h +66 -0
  171. quarchpy/venv/Include/datetime.h +239 -0
  172. quarchpy/venv/Include/descrobject.h +94 -0
  173. quarchpy/venv/Include/dictobject.h +160 -0
  174. quarchpy/venv/Include/dtoa.h +15 -0
  175. quarchpy/venv/Include/enumobject.h +17 -0
  176. quarchpy/venv/Include/errcode.h +37 -0
  177. quarchpy/venv/Include/eval.h +25 -0
  178. quarchpy/venv/Include/fileobject.h +97 -0
  179. quarchpy/venv/Include/floatobject.h +140 -0
  180. quarchpy/venv/Include/frameobject.h +89 -0
  181. quarchpy/venv/Include/funcobject.h +76 -0
  182. quarchpy/venv/Include/genobject.h +40 -0
  183. quarchpy/venv/Include/graminit.h +87 -0
  184. quarchpy/venv/Include/grammar.h +94 -0
  185. quarchpy/venv/Include/import.h +71 -0
  186. quarchpy/venv/Include/intobject.h +84 -0
  187. quarchpy/venv/Include/intrcheck.h +15 -0
  188. quarchpy/venv/Include/iterobject.h +23 -0
  189. quarchpy/venv/Include/listobject.h +68 -0
  190. quarchpy/venv/Include/longintrepr.h +103 -0
  191. quarchpy/venv/Include/longobject.h +135 -0
  192. quarchpy/venv/Include/marshal.h +25 -0
  193. quarchpy/venv/Include/memoryobject.h +74 -0
  194. quarchpy/venv/Include/metagrammar.h +18 -0
  195. quarchpy/venv/Include/methodobject.h +93 -0
  196. quarchpy/venv/Include/modsupport.h +134 -0
  197. quarchpy/venv/Include/moduleobject.h +24 -0
  198. quarchpy/venv/Include/node.h +41 -0
  199. quarchpy/venv/Include/object.h +1046 -0
  200. quarchpy/venv/Include/objimpl.h +369 -0
  201. quarchpy/venv/Include/opcode.h +171 -0
  202. quarchpy/venv/Include/osdefs.h +63 -0
  203. quarchpy/venv/Include/parsetok.h +64 -0
  204. quarchpy/venv/Include/patchlevel.h +43 -0
  205. quarchpy/venv/Include/pgen.h +18 -0
  206. quarchpy/venv/Include/pgenheaders.h +43 -0
  207. quarchpy/venv/Include/py_curses.h +177 -0
  208. quarchpy/venv/Include/pyarena.h +62 -0
  209. quarchpy/venv/Include/pycapsule.h +56 -0
  210. quarchpy/venv/Include/pyconfig.h +770 -0
  211. quarchpy/venv/Include/pyctype.h +31 -0
  212. quarchpy/venv/Include/pydebug.h +41 -0
  213. quarchpy/venv/Include/pyerrors.h +329 -0
  214. quarchpy/venv/Include/pyexpat.h +50 -0
  215. quarchpy/venv/Include/pyfpe.h +176 -0
  216. quarchpy/venv/Include/pygetopt.h +18 -0
  217. quarchpy/venv/Include/pymacconfig.h +102 -0
  218. quarchpy/venv/Include/pymactoolbox.h +232 -0
  219. quarchpy/venv/Include/pymath.h +214 -0
  220. quarchpy/venv/Include/pymem.h +122 -0
  221. quarchpy/venv/Include/pyport.h +950 -0
  222. quarchpy/venv/Include/pystate.h +200 -0
  223. quarchpy/venv/Include/pystrcmp.h +23 -0
  224. quarchpy/venv/Include/pystrtod.h +45 -0
  225. quarchpy/venv/Include/pythonrun.h +181 -0
  226. quarchpy/venv/Include/pythread.h +41 -0
  227. quarchpy/venv/Include/rangeobject.h +28 -0
  228. quarchpy/venv/Include/setobject.h +99 -0
  229. quarchpy/venv/Include/sliceobject.h +50 -0
  230. quarchpy/venv/Include/stringobject.h +210 -0
  231. quarchpy/venv/Include/structmember.h +99 -0
  232. quarchpy/venv/Include/structseq.h +41 -0
  233. quarchpy/venv/Include/symtable.h +98 -0
  234. quarchpy/venv/Include/sysmodule.h +31 -0
  235. quarchpy/venv/Include/timefuncs.h +26 -0
  236. quarchpy/venv/Include/token.h +85 -0
  237. quarchpy/venv/Include/traceback.h +31 -0
  238. quarchpy/venv/Include/tupleobject.h +61 -0
  239. quarchpy/venv/Include/ucnhash.h +33 -0
  240. quarchpy/venv/Include/unicodeobject.h +1413 -0
  241. quarchpy/venv/Include/warnings.h +23 -0
  242. quarchpy/venv/Include/weakrefobject.h +82 -0
  243. quarchpy/venv/Lib/os.py +742 -0
  244. quarchpy/venv/Lib/os.pyc +0 -0
  245. quarchpy/venv/Lib/site-packages/_virtualenv.pth +1 -0
  246. quarchpy/venv/Lib/site-packages/_virtualenv.py +130 -0
  247. quarchpy/venv/Lib/site-packages/_virtualenv.pyc +0 -0
  248. quarchpy/venv/Lib/site-packages/easy_install.py +5 -0
  249. quarchpy/venv/Lib/site-packages/pip/__init__.py +18 -0
  250. quarchpy/venv/Lib/site-packages/pip/__main__.py +26 -0
  251. quarchpy/venv/Lib/site-packages/pip/_internal/__init__.py +17 -0
  252. quarchpy/venv/Lib/site-packages/pip/_internal/build_env.py +242 -0
  253. quarchpy/venv/Lib/site-packages/pip/_internal/cache.py +346 -0
  254. quarchpy/venv/Lib/site-packages/pip/_internal/cli/__init__.py +4 -0
  255. quarchpy/venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +164 -0
  256. quarchpy/venv/Lib/site-packages/pip/_internal/cli/base_command.py +260 -0
  257. quarchpy/venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +971 -0
  258. quarchpy/venv/Lib/site-packages/pip/_internal/cli/command_context.py +36 -0
  259. quarchpy/venv/Lib/site-packages/pip/_internal/cli/main.py +75 -0
  260. quarchpy/venv/Lib/site-packages/pip/_internal/cli/main_parser.py +96 -0
  261. quarchpy/venv/Lib/site-packages/pip/_internal/cli/parser.py +285 -0
  262. quarchpy/venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +280 -0
  263. quarchpy/venv/Lib/site-packages/pip/_internal/cli/req_command.py +436 -0
  264. quarchpy/venv/Lib/site-packages/pip/_internal/cli/spinners.py +173 -0
  265. quarchpy/venv/Lib/site-packages/pip/_internal/cli/status_codes.py +8 -0
  266. quarchpy/venv/Lib/site-packages/pip/_internal/commands/__init__.py +123 -0
  267. quarchpy/venv/Lib/site-packages/pip/_internal/commands/cache.py +234 -0
  268. quarchpy/venv/Lib/site-packages/pip/_internal/commands/check.py +51 -0
  269. quarchpy/venv/Lib/site-packages/pip/_internal/commands/completion.py +98 -0
  270. quarchpy/venv/Lib/site-packages/pip/_internal/commands/configuration.py +280 -0
  271. quarchpy/venv/Lib/site-packages/pip/_internal/commands/debug.py +230 -0
  272. quarchpy/venv/Lib/site-packages/pip/_internal/commands/download.py +143 -0
  273. quarchpy/venv/Lib/site-packages/pip/_internal/commands/freeze.py +116 -0
  274. quarchpy/venv/Lib/site-packages/pip/_internal/commands/hash.py +63 -0
  275. quarchpy/venv/Lib/site-packages/pip/_internal/commands/help.py +46 -0
  276. quarchpy/venv/Lib/site-packages/pip/_internal/commands/install.py +737 -0
  277. quarchpy/venv/Lib/site-packages/pip/_internal/commands/list.py +327 -0
  278. quarchpy/venv/Lib/site-packages/pip/_internal/commands/search.py +169 -0
  279. quarchpy/venv/Lib/site-packages/pip/_internal/commands/show.py +186 -0
  280. quarchpy/venv/Lib/site-packages/pip/_internal/commands/uninstall.py +95 -0
  281. quarchpy/venv/Lib/site-packages/pip/_internal/commands/wheel.py +198 -0
  282. quarchpy/venv/Lib/site-packages/pip/_internal/configuration.py +407 -0
  283. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/__init__.py +24 -0
  284. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/base.py +46 -0
  285. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/installed.py +25 -0
  286. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/sdist.py +105 -0
  287. quarchpy/venv/Lib/site-packages/pip/_internal/distributions/wheel.py +37 -0
  288. quarchpy/venv/Lib/site-packages/pip/_internal/exceptions.py +391 -0
  289. quarchpy/venv/Lib/site-packages/pip/_internal/index/__init__.py +2 -0
  290. quarchpy/venv/Lib/site-packages/pip/_internal/index/collector.py +667 -0
  291. quarchpy/venv/Lib/site-packages/pip/_internal/index/package_finder.py +1015 -0
  292. quarchpy/venv/Lib/site-packages/pip/_internal/locations.py +193 -0
  293. quarchpy/venv/Lib/site-packages/pip/_internal/main.py +16 -0
  294. quarchpy/venv/Lib/site-packages/pip/_internal/models/__init__.py +2 -0
  295. quarchpy/venv/Lib/site-packages/pip/_internal/models/candidate.py +39 -0
  296. quarchpy/venv/Lib/site-packages/pip/_internal/models/direct_url.py +243 -0
  297. quarchpy/venv/Lib/site-packages/pip/_internal/models/format_control.py +92 -0
  298. quarchpy/venv/Lib/site-packages/pip/_internal/models/index.py +34 -0
  299. quarchpy/venv/Lib/site-packages/pip/_internal/models/link.py +246 -0
  300. quarchpy/venv/Lib/site-packages/pip/_internal/models/scheme.py +31 -0
  301. quarchpy/venv/Lib/site-packages/pip/_internal/models/search_scope.py +135 -0
  302. quarchpy/venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +50 -0
  303. quarchpy/venv/Lib/site-packages/pip/_internal/models/target_python.py +117 -0
  304. quarchpy/venv/Lib/site-packages/pip/_internal/models/wheel.py +78 -0
  305. quarchpy/venv/Lib/site-packages/pip/_internal/network/__init__.py +2 -0
  306. quarchpy/venv/Lib/site-packages/pip/_internal/network/auth.py +310 -0
  307. quarchpy/venv/Lib/site-packages/pip/_internal/network/cache.py +79 -0
  308. quarchpy/venv/Lib/site-packages/pip/_internal/network/download.py +202 -0
  309. quarchpy/venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +231 -0
  310. quarchpy/venv/Lib/site-packages/pip/_internal/network/session.py +428 -0
  311. quarchpy/venv/Lib/site-packages/pip/_internal/network/utils.py +97 -0
  312. quarchpy/venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +53 -0
  313. quarchpy/venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  314. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  315. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +38 -0
  316. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +77 -0
  317. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +47 -0
  318. quarchpy/venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +113 -0
  319. quarchpy/venv/Lib/site-packages/pip/_internal/operations/check.py +155 -0
  320. quarchpy/venv/Lib/site-packages/pip/_internal/operations/freeze.py +277 -0
  321. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +2 -0
  322. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +52 -0
  323. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/legacy.py +130 -0
  324. quarchpy/venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +846 -0
  325. quarchpy/venv/Lib/site-packages/pip/_internal/operations/prepare.py +608 -0
  326. quarchpy/venv/Lib/site-packages/pip/_internal/pyproject.py +196 -0
  327. quarchpy/venv/Lib/site-packages/pip/_internal/req/__init__.py +103 -0
  328. quarchpy/venv/Lib/site-packages/pip/_internal/req/constructors.py +476 -0
  329. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_file.py +574 -0
  330. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_install.py +907 -0
  331. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_set.py +204 -0
  332. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_tracker.py +151 -0
  333. quarchpy/venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +657 -0
  334. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  335. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/base.py +21 -0
  336. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  337. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +473 -0
  338. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  339. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +156 -0
  340. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +604 -0
  341. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +504 -0
  342. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +101 -0
  343. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +174 -0
  344. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +84 -0
  345. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +201 -0
  346. quarchpy/venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +296 -0
  347. quarchpy/venv/Lib/site-packages/pip/_internal/self_outdated_check.py +197 -0
  348. quarchpy/venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  349. quarchpy/venv/Lib/site-packages/pip/_internal/utils/appdirs.py +44 -0
  350. quarchpy/venv/Lib/site-packages/pip/_internal/utils/compat.py +293 -0
  351. quarchpy/venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +178 -0
  352. quarchpy/venv/Lib/site-packages/pip/_internal/utils/datetime.py +14 -0
  353. quarchpy/venv/Lib/site-packages/pip/_internal/utils/deprecation.py +104 -0
  354. quarchpy/venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +126 -0
  355. quarchpy/venv/Lib/site-packages/pip/_internal/utils/distutils_args.py +48 -0
  356. quarchpy/venv/Lib/site-packages/pip/_internal/utils/encoding.py +41 -0
  357. quarchpy/venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +31 -0
  358. quarchpy/venv/Lib/site-packages/pip/_internal/utils/filesystem.py +224 -0
  359. quarchpy/venv/Lib/site-packages/pip/_internal/utils/filetypes.py +26 -0
  360. quarchpy/venv/Lib/site-packages/pip/_internal/utils/glibc.py +98 -0
  361. quarchpy/venv/Lib/site-packages/pip/_internal/utils/hashes.py +169 -0
  362. quarchpy/venv/Lib/site-packages/pip/_internal/utils/inject_securetransport.py +36 -0
  363. quarchpy/venv/Lib/site-packages/pip/_internal/utils/logging.py +399 -0
  364. quarchpy/venv/Lib/site-packages/pip/_internal/utils/misc.py +962 -0
  365. quarchpy/venv/Lib/site-packages/pip/_internal/utils/models.py +44 -0
  366. quarchpy/venv/Lib/site-packages/pip/_internal/utils/packaging.py +95 -0
  367. quarchpy/venv/Lib/site-packages/pip/_internal/utils/parallel.py +107 -0
  368. quarchpy/venv/Lib/site-packages/pip/_internal/utils/pkg_resources.py +44 -0
  369. quarchpy/venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +181 -0
  370. quarchpy/venv/Lib/site-packages/pip/_internal/utils/subprocess.py +299 -0
  371. quarchpy/venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +284 -0
  372. quarchpy/venv/Lib/site-packages/pip/_internal/utils/typing.py +38 -0
  373. quarchpy/venv/Lib/site-packages/pip/_internal/utils/unpacking.py +281 -0
  374. quarchpy/venv/Lib/site-packages/pip/_internal/utils/urls.py +55 -0
  375. quarchpy/venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +119 -0
  376. quarchpy/venv/Lib/site-packages/pip/_internal/utils/wheel.py +225 -0
  377. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/__init__.py +15 -0
  378. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +123 -0
  379. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/git.py +454 -0
  380. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +172 -0
  381. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/subversion.py +340 -0
  382. quarchpy/venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +735 -0
  383. quarchpy/venv/Lib/site-packages/pip/_internal/wheel_builder.py +362 -0
  384. quarchpy/venv/Lib/site-packages/pip/_vendor/__init__.py +114 -0
  385. quarchpy/venv/Lib/site-packages/pip/_vendor/appdirs.py +633 -0
  386. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +11 -0
  387. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +57 -0
  388. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +133 -0
  389. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +39 -0
  390. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +2 -0
  391. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +146 -0
  392. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +33 -0
  393. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/compat.py +29 -0
  394. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +376 -0
  395. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +80 -0
  396. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +135 -0
  397. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +188 -0
  398. quarchpy/venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +29 -0
  399. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +3 -0
  400. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +12 -0
  401. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/cacert.pem +4606 -0
  402. quarchpy/venv/Lib/site-packages/pip/_vendor/certifi/core.py +60 -0
  403. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/__init__.py +39 -0
  404. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
  405. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/big5prober.py +47 -0
  406. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/chardistribution.py +233 -0
  407. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
  408. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
  409. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
  410. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/cli/chardetect.py +85 -0
  411. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
  412. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/compat.py +34 -0
  413. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/cp949prober.py +49 -0
  414. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/enums.py +76 -0
  415. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/escprober.py +101 -0
  416. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/escsm.py +246 -0
  417. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
  418. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
  419. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euckrprober.py +47 -0
  420. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euctwfreq.py +387 -0
  421. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/euctwprober.py +46 -0
  422. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/gb2312freq.py +283 -0
  423. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/gb2312prober.py +46 -0
  424. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/hebrewprober.py +292 -0
  425. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/jisfreq.py +325 -0
  426. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/jpcntx.py +233 -0
  427. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +228 -0
  428. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langcyrillicmodel.py +333 -0
  429. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langgreekmodel.py +225 -0
  430. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langhebrewmodel.py +200 -0
  431. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langhungarianmodel.py +225 -0
  432. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langthaimodel.py +199 -0
  433. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/langturkishmodel.py +193 -0
  434. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/latin1prober.py +145 -0
  435. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
  436. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +54 -0
  437. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
  438. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/sbcharsetprober.py +132 -0
  439. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +73 -0
  440. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
  441. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
  442. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/utf8prober.py +82 -0
  443. quarchpy/venv/Lib/site-packages/pip/_vendor/chardet/version.py +9 -0
  444. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/__init__.py +6 -0
  445. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/ansi.py +102 -0
  446. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py +258 -0
  447. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/initialise.py +80 -0
  448. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/win32.py +152 -0
  449. quarchpy/venv/Lib/site-packages/pip/_vendor/colorama/winterm.py +169 -0
  450. quarchpy/venv/Lib/site-packages/pip/_vendor/contextlib2.py +518 -0
  451. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +23 -0
  452. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -0
  453. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -0
  454. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py +764 -0
  455. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -0
  456. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +786 -0
  457. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -0
  458. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/compat.py +1120 -0
  459. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/database.py +1339 -0
  460. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/index.py +516 -0
  461. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/locators.py +1302 -0
  462. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/manifest.py +393 -0
  463. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/markers.py +131 -0
  464. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/metadata.py +1056 -0
  465. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/resources.py +355 -0
  466. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +419 -0
  467. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/t32.exe +0 -0
  468. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/t64.exe +0 -0
  469. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/util.py +1761 -0
  470. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/version.py +736 -0
  471. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/w32.exe +0 -0
  472. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/w64.exe +0 -0
  473. quarchpy/venv/Lib/site-packages/pip/_vendor/distlib/wheel.py +1018 -0
  474. quarchpy/venv/Lib/site-packages/pip/_vendor/distro.py +1230 -0
  475. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/__init__.py +35 -0
  476. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_ihatexml.py +289 -0
  477. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_inputstream.py +918 -0
  478. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_tokenizer.py +1735 -0
  479. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_trie/__init__.py +5 -0
  480. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_trie/_base.py +40 -0
  481. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_trie/py.py +67 -0
  482. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/_utils.py +159 -0
  483. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/constants.py +2946 -0
  484. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
  485. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -0
  486. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/base.py +12 -0
  487. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -0
  488. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -0
  489. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -0
  490. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +916 -0
  491. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -0
  492. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/html5parser.py +2795 -0
  493. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
  494. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
  495. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
  496. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -0
  497. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -0
  498. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/base.py +417 -0
  499. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +239 -0
  500. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +343 -0
  501. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +392 -0
  502. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -0
  503. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/base.py +252 -0
  504. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -0
  505. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +131 -0
  506. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py +215 -0
  507. quarchpy/venv/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py +69 -0
  508. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/__init__.py +2 -0
  509. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/codec.py +118 -0
  510. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/compat.py +12 -0
  511. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/core.py +400 -0
  512. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +2050 -0
  513. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/intranges.py +53 -0
  514. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/package_data.py +2 -0
  515. quarchpy/venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +8357 -0
  516. quarchpy/venv/Lib/site-packages/pip/_vendor/ipaddress.py +2420 -0
  517. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +54 -0
  518. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/_version.py +1 -0
  519. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
  520. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +191 -0
  521. quarchpy/venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +1063 -0
  522. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/__about__.py +27 -0
  523. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +26 -0
  524. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/_compat.py +38 -0
  525. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +86 -0
  526. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/_typing.py +48 -0
  527. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/markers.py +328 -0
  528. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +151 -0
  529. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +864 -0
  530. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/tags.py +852 -0
  531. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/utils.py +67 -0
  532. quarchpy/venv/Lib/site-packages/pip/_vendor/packaging/version.py +556 -0
  533. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/__init__.py +6 -0
  534. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/_in_process.py +280 -0
  535. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/build.py +124 -0
  536. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/check.py +203 -0
  537. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/colorlog.py +115 -0
  538. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/compat.py +34 -0
  539. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/dirtools.py +44 -0
  540. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/envbuild.py +167 -0
  541. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/meta.py +92 -0
  542. quarchpy/venv/Lib/site-packages/pip/_vendor/pep517/wrappers.py +327 -0
  543. quarchpy/venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +3296 -0
  544. quarchpy/venv/Lib/site-packages/pip/_vendor/pkg_resources/py31compat.py +23 -0
  545. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/__init__.py +177 -0
  546. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/bar.py +91 -0
  547. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/counter.py +41 -0
  548. quarchpy/venv/Lib/site-packages/pip/_vendor/progress/spinner.py +43 -0
  549. quarchpy/venv/Lib/site-packages/pip/_vendor/pyparsing.py +7107 -0
  550. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/__init__.py +144 -0
  551. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/__version__.py +14 -0
  552. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
  553. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/adapters.py +533 -0
  554. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/api.py +161 -0
  555. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/auth.py +305 -0
  556. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/certs.py +18 -0
  557. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/compat.py +76 -0
  558. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/cookies.py +549 -0
  559. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +123 -0
  560. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/help.py +119 -0
  561. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/hooks.py +34 -0
  562. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/models.py +956 -0
  563. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/packages.py +16 -0
  564. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/sessions.py +781 -0
  565. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +123 -0
  566. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/structures.py +105 -0
  567. quarchpy/venv/Lib/site-packages/pip/_vendor/requests/utils.py +988 -0
  568. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +26 -0
  569. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
  570. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +6 -0
  571. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +119 -0
  572. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +37 -0
  573. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers.py +454 -0
  574. quarchpy/venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +149 -0
  575. quarchpy/venv/Lib/site-packages/pip/_vendor/retrying.py +267 -0
  576. quarchpy/venv/Lib/site-packages/pip/_vendor/six.py +982 -0
  577. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/__init__.py +25 -0
  578. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/decoder.py +1057 -0
  579. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/encoder.py +304 -0
  580. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/ordered.py +15 -0
  581. quarchpy/venv/Lib/site-packages/pip/_vendor/toml/tz.py +24 -0
  582. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +85 -0
  583. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +337 -0
  584. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +2 -0
  585. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +535 -0
  586. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +1067 -0
  587. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  588. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +36 -0
  589. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  590. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +519 -0
  591. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +396 -0
  592. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +314 -0
  593. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +121 -0
  594. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +509 -0
  595. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +920 -0
  596. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +216 -0
  597. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +313 -0
  598. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +274 -0
  599. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +98 -0
  600. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +5 -0
  601. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  602. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +51 -0
  603. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +1021 -0
  604. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py +22 -0
  605. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py +160 -0
  606. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +536 -0
  607. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/request.py +170 -0
  608. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/response.py +821 -0
  609. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +49 -0
  610. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +150 -0
  611. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +56 -0
  612. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +22 -0
  613. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +143 -0
  614. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +107 -0
  615. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +601 -0
  616. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +474 -0
  617. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +221 -0
  618. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +268 -0
  619. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +430 -0
  620. quarchpy/venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +153 -0
  621. quarchpy/venv/Lib/site-packages/pip/_vendor/vendor.txt +24 -0
  622. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
  623. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/labels.py +231 -0
  624. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
  625. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/tests.py +153 -0
  626. quarchpy/venv/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
  627. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/INSTALLER +1 -0
  628. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/LICENSE.txt +20 -0
  629. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/METADATA +94 -0
  630. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/RECORD +812 -0
  631. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/WHEEL +6 -0
  632. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/entry_points.txt +5 -0
  633. quarchpy/venv/Lib/site-packages/pip-20.3.4.dist-info/top_level.txt +1 -0
  634. quarchpy/venv/Lib/site-packages/pip-20.3.4.virtualenv +0 -0
  635. quarchpy/venv/Lib/site-packages/pkg_resources/__init__.py +3296 -0
  636. quarchpy/venv/Lib/site-packages/pkg_resources/__init__.pyc +0 -0
  637. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/__init__.py +0 -0
  638. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/__init__.pyc +0 -0
  639. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/appdirs.py +608 -0
  640. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/appdirs.pyc +0 -0
  641. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py +21 -0
  642. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.pyc +0 -0
  643. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.py +14 -0
  644. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.pyc +0 -0
  645. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.py +30 -0
  646. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.pyc +0 -0
  647. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py +68 -0
  648. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.pyc +0 -0
  649. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py +301 -0
  650. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/markers.pyc +0 -0
  651. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py +127 -0
  652. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.pyc +0 -0
  653. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py +774 -0
  654. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.pyc +0 -0
  655. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/utils.py +14 -0
  656. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/version.py +393 -0
  657. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/packaging/version.pyc +0 -0
  658. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/pyparsing.py +5742 -0
  659. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/pyparsing.pyc +0 -0
  660. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/six.py +868 -0
  661. quarchpy/venv/Lib/site-packages/pkg_resources/_vendor/six.pyc +0 -0
  662. quarchpy/venv/Lib/site-packages/pkg_resources/extern/__init__.py +73 -0
  663. quarchpy/venv/Lib/site-packages/pkg_resources/extern/__init__.pyc +0 -0
  664. quarchpy/venv/Lib/site-packages/pkg_resources/py31compat.py +23 -0
  665. quarchpy/venv/Lib/site-packages/pkg_resources/py31compat.pyc +0 -0
  666. quarchpy/venv/Lib/site-packages/setuptools/__init__.py +245 -0
  667. quarchpy/venv/Lib/site-packages/setuptools/_deprecation_warning.py +7 -0
  668. quarchpy/venv/Lib/site-packages/setuptools/_imp.py +73 -0
  669. quarchpy/venv/Lib/site-packages/setuptools/_vendor/__init__.py +0 -0
  670. quarchpy/venv/Lib/site-packages/setuptools/_vendor/ordered_set.py +488 -0
  671. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/__about__.py +27 -0
  672. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/__init__.py +26 -0
  673. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/_compat.py +31 -0
  674. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/_structures.py +68 -0
  675. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/markers.py +296 -0
  676. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/requirements.py +138 -0
  677. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py +749 -0
  678. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/tags.py +404 -0
  679. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/utils.py +57 -0
  680. quarchpy/venv/Lib/site-packages/setuptools/_vendor/packaging/version.py +420 -0
  681. quarchpy/venv/Lib/site-packages/setuptools/_vendor/pyparsing.py +5742 -0
  682. quarchpy/venv/Lib/site-packages/setuptools/_vendor/six.py +868 -0
  683. quarchpy/venv/Lib/site-packages/setuptools/archive_util.py +173 -0
  684. quarchpy/venv/Lib/site-packages/setuptools/build_meta.py +264 -0
  685. quarchpy/venv/Lib/site-packages/setuptools/cli-32.exe +0 -0
  686. quarchpy/venv/Lib/site-packages/setuptools/cli-64.exe +0 -0
  687. quarchpy/venv/Lib/site-packages/setuptools/cli.exe +0 -0
  688. quarchpy/venv/Lib/site-packages/setuptools/command/__init__.py +17 -0
  689. quarchpy/venv/Lib/site-packages/setuptools/command/alias.py +80 -0
  690. quarchpy/venv/Lib/site-packages/setuptools/command/bdist_egg.py +502 -0
  691. quarchpy/venv/Lib/site-packages/setuptools/command/bdist_rpm.py +43 -0
  692. quarchpy/venv/Lib/site-packages/setuptools/command/bdist_wininst.py +21 -0
  693. quarchpy/venv/Lib/site-packages/setuptools/command/build_clib.py +98 -0
  694. quarchpy/venv/Lib/site-packages/setuptools/command/build_ext.py +327 -0
  695. quarchpy/venv/Lib/site-packages/setuptools/command/build_py.py +270 -0
  696. quarchpy/venv/Lib/site-packages/setuptools/command/develop.py +221 -0
  697. quarchpy/venv/Lib/site-packages/setuptools/command/dist_info.py +36 -0
  698. quarchpy/venv/Lib/site-packages/setuptools/command/easy_install.py +2347 -0
  699. quarchpy/venv/Lib/site-packages/setuptools/command/egg_info.py +717 -0
  700. quarchpy/venv/Lib/site-packages/setuptools/command/install.py +125 -0
  701. quarchpy/venv/Lib/site-packages/setuptools/command/install_egg_info.py +62 -0
  702. quarchpy/venv/Lib/site-packages/setuptools/command/install_lib.py +121 -0
  703. quarchpy/venv/Lib/site-packages/setuptools/command/install_scripts.py +65 -0
  704. quarchpy/venv/Lib/site-packages/setuptools/command/launcher manifest.xml +15 -0
  705. quarchpy/venv/Lib/site-packages/setuptools/command/py36compat.py +136 -0
  706. quarchpy/venv/Lib/site-packages/setuptools/command/register.py +18 -0
  707. quarchpy/venv/Lib/site-packages/setuptools/command/rotate.py +66 -0
  708. quarchpy/venv/Lib/site-packages/setuptools/command/saveopts.py +22 -0
  709. quarchpy/venv/Lib/site-packages/setuptools/command/sdist.py +252 -0
  710. quarchpy/venv/Lib/site-packages/setuptools/command/setopt.py +149 -0
  711. quarchpy/venv/Lib/site-packages/setuptools/command/test.py +279 -0
  712. quarchpy/venv/Lib/site-packages/setuptools/command/upload.py +17 -0
  713. quarchpy/venv/Lib/site-packages/setuptools/command/upload_docs.py +206 -0
  714. quarchpy/venv/Lib/site-packages/setuptools/config.py +659 -0
  715. quarchpy/venv/Lib/site-packages/setuptools/dep_util.py +23 -0
  716. quarchpy/venv/Lib/site-packages/setuptools/depends.py +176 -0
  717. quarchpy/venv/Lib/site-packages/setuptools/dist.py +1274 -0
  718. quarchpy/venv/Lib/site-packages/setuptools/errors.py +16 -0
  719. quarchpy/venv/Lib/site-packages/setuptools/extension.py +57 -0
  720. quarchpy/venv/Lib/site-packages/setuptools/extern/__init__.py +73 -0
  721. quarchpy/venv/Lib/site-packages/setuptools/glob.py +174 -0
  722. quarchpy/venv/Lib/site-packages/setuptools/gui-32.exe +0 -0
  723. quarchpy/venv/Lib/site-packages/setuptools/gui-64.exe +0 -0
  724. quarchpy/venv/Lib/site-packages/setuptools/gui.exe +0 -0
  725. quarchpy/venv/Lib/site-packages/setuptools/installer.py +150 -0
  726. quarchpy/venv/Lib/site-packages/setuptools/launch.py +35 -0
  727. quarchpy/venv/Lib/site-packages/setuptools/lib2to3_ex.py +62 -0
  728. quarchpy/venv/Lib/site-packages/setuptools/monkey.py +179 -0
  729. quarchpy/venv/Lib/site-packages/setuptools/msvc.py +1679 -0
  730. quarchpy/venv/Lib/site-packages/setuptools/namespaces.py +107 -0
  731. quarchpy/venv/Lib/site-packages/setuptools/package_index.py +1136 -0
  732. quarchpy/venv/Lib/site-packages/setuptools/py27compat.py +60 -0
  733. quarchpy/venv/Lib/site-packages/setuptools/py31compat.py +32 -0
  734. quarchpy/venv/Lib/site-packages/setuptools/py33compat.py +59 -0
  735. quarchpy/venv/Lib/site-packages/setuptools/py34compat.py +13 -0
  736. quarchpy/venv/Lib/site-packages/setuptools/sandbox.py +491 -0
  737. quarchpy/venv/Lib/site-packages/setuptools/script (dev).tmpl +6 -0
  738. quarchpy/venv/Lib/site-packages/setuptools/script.tmpl +3 -0
  739. quarchpy/venv/Lib/site-packages/setuptools/site-patch.py +74 -0
  740. quarchpy/venv/Lib/site-packages/setuptools/ssl_support.py +260 -0
  741. quarchpy/venv/Lib/site-packages/setuptools/unicode_utils.py +44 -0
  742. quarchpy/venv/Lib/site-packages/setuptools/version.py +6 -0
  743. quarchpy/venv/Lib/site-packages/setuptools/wheel.py +220 -0
  744. quarchpy/venv/Lib/site-packages/setuptools/windows_support.py +29 -0
  745. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/INSTALLER +1 -0
  746. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/LICENSE +19 -0
  747. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/METADATA +86 -0
  748. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/RECORD +207 -0
  749. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/WHEEL +6 -0
  750. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/dependency_links.txt +2 -0
  751. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/entry_points.txt +69 -0
  752. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/top_level.txt +3 -0
  753. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.dist-info/zip-safe +1 -0
  754. quarchpy/venv/Lib/site-packages/setuptools-44.1.1.virtualenv +0 -0
  755. quarchpy/venv/Lib/site-packages/wheel/__init__.py +1 -0
  756. quarchpy/venv/Lib/site-packages/wheel/__main__.py +19 -0
  757. quarchpy/venv/Lib/site-packages/wheel/bdist_wheel.py +492 -0
  758. quarchpy/venv/Lib/site-packages/wheel/cli/__init__.py +88 -0
  759. quarchpy/venv/Lib/site-packages/wheel/cli/convert.py +269 -0
  760. quarchpy/venv/Lib/site-packages/wheel/cli/pack.py +82 -0
  761. quarchpy/venv/Lib/site-packages/wheel/cli/unpack.py +25 -0
  762. quarchpy/venv/Lib/site-packages/wheel/macosx_libfile.py +428 -0
  763. quarchpy/venv/Lib/site-packages/wheel/metadata.py +133 -0
  764. quarchpy/venv/Lib/site-packages/wheel/pkginfo.py +43 -0
  765. quarchpy/venv/Lib/site-packages/wheel/util.py +46 -0
  766. quarchpy/venv/Lib/site-packages/wheel/vendored/__init__.py +0 -0
  767. quarchpy/venv/Lib/site-packages/wheel/vendored/packaging/__init__.py +0 -0
  768. quarchpy/venv/Lib/site-packages/wheel/vendored/packaging/_typing.py +48 -0
  769. quarchpy/venv/Lib/site-packages/wheel/vendored/packaging/tags.py +866 -0
  770. quarchpy/venv/Lib/site-packages/wheel/wheelfile.py +181 -0
  771. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/INSTALLER +1 -0
  772. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/LICENSE.txt +22 -0
  773. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/METADATA +69 -0
  774. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/RECORD +49 -0
  775. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/WHEEL +6 -0
  776. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/entry_points.txt +6 -0
  777. quarchpy/venv/Lib/site-packages/wheel-0.37.1.dist-info/top_level.txt +1 -0
  778. quarchpy/venv/Lib/site-packages/wheel-0.37.1.virtualenv +0 -0
  779. quarchpy/venv/Lib/site.py +190 -0
  780. quarchpy/venv/Lib/site.pyc +0 -0
  781. quarchpy/venv/Scripts/activate +83 -0
  782. quarchpy/venv/Scripts/activate.bat +39 -0
  783. quarchpy/venv/Scripts/activate.fish +100 -0
  784. quarchpy/venv/Scripts/activate.nu +41 -0
  785. quarchpy/venv/Scripts/activate.ps1 +60 -0
  786. quarchpy/venv/Scripts/activate_this.py +32 -0
  787. quarchpy/venv/Scripts/deactivate.bat +19 -0
  788. quarchpy/venv/Scripts/deactivate.nu +11 -0
  789. quarchpy/venv/Scripts/easy_install-2.7.exe +0 -0
  790. quarchpy/venv/Scripts/easy_install.exe +0 -0
  791. quarchpy/venv/Scripts/easy_install2.7.exe +0 -0
  792. quarchpy/venv/Scripts/easy_install2.exe +0 -0
  793. quarchpy/venv/Scripts/pip-2.7.exe +0 -0
  794. quarchpy/venv/Scripts/pip.exe +0 -0
  795. quarchpy/venv/Scripts/pip2.7.exe +0 -0
  796. quarchpy/venv/Scripts/pip2.exe +0 -0
  797. quarchpy/venv/Scripts/pydoc.bat +1 -0
  798. quarchpy/venv/Scripts/python.exe +0 -0
  799. quarchpy/venv/Scripts/python27.dll +0 -0
  800. quarchpy/venv/Scripts/pythonw.exe +0 -0
  801. quarchpy/venv/Scripts/wheel-2.7.exe +0 -0
  802. quarchpy/venv/Scripts/wheel.exe +0 -0
  803. quarchpy/venv/Scripts/wheel2.7.exe +0 -0
  804. quarchpy/venv/Scripts/wheel2.exe +0 -0
  805. quarchpy/venv/libs/_bsddb.lib +0 -0
  806. quarchpy/venv/libs/_ctypes.lib +0 -0
  807. quarchpy/venv/libs/_ctypes_test.lib +0 -0
  808. quarchpy/venv/libs/_elementtree.lib +0 -0
  809. quarchpy/venv/libs/_hashlib.lib +0 -0
  810. quarchpy/venv/libs/_msi.lib +0 -0
  811. quarchpy/venv/libs/_multiprocessing.lib +0 -0
  812. quarchpy/venv/libs/_socket.lib +0 -0
  813. quarchpy/venv/libs/_sqlite3.lib +0 -0
  814. quarchpy/venv/libs/_ssl.lib +0 -0
  815. quarchpy/venv/libs/_testcapi.lib +0 -0
  816. quarchpy/venv/libs/_tkinter.lib +0 -0
  817. quarchpy/venv/libs/bz2.lib +0 -0
  818. quarchpy/venv/libs/libpython27.a +0 -0
  819. quarchpy/venv/libs/pyexpat.lib +0 -0
  820. quarchpy/venv/libs/python27.lib +0 -0
  821. quarchpy/venv/libs/select.lib +0 -0
  822. quarchpy/venv/libs/unicodedata.lib +0 -0
  823. quarchpy/venv/libs/winsound.lib +0 -0
  824. quarchpy/venv/pyvenv.cfg +8 -0
  825. {quarchpy-2.1.13.dev1.dist-info → quarchpy-2.1.14.dist-info}/METADATA +12 -2
  826. quarchpy-2.1.14.dist-info/RECORD +1216 -0
  827. quarchpy/.idea/inspectionProfiles/Project_Default.xml +0 -26
  828. quarchpy/connection_specific/QPS/qps_lib/QuarchCommon-0.2.4.jar +0 -0
  829. quarchpy/connection_specific/connection_QIS.py.bak +0 -1821
  830. quarchpy/connection_specific/usb_libs/__pycache__/libusb1.cpython-311.pyc +0 -0
  831. quarchpy/connection_specific/usb_libs/__pycache__/usb1.cpython-311.pyc +0 -0
  832. quarchpy/debug/TextScanIP.py +0 -11
  833. quarchpy/device/device.py.bak +0 -504
  834. quarchpy/device/scanDevices.py.bak +0 -661
  835. quarchpy-2.1.13.dev1.dist-info/RECORD +0 -531
  836. {quarchpy-2.1.13.dev1.dist-info → quarchpy-2.1.14.dist-info}/WHEEL +0 -0
  837. {quarchpy-2.1.13.dev1.dist-info → quarchpy-2.1.14.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,2347 @@
1
+ #!/usr/bin/env python
2
+ """
3
+ Easy Install
4
+ ------------
5
+
6
+ A tool for doing automatic download/extract/build of distutils-based Python
7
+ packages. For detailed documentation, see the accompanying EasyInstall.txt
8
+ file, or visit the `EasyInstall home page`__.
9
+
10
+ __ https://setuptools.readthedocs.io/en/latest/easy_install.html
11
+
12
+ """
13
+
14
+ from glob import glob
15
+ from distutils.util import get_platform
16
+ from distutils.util import convert_path, subst_vars
17
+ from distutils.errors import (
18
+ DistutilsArgError, DistutilsOptionError,
19
+ DistutilsError, DistutilsPlatformError,
20
+ )
21
+ from distutils.command.install import INSTALL_SCHEMES, SCHEME_KEYS
22
+ from distutils import log, dir_util
23
+ from distutils.command.build_scripts import first_line_re
24
+ from distutils.spawn import find_executable
25
+ import sys
26
+ import os
27
+ import zipimport
28
+ import shutil
29
+ import tempfile
30
+ import zipfile
31
+ import re
32
+ import stat
33
+ import random
34
+ import textwrap
35
+ import warnings
36
+ import site
37
+ import struct
38
+ import contextlib
39
+ import subprocess
40
+ import shlex
41
+ import io
42
+
43
+
44
+ from sysconfig import get_config_vars, get_path
45
+
46
+ from setuptools import SetuptoolsDeprecationWarning
47
+
48
+ from setuptools.extern import six
49
+ from setuptools.extern.six.moves import configparser, map
50
+
51
+ from setuptools import Command
52
+ from setuptools.sandbox import run_setup
53
+ from setuptools.py27compat import rmtree_safe
54
+ from setuptools.command import setopt
55
+ from setuptools.archive_util import unpack_archive
56
+ from setuptools.package_index import (
57
+ PackageIndex, parse_requirement_arg, URL_SCHEME,
58
+ )
59
+ from setuptools.command import bdist_egg, egg_info
60
+ from setuptools.wheel import Wheel
61
+ from pkg_resources import (
62
+ yield_lines, normalize_path, resource_string, ensure_directory,
63
+ get_distribution, find_distributions, Environment, Requirement,
64
+ Distribution, PathMetadata, EggMetadata, WorkingSet, DistributionNotFound,
65
+ VersionConflict, DEVELOP_DIST,
66
+ )
67
+ import pkg_resources.py31compat
68
+
69
+ __metaclass__ = type
70
+
71
+ # Turn on PEP440Warnings
72
+ warnings.filterwarnings("default", category=pkg_resources.PEP440Warning)
73
+
74
+ __all__ = [
75
+ 'samefile', 'easy_install', 'PthDistributions', 'extract_wininst_cfg',
76
+ 'main', 'get_exe_prefixes',
77
+ ]
78
+
79
+
80
+ def is_64bit():
81
+ return struct.calcsize("P") == 8
82
+
83
+
84
+ def samefile(p1, p2):
85
+ """
86
+ Determine if two paths reference the same file.
87
+
88
+ Augments os.path.samefile to work on Windows and
89
+ suppresses errors if the path doesn't exist.
90
+ """
91
+ both_exist = os.path.exists(p1) and os.path.exists(p2)
92
+ use_samefile = hasattr(os.path, 'samefile') and both_exist
93
+ if use_samefile:
94
+ return os.path.samefile(p1, p2)
95
+ norm_p1 = os.path.normpath(os.path.normcase(p1))
96
+ norm_p2 = os.path.normpath(os.path.normcase(p2))
97
+ return norm_p1 == norm_p2
98
+
99
+
100
+ if six.PY2:
101
+
102
+ def _to_bytes(s):
103
+ return s
104
+
105
+ def isascii(s):
106
+ try:
107
+ six.text_type(s, 'ascii')
108
+ return True
109
+ except UnicodeError:
110
+ return False
111
+ else:
112
+
113
+ def _to_bytes(s):
114
+ return s.encode('utf8')
115
+
116
+ def isascii(s):
117
+ try:
118
+ s.encode('ascii')
119
+ return True
120
+ except UnicodeError:
121
+ return False
122
+
123
+
124
+ _one_liner = lambda text: textwrap.dedent(text).strip().replace('\n', '; ')
125
+
126
+
127
+ class easy_install(Command):
128
+ """Manage a download/build/install process"""
129
+ description = "Find/get/install Python packages"
130
+ command_consumes_arguments = True
131
+
132
+ user_options = [
133
+ ('prefix=', None, "installation prefix"),
134
+ ("zip-ok", "z", "install package as a zipfile"),
135
+ ("multi-version", "m", "make apps have to require() a version"),
136
+ ("upgrade", "U", "force upgrade (searches PyPI for latest versions)"),
137
+ ("install-dir=", "d", "install package to DIR"),
138
+ ("script-dir=", "s", "install scripts to DIR"),
139
+ ("exclude-scripts", "x", "Don't install scripts"),
140
+ ("always-copy", "a", "Copy all needed packages to install dir"),
141
+ ("index-url=", "i", "base URL of Python Package Index"),
142
+ ("find-links=", "f", "additional URL(s) to search for packages"),
143
+ ("build-directory=", "b",
144
+ "download/extract/build in DIR; keep the results"),
145
+ ('optimize=', 'O',
146
+ "also compile with optimization: -O1 for \"python -O\", "
147
+ "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
148
+ ('record=', None,
149
+ "filename in which to record list of installed files"),
150
+ ('always-unzip', 'Z', "don't install as a zipfile, no matter what"),
151
+ ('site-dirs=', 'S', "list of directories where .pth files work"),
152
+ ('editable', 'e', "Install specified packages in editable form"),
153
+ ('no-deps', 'N', "don't install dependencies"),
154
+ ('allow-hosts=', 'H', "pattern(s) that hostnames must match"),
155
+ ('local-snapshots-ok', 'l',
156
+ "allow building eggs from local checkouts"),
157
+ ('version', None, "print version information and exit"),
158
+ ('no-find-links', None,
159
+ "Don't load find-links defined in packages being installed")
160
+ ]
161
+ boolean_options = [
162
+ 'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy',
163
+ 'editable',
164
+ 'no-deps', 'local-snapshots-ok', 'version'
165
+ ]
166
+
167
+ if site.ENABLE_USER_SITE:
168
+ help_msg = "install in user site-package '%s'" % site.USER_SITE
169
+ user_options.append(('user', None, help_msg))
170
+ boolean_options.append('user')
171
+
172
+ negative_opt = {'always-unzip': 'zip-ok'}
173
+ create_index = PackageIndex
174
+
175
+ def initialize_options(self):
176
+ # the --user option seems to be an opt-in one,
177
+ # so the default should be False.
178
+ self.user = 0
179
+ self.zip_ok = self.local_snapshots_ok = None
180
+ self.install_dir = self.script_dir = self.exclude_scripts = None
181
+ self.index_url = None
182
+ self.find_links = None
183
+ self.build_directory = None
184
+ self.args = None
185
+ self.optimize = self.record = None
186
+ self.upgrade = self.always_copy = self.multi_version = None
187
+ self.editable = self.no_deps = self.allow_hosts = None
188
+ self.root = self.prefix = self.no_report = None
189
+ self.version = None
190
+ self.install_purelib = None # for pure module distributions
191
+ self.install_platlib = None # non-pure (dists w/ extensions)
192
+ self.install_headers = None # for C/C++ headers
193
+ self.install_lib = None # set to either purelib or platlib
194
+ self.install_scripts = None
195
+ self.install_data = None
196
+ self.install_base = None
197
+ self.install_platbase = None
198
+ if site.ENABLE_USER_SITE:
199
+ self.install_userbase = site.USER_BASE
200
+ self.install_usersite = site.USER_SITE
201
+ else:
202
+ self.install_userbase = None
203
+ self.install_usersite = None
204
+ self.no_find_links = None
205
+
206
+ # Options not specifiable via command line
207
+ self.package_index = None
208
+ self.pth_file = self.always_copy_from = None
209
+ self.site_dirs = None
210
+ self.installed_projects = {}
211
+ self.sitepy_installed = False
212
+ # Always read easy_install options, even if we are subclassed, or have
213
+ # an independent instance created. This ensures that defaults will
214
+ # always come from the standard configuration file(s)' "easy_install"
215
+ # section, even if this is a "develop" or "install" command, or some
216
+ # other embedding.
217
+ self._dry_run = None
218
+ self.verbose = self.distribution.verbose
219
+ self.distribution._set_command_options(
220
+ self, self.distribution.get_option_dict('easy_install')
221
+ )
222
+
223
+ def delete_blockers(self, blockers):
224
+ extant_blockers = (
225
+ filename for filename in blockers
226
+ if os.path.exists(filename) or os.path.islink(filename)
227
+ )
228
+ list(map(self._delete_path, extant_blockers))
229
+
230
+ def _delete_path(self, path):
231
+ log.info("Deleting %s", path)
232
+ if self.dry_run:
233
+ return
234
+
235
+ is_tree = os.path.isdir(path) and not os.path.islink(path)
236
+ remover = rmtree if is_tree else os.unlink
237
+ remover(path)
238
+
239
+ @staticmethod
240
+ def _render_version():
241
+ """
242
+ Render the Setuptools version and installation details, then exit.
243
+ """
244
+ ver = '{}.{}'.format(*sys.version_info)
245
+ dist = get_distribution('setuptools')
246
+ tmpl = 'setuptools {dist.version} from {dist.location} (Python {ver})'
247
+ print(tmpl.format(**locals()))
248
+ raise SystemExit()
249
+
250
+ def finalize_options(self):
251
+ self.version and self._render_version()
252
+
253
+ py_version = sys.version.split()[0]
254
+ prefix, exec_prefix = get_config_vars('prefix', 'exec_prefix')
255
+
256
+ self.config_vars = {
257
+ 'dist_name': self.distribution.get_name(),
258
+ 'dist_version': self.distribution.get_version(),
259
+ 'dist_fullname': self.distribution.get_fullname(),
260
+ 'py_version': py_version,
261
+ 'py_version_short': py_version[0:3],
262
+ 'py_version_nodot': py_version[0] + py_version[2],
263
+ 'sys_prefix': prefix,
264
+ 'prefix': prefix,
265
+ 'sys_exec_prefix': exec_prefix,
266
+ 'exec_prefix': exec_prefix,
267
+ # Only python 3.2+ has abiflags
268
+ 'abiflags': getattr(sys, 'abiflags', ''),
269
+ }
270
+
271
+ if site.ENABLE_USER_SITE:
272
+ self.config_vars['userbase'] = self.install_userbase
273
+ self.config_vars['usersite'] = self.install_usersite
274
+
275
+ self._fix_install_dir_for_user_site()
276
+
277
+ self.expand_basedirs()
278
+ self.expand_dirs()
279
+
280
+ self._expand(
281
+ 'install_dir', 'script_dir', 'build_directory',
282
+ 'site_dirs',
283
+ )
284
+ # If a non-default installation directory was specified, default the
285
+ # script directory to match it.
286
+ if self.script_dir is None:
287
+ self.script_dir = self.install_dir
288
+
289
+ if self.no_find_links is None:
290
+ self.no_find_links = False
291
+
292
+ # Let install_dir get set by install_lib command, which in turn
293
+ # gets its info from the install command, and takes into account
294
+ # --prefix and --home and all that other crud.
295
+ self.set_undefined_options(
296
+ 'install_lib', ('install_dir', 'install_dir')
297
+ )
298
+ # Likewise, set default script_dir from 'install_scripts.install_dir'
299
+ self.set_undefined_options(
300
+ 'install_scripts', ('install_dir', 'script_dir')
301
+ )
302
+
303
+ if self.user and self.install_purelib:
304
+ self.install_dir = self.install_purelib
305
+ self.script_dir = self.install_scripts
306
+ # default --record from the install command
307
+ self.set_undefined_options('install', ('record', 'record'))
308
+ # Should this be moved to the if statement below? It's not used
309
+ # elsewhere
310
+ normpath = map(normalize_path, sys.path)
311
+ self.all_site_dirs = get_site_dirs()
312
+ if self.site_dirs is not None:
313
+ site_dirs = [
314
+ os.path.expanduser(s.strip()) for s in
315
+ self.site_dirs.split(',')
316
+ ]
317
+ for d in site_dirs:
318
+ if not os.path.isdir(d):
319
+ log.warn("%s (in --site-dirs) does not exist", d)
320
+ elif normalize_path(d) not in normpath:
321
+ raise DistutilsOptionError(
322
+ d + " (in --site-dirs) is not on sys.path"
323
+ )
324
+ else:
325
+ self.all_site_dirs.append(normalize_path(d))
326
+ if not self.editable:
327
+ self.check_site_dir()
328
+ self.index_url = self.index_url or "https://pypi.org/simple/"
329
+ self.shadow_path = self.all_site_dirs[:]
330
+ for path_item in self.install_dir, normalize_path(self.script_dir):
331
+ if path_item not in self.shadow_path:
332
+ self.shadow_path.insert(0, path_item)
333
+
334
+ if self.allow_hosts is not None:
335
+ hosts = [s.strip() for s in self.allow_hosts.split(',')]
336
+ else:
337
+ hosts = ['*']
338
+ if self.package_index is None:
339
+ self.package_index = self.create_index(
340
+ self.index_url, search_path=self.shadow_path, hosts=hosts,
341
+ )
342
+ self.local_index = Environment(self.shadow_path + sys.path)
343
+
344
+ if self.find_links is not None:
345
+ if isinstance(self.find_links, six.string_types):
346
+ self.find_links = self.find_links.split()
347
+ else:
348
+ self.find_links = []
349
+ if self.local_snapshots_ok:
350
+ self.package_index.scan_egg_links(self.shadow_path + sys.path)
351
+ if not self.no_find_links:
352
+ self.package_index.add_find_links(self.find_links)
353
+ self.set_undefined_options('install_lib', ('optimize', 'optimize'))
354
+ if not isinstance(self.optimize, int):
355
+ try:
356
+ self.optimize = int(self.optimize)
357
+ if not (0 <= self.optimize <= 2):
358
+ raise ValueError
359
+ except ValueError:
360
+ raise DistutilsOptionError("--optimize must be 0, 1, or 2")
361
+
362
+ if self.editable and not self.build_directory:
363
+ raise DistutilsArgError(
364
+ "Must specify a build directory (-b) when using --editable"
365
+ )
366
+ if not self.args:
367
+ raise DistutilsArgError(
368
+ "No urls, filenames, or requirements specified (see --help)")
369
+
370
+ self.outputs = []
371
+
372
+ def _fix_install_dir_for_user_site(self):
373
+ """
374
+ Fix the install_dir if "--user" was used.
375
+ """
376
+ if not self.user or not site.ENABLE_USER_SITE:
377
+ return
378
+
379
+ self.create_home_path()
380
+ if self.install_userbase is None:
381
+ msg = "User base directory is not specified"
382
+ raise DistutilsPlatformError(msg)
383
+ self.install_base = self.install_platbase = self.install_userbase
384
+ scheme_name = os.name.replace('posix', 'unix') + '_user'
385
+ self.select_scheme(scheme_name)
386
+
387
+ def _expand_attrs(self, attrs):
388
+ for attr in attrs:
389
+ val = getattr(self, attr)
390
+ if val is not None:
391
+ if os.name == 'posix' or os.name == 'nt':
392
+ val = os.path.expanduser(val)
393
+ val = subst_vars(val, self.config_vars)
394
+ setattr(self, attr, val)
395
+
396
+ def expand_basedirs(self):
397
+ """Calls `os.path.expanduser` on install_base, install_platbase and
398
+ root."""
399
+ self._expand_attrs(['install_base', 'install_platbase', 'root'])
400
+
401
+ def expand_dirs(self):
402
+ """Calls `os.path.expanduser` on install dirs."""
403
+ dirs = [
404
+ 'install_purelib',
405
+ 'install_platlib',
406
+ 'install_lib',
407
+ 'install_headers',
408
+ 'install_scripts',
409
+ 'install_data',
410
+ ]
411
+ self._expand_attrs(dirs)
412
+
413
+ def run(self, show_deprecation=True):
414
+ if show_deprecation:
415
+ self.announce(
416
+ "WARNING: The easy_install command is deprecated "
417
+ "and will be removed in a future version."
418
+ , log.WARN,
419
+ )
420
+ if self.verbose != self.distribution.verbose:
421
+ log.set_verbosity(self.verbose)
422
+ try:
423
+ for spec in self.args:
424
+ self.easy_install(spec, not self.no_deps)
425
+ if self.record:
426
+ outputs = self.outputs
427
+ if self.root: # strip any package prefix
428
+ root_len = len(self.root)
429
+ for counter in range(len(outputs)):
430
+ outputs[counter] = outputs[counter][root_len:]
431
+ from distutils import file_util
432
+
433
+ self.execute(
434
+ file_util.write_file, (self.record, outputs),
435
+ "writing list of installed files to '%s'" %
436
+ self.record
437
+ )
438
+ self.warn_deprecated_options()
439
+ finally:
440
+ log.set_verbosity(self.distribution.verbose)
441
+
442
+ def pseudo_tempname(self):
443
+ """Return a pseudo-tempname base in the install directory.
444
+ This code is intentionally naive; if a malicious party can write to
445
+ the target directory you're already in deep doodoo.
446
+ """
447
+ try:
448
+ pid = os.getpid()
449
+ except Exception:
450
+ pid = random.randint(0, sys.maxsize)
451
+ return os.path.join(self.install_dir, "test-easy-install-%s" % pid)
452
+
453
+ def warn_deprecated_options(self):
454
+ pass
455
+
456
+ def check_site_dir(self):
457
+ """Verify that self.install_dir is .pth-capable dir, if needed"""
458
+
459
+ instdir = normalize_path(self.install_dir)
460
+ pth_file = os.path.join(instdir, 'easy-install.pth')
461
+
462
+ # Is it a configured, PYTHONPATH, implicit, or explicit site dir?
463
+ is_site_dir = instdir in self.all_site_dirs
464
+
465
+ if not is_site_dir and not self.multi_version:
466
+ # No? Then directly test whether it does .pth file processing
467
+ is_site_dir = self.check_pth_processing()
468
+ else:
469
+ # make sure we can write to target dir
470
+ testfile = self.pseudo_tempname() + '.write-test'
471
+ test_exists = os.path.exists(testfile)
472
+ try:
473
+ if test_exists:
474
+ os.unlink(testfile)
475
+ open(testfile, 'w').close()
476
+ os.unlink(testfile)
477
+ except (OSError, IOError):
478
+ self.cant_write_to_target()
479
+
480
+ if not is_site_dir and not self.multi_version:
481
+ # Can't install non-multi to non-site dir
482
+ raise DistutilsError(self.no_default_version_msg())
483
+
484
+ if is_site_dir:
485
+ if self.pth_file is None:
486
+ self.pth_file = PthDistributions(pth_file, self.all_site_dirs)
487
+ else:
488
+ self.pth_file = None
489
+
490
+ if instdir not in map(normalize_path, _pythonpath()):
491
+ # only PYTHONPATH dirs need a site.py, so pretend it's there
492
+ self.sitepy_installed = True
493
+ elif self.multi_version and not os.path.exists(pth_file):
494
+ self.sitepy_installed = True # don't need site.py in this case
495
+ self.pth_file = None # and don't create a .pth file
496
+ self.install_dir = instdir
497
+
498
+ __cant_write_msg = textwrap.dedent("""
499
+ can't create or remove files in install directory
500
+
501
+ The following error occurred while trying to add or remove files in the
502
+ installation directory:
503
+
504
+ %s
505
+
506
+ The installation directory you specified (via --install-dir, --prefix, or
507
+ the distutils default setting) was:
508
+
509
+ %s
510
+ """).lstrip()
511
+
512
+ __not_exists_id = textwrap.dedent("""
513
+ This directory does not currently exist. Please create it and try again, or
514
+ choose a different installation directory (using the -d or --install-dir
515
+ option).
516
+ """).lstrip()
517
+
518
+ __access_msg = textwrap.dedent("""
519
+ Perhaps your account does not have write access to this directory? If the
520
+ installation directory is a system-owned directory, you may need to sign in
521
+ as the administrator or "root" account. If you do not have administrative
522
+ access to this machine, you may wish to choose a different installation
523
+ directory, preferably one that is listed in your PYTHONPATH environment
524
+ variable.
525
+
526
+ For information on other options, you may wish to consult the
527
+ documentation at:
528
+
529
+ https://setuptools.readthedocs.io/en/latest/easy_install.html
530
+
531
+ Please make the appropriate changes for your system and try again.
532
+ """).lstrip()
533
+
534
+ def cant_write_to_target(self):
535
+ msg = self.__cant_write_msg % (sys.exc_info()[1], self.install_dir,)
536
+
537
+ if not os.path.exists(self.install_dir):
538
+ msg += '\n' + self.__not_exists_id
539
+ else:
540
+ msg += '\n' + self.__access_msg
541
+ raise DistutilsError(msg)
542
+
543
+ def check_pth_processing(self):
544
+ """Empirically verify whether .pth files are supported in inst. dir"""
545
+ instdir = self.install_dir
546
+ log.info("Checking .pth file support in %s", instdir)
547
+ pth_file = self.pseudo_tempname() + ".pth"
548
+ ok_file = pth_file + '.ok'
549
+ ok_exists = os.path.exists(ok_file)
550
+ tmpl = _one_liner("""
551
+ import os
552
+ f = open({ok_file!r}, 'w')
553
+ f.write('OK')
554
+ f.close()
555
+ """) + '\n'
556
+ try:
557
+ if ok_exists:
558
+ os.unlink(ok_file)
559
+ dirname = os.path.dirname(ok_file)
560
+ pkg_resources.py31compat.makedirs(dirname, exist_ok=True)
561
+ f = open(pth_file, 'w')
562
+ except (OSError, IOError):
563
+ self.cant_write_to_target()
564
+ else:
565
+ try:
566
+ f.write(tmpl.format(**locals()))
567
+ f.close()
568
+ f = None
569
+ executable = sys.executable
570
+ if os.name == 'nt':
571
+ dirname, basename = os.path.split(executable)
572
+ alt = os.path.join(dirname, 'pythonw.exe')
573
+ use_alt = (
574
+ basename.lower() == 'python.exe' and
575
+ os.path.exists(alt)
576
+ )
577
+ if use_alt:
578
+ # use pythonw.exe to avoid opening a console window
579
+ executable = alt
580
+
581
+ from distutils.spawn import spawn
582
+
583
+ spawn([executable, '-E', '-c', 'pass'], 0)
584
+
585
+ if os.path.exists(ok_file):
586
+ log.info(
587
+ "TEST PASSED: %s appears to support .pth files",
588
+ instdir
589
+ )
590
+ return True
591
+ finally:
592
+ if f:
593
+ f.close()
594
+ if os.path.exists(ok_file):
595
+ os.unlink(ok_file)
596
+ if os.path.exists(pth_file):
597
+ os.unlink(pth_file)
598
+ if not self.multi_version:
599
+ log.warn("TEST FAILED: %s does NOT support .pth files", instdir)
600
+ return False
601
+
602
+ def install_egg_scripts(self, dist):
603
+ """Write all the scripts for `dist`, unless scripts are excluded"""
604
+ if not self.exclude_scripts and dist.metadata_isdir('scripts'):
605
+ for script_name in dist.metadata_listdir('scripts'):
606
+ if dist.metadata_isdir('scripts/' + script_name):
607
+ # The "script" is a directory, likely a Python 3
608
+ # __pycache__ directory, so skip it.
609
+ continue
610
+ self.install_script(
611
+ dist, script_name,
612
+ dist.get_metadata('scripts/' + script_name)
613
+ )
614
+ self.install_wrapper_scripts(dist)
615
+
616
+ def add_output(self, path):
617
+ if os.path.isdir(path):
618
+ for base, dirs, files in os.walk(path):
619
+ for filename in files:
620
+ self.outputs.append(os.path.join(base, filename))
621
+ else:
622
+ self.outputs.append(path)
623
+
624
+ def not_editable(self, spec):
625
+ if self.editable:
626
+ raise DistutilsArgError(
627
+ "Invalid argument %r: you can't use filenames or URLs "
628
+ "with --editable (except via the --find-links option)."
629
+ % (spec,)
630
+ )
631
+
632
+ def check_editable(self, spec):
633
+ if not self.editable:
634
+ return
635
+
636
+ if os.path.exists(os.path.join(self.build_directory, spec.key)):
637
+ raise DistutilsArgError(
638
+ "%r already exists in %s; can't do a checkout there" %
639
+ (spec.key, self.build_directory)
640
+ )
641
+
642
+ @contextlib.contextmanager
643
+ def _tmpdir(self):
644
+ tmpdir = tempfile.mkdtemp(prefix=u"easy_install-")
645
+ try:
646
+ # cast to str as workaround for #709 and #710 and #712
647
+ yield str(tmpdir)
648
+ finally:
649
+ os.path.exists(tmpdir) and rmtree(rmtree_safe(tmpdir))
650
+
651
+ def easy_install(self, spec, deps=False):
652
+ if not self.editable:
653
+ self.install_site_py()
654
+
655
+ with self._tmpdir() as tmpdir:
656
+ if not isinstance(spec, Requirement):
657
+ if URL_SCHEME(spec):
658
+ # It's a url, download it to tmpdir and process
659
+ self.not_editable(spec)
660
+ dl = self.package_index.download(spec, tmpdir)
661
+ return self.install_item(None, dl, tmpdir, deps, True)
662
+
663
+ elif os.path.exists(spec):
664
+ # Existing file or directory, just process it directly
665
+ self.not_editable(spec)
666
+ return self.install_item(None, spec, tmpdir, deps, True)
667
+ else:
668
+ spec = parse_requirement_arg(spec)
669
+
670
+ self.check_editable(spec)
671
+ dist = self.package_index.fetch_distribution(
672
+ spec, tmpdir, self.upgrade, self.editable,
673
+ not self.always_copy, self.local_index
674
+ )
675
+ if dist is None:
676
+ msg = "Could not find suitable distribution for %r" % spec
677
+ if self.always_copy:
678
+ msg += " (--always-copy skips system and development eggs)"
679
+ raise DistutilsError(msg)
680
+ elif dist.precedence == DEVELOP_DIST:
681
+ # .egg-info dists don't need installing, just process deps
682
+ self.process_distribution(spec, dist, deps, "Using")
683
+ return dist
684
+ else:
685
+ return self.install_item(spec, dist.location, tmpdir, deps)
686
+
687
+ def install_item(self, spec, download, tmpdir, deps, install_needed=False):
688
+
689
+ # Installation is also needed if file in tmpdir or is not an egg
690
+ install_needed = install_needed or self.always_copy
691
+ install_needed = install_needed or os.path.dirname(download) == tmpdir
692
+ install_needed = install_needed or not download.endswith('.egg')
693
+ install_needed = install_needed or (
694
+ self.always_copy_from is not None and
695
+ os.path.dirname(normalize_path(download)) ==
696
+ normalize_path(self.always_copy_from)
697
+ )
698
+
699
+ if spec and not install_needed:
700
+ # at this point, we know it's a local .egg, we just don't know if
701
+ # it's already installed.
702
+ for dist in self.local_index[spec.project_name]:
703
+ if dist.location == download:
704
+ break
705
+ else:
706
+ install_needed = True # it's not in the local index
707
+
708
+ log.info("Processing %s", os.path.basename(download))
709
+
710
+ if install_needed:
711
+ dists = self.install_eggs(spec, download, tmpdir)
712
+ for dist in dists:
713
+ self.process_distribution(spec, dist, deps)
714
+ else:
715
+ dists = [self.egg_distribution(download)]
716
+ self.process_distribution(spec, dists[0], deps, "Using")
717
+
718
+ if spec is not None:
719
+ for dist in dists:
720
+ if dist in spec:
721
+ return dist
722
+
723
+ def select_scheme(self, name):
724
+ """Sets the install directories by applying the install schemes."""
725
+ # it's the caller's problem if they supply a bad name!
726
+ scheme = INSTALL_SCHEMES[name]
727
+ for key in SCHEME_KEYS:
728
+ attrname = 'install_' + key
729
+ if getattr(self, attrname) is None:
730
+ setattr(self, attrname, scheme[key])
731
+
732
+ def process_distribution(self, requirement, dist, deps=True, *info):
733
+ self.update_pth(dist)
734
+ self.package_index.add(dist)
735
+ if dist in self.local_index[dist.key]:
736
+ self.local_index.remove(dist)
737
+ self.local_index.add(dist)
738
+ self.install_egg_scripts(dist)
739
+ self.installed_projects[dist.key] = dist
740
+ log.info(self.installation_report(requirement, dist, *info))
741
+ if (dist.has_metadata('dependency_links.txt') and
742
+ not self.no_find_links):
743
+ self.package_index.add_find_links(
744
+ dist.get_metadata_lines('dependency_links.txt')
745
+ )
746
+ if not deps and not self.always_copy:
747
+ return
748
+ elif requirement is not None and dist.key != requirement.key:
749
+ log.warn("Skipping dependencies for %s", dist)
750
+ return # XXX this is not the distribution we were looking for
751
+ elif requirement is None or dist not in requirement:
752
+ # if we wound up with a different version, resolve what we've got
753
+ distreq = dist.as_requirement()
754
+ requirement = Requirement(str(distreq))
755
+ log.info("Processing dependencies for %s", requirement)
756
+ try:
757
+ distros = WorkingSet([]).resolve(
758
+ [requirement], self.local_index, self.easy_install
759
+ )
760
+ except DistributionNotFound as e:
761
+ raise DistutilsError(str(e))
762
+ except VersionConflict as e:
763
+ raise DistutilsError(e.report())
764
+ if self.always_copy or self.always_copy_from:
765
+ # Force all the relevant distros to be copied or activated
766
+ for dist in distros:
767
+ if dist.key not in self.installed_projects:
768
+ self.easy_install(dist.as_requirement())
769
+ log.info("Finished processing dependencies for %s", requirement)
770
+
771
+ def should_unzip(self, dist):
772
+ if self.zip_ok is not None:
773
+ return not self.zip_ok
774
+ if dist.has_metadata('not-zip-safe'):
775
+ return True
776
+ if not dist.has_metadata('zip-safe'):
777
+ return True
778
+ return False
779
+
780
+ def maybe_move(self, spec, dist_filename, setup_base):
781
+ dst = os.path.join(self.build_directory, spec.key)
782
+ if os.path.exists(dst):
783
+ msg = (
784
+ "%r already exists in %s; build directory %s will not be kept"
785
+ )
786
+ log.warn(msg, spec.key, self.build_directory, setup_base)
787
+ return setup_base
788
+ if os.path.isdir(dist_filename):
789
+ setup_base = dist_filename
790
+ else:
791
+ if os.path.dirname(dist_filename) == setup_base:
792
+ os.unlink(dist_filename) # get it out of the tmp dir
793
+ contents = os.listdir(setup_base)
794
+ if len(contents) == 1:
795
+ dist_filename = os.path.join(setup_base, contents[0])
796
+ if os.path.isdir(dist_filename):
797
+ # if the only thing there is a directory, move it instead
798
+ setup_base = dist_filename
799
+ ensure_directory(dst)
800
+ shutil.move(setup_base, dst)
801
+ return dst
802
+
803
+ def install_wrapper_scripts(self, dist):
804
+ if self.exclude_scripts:
805
+ return
806
+ for args in ScriptWriter.best().get_args(dist):
807
+ self.write_script(*args)
808
+
809
+ def install_script(self, dist, script_name, script_text, dev_path=None):
810
+ """Generate a legacy script wrapper and install it"""
811
+ spec = str(dist.as_requirement())
812
+ is_script = is_python_script(script_text, script_name)
813
+
814
+ if is_script:
815
+ body = self._load_template(dev_path) % locals()
816
+ script_text = ScriptWriter.get_header(script_text) + body
817
+ self.write_script(script_name, _to_bytes(script_text), 'b')
818
+
819
+ @staticmethod
820
+ def _load_template(dev_path):
821
+ """
822
+ There are a couple of template scripts in the package. This
823
+ function loads one of them and prepares it for use.
824
+ """
825
+ # See https://github.com/pypa/setuptools/issues/134 for info
826
+ # on script file naming and downstream issues with SVR4
827
+ name = 'script.tmpl'
828
+ if dev_path:
829
+ name = name.replace('.tmpl', ' (dev).tmpl')
830
+
831
+ raw_bytes = resource_string('setuptools', name)
832
+ return raw_bytes.decode('utf-8')
833
+
834
+ def write_script(self, script_name, contents, mode="t", blockers=()):
835
+ """Write an executable file to the scripts directory"""
836
+ self.delete_blockers( # clean up old .py/.pyw w/o a script
837
+ [os.path.join(self.script_dir, x) for x in blockers]
838
+ )
839
+ log.info("Installing %s script to %s", script_name, self.script_dir)
840
+ target = os.path.join(self.script_dir, script_name)
841
+ self.add_output(target)
842
+
843
+ if self.dry_run:
844
+ return
845
+
846
+ mask = current_umask()
847
+ ensure_directory(target)
848
+ if os.path.exists(target):
849
+ os.unlink(target)
850
+ with open(target, "w" + mode) as f:
851
+ f.write(contents)
852
+ chmod(target, 0o777 - mask)
853
+
854
+ def install_eggs(self, spec, dist_filename, tmpdir):
855
+ # .egg dirs or files are already built, so just return them
856
+ if dist_filename.lower().endswith('.egg'):
857
+ return [self.install_egg(dist_filename, tmpdir)]
858
+ elif dist_filename.lower().endswith('.exe'):
859
+ return [self.install_exe(dist_filename, tmpdir)]
860
+ elif dist_filename.lower().endswith('.whl'):
861
+ return [self.install_wheel(dist_filename, tmpdir)]
862
+
863
+ # Anything else, try to extract and build
864
+ setup_base = tmpdir
865
+ if os.path.isfile(dist_filename) and not dist_filename.endswith('.py'):
866
+ unpack_archive(dist_filename, tmpdir, self.unpack_progress)
867
+ elif os.path.isdir(dist_filename):
868
+ setup_base = os.path.abspath(dist_filename)
869
+
870
+ if (setup_base.startswith(tmpdir) # something we downloaded
871
+ and self.build_directory and spec is not None):
872
+ setup_base = self.maybe_move(spec, dist_filename, setup_base)
873
+
874
+ # Find the setup.py file
875
+ setup_script = os.path.join(setup_base, 'setup.py')
876
+
877
+ if not os.path.exists(setup_script):
878
+ setups = glob(os.path.join(setup_base, '*', 'setup.py'))
879
+ if not setups:
880
+ raise DistutilsError(
881
+ "Couldn't find a setup script in %s" %
882
+ os.path.abspath(dist_filename)
883
+ )
884
+ if len(setups) > 1:
885
+ raise DistutilsError(
886
+ "Multiple setup scripts in %s" %
887
+ os.path.abspath(dist_filename)
888
+ )
889
+ setup_script = setups[0]
890
+
891
+ # Now run it, and return the result
892
+ if self.editable:
893
+ log.info(self.report_editable(spec, setup_script))
894
+ return []
895
+ else:
896
+ return self.build_and_install(setup_script, setup_base)
897
+
898
+ def egg_distribution(self, egg_path):
899
+ if os.path.isdir(egg_path):
900
+ metadata = PathMetadata(egg_path, os.path.join(egg_path,
901
+ 'EGG-INFO'))
902
+ else:
903
+ metadata = EggMetadata(zipimport.zipimporter(egg_path))
904
+ return Distribution.from_filename(egg_path, metadata=metadata)
905
+
906
+ def install_egg(self, egg_path, tmpdir):
907
+ destination = os.path.join(
908
+ self.install_dir,
909
+ os.path.basename(egg_path),
910
+ )
911
+ destination = os.path.abspath(destination)
912
+ if not self.dry_run:
913
+ ensure_directory(destination)
914
+
915
+ dist = self.egg_distribution(egg_path)
916
+ if not samefile(egg_path, destination):
917
+ if os.path.isdir(destination) and not os.path.islink(destination):
918
+ dir_util.remove_tree(destination, dry_run=self.dry_run)
919
+ elif os.path.exists(destination):
920
+ self.execute(
921
+ os.unlink,
922
+ (destination,),
923
+ "Removing " + destination,
924
+ )
925
+ try:
926
+ new_dist_is_zipped = False
927
+ if os.path.isdir(egg_path):
928
+ if egg_path.startswith(tmpdir):
929
+ f, m = shutil.move, "Moving"
930
+ else:
931
+ f, m = shutil.copytree, "Copying"
932
+ elif self.should_unzip(dist):
933
+ self.mkpath(destination)
934
+ f, m = self.unpack_and_compile, "Extracting"
935
+ else:
936
+ new_dist_is_zipped = True
937
+ if egg_path.startswith(tmpdir):
938
+ f, m = shutil.move, "Moving"
939
+ else:
940
+ f, m = shutil.copy2, "Copying"
941
+ self.execute(
942
+ f,
943
+ (egg_path, destination),
944
+ (m + " %s to %s") % (
945
+ os.path.basename(egg_path),
946
+ os.path.dirname(destination)
947
+ ),
948
+ )
949
+ update_dist_caches(
950
+ destination,
951
+ fix_zipimporter_caches=new_dist_is_zipped,
952
+ )
953
+ except Exception:
954
+ update_dist_caches(destination, fix_zipimporter_caches=False)
955
+ raise
956
+
957
+ self.add_output(destination)
958
+ return self.egg_distribution(destination)
959
+
960
+ def install_exe(self, dist_filename, tmpdir):
961
+ # See if it's valid, get data
962
+ cfg = extract_wininst_cfg(dist_filename)
963
+ if cfg is None:
964
+ raise DistutilsError(
965
+ "%s is not a valid distutils Windows .exe" % dist_filename
966
+ )
967
+ # Create a dummy distribution object until we build the real distro
968
+ dist = Distribution(
969
+ None,
970
+ project_name=cfg.get('metadata', 'name'),
971
+ version=cfg.get('metadata', 'version'), platform=get_platform(),
972
+ )
973
+
974
+ # Convert the .exe to an unpacked egg
975
+ egg_path = os.path.join(tmpdir, dist.egg_name() + '.egg')
976
+ dist.location = egg_path
977
+ egg_tmp = egg_path + '.tmp'
978
+ _egg_info = os.path.join(egg_tmp, 'EGG-INFO')
979
+ pkg_inf = os.path.join(_egg_info, 'PKG-INFO')
980
+ ensure_directory(pkg_inf) # make sure EGG-INFO dir exists
981
+ dist._provider = PathMetadata(egg_tmp, _egg_info) # XXX
982
+ self.exe_to_egg(dist_filename, egg_tmp)
983
+
984
+ # Write EGG-INFO/PKG-INFO
985
+ if not os.path.exists(pkg_inf):
986
+ f = open(pkg_inf, 'w')
987
+ f.write('Metadata-Version: 1.0\n')
988
+ for k, v in cfg.items('metadata'):
989
+ if k != 'target_version':
990
+ f.write('%s: %s\n' % (k.replace('_', '-').title(), v))
991
+ f.close()
992
+ script_dir = os.path.join(_egg_info, 'scripts')
993
+ # delete entry-point scripts to avoid duping
994
+ self.delete_blockers([
995
+ os.path.join(script_dir, args[0])
996
+ for args in ScriptWriter.get_args(dist)
997
+ ])
998
+ # Build .egg file from tmpdir
999
+ bdist_egg.make_zipfile(
1000
+ egg_path, egg_tmp, verbose=self.verbose, dry_run=self.dry_run,
1001
+ )
1002
+ # install the .egg
1003
+ return self.install_egg(egg_path, tmpdir)
1004
+
1005
+ def exe_to_egg(self, dist_filename, egg_tmp):
1006
+ """Extract a bdist_wininst to the directories an egg would use"""
1007
+ # Check for .pth file and set up prefix translations
1008
+ prefixes = get_exe_prefixes(dist_filename)
1009
+ to_compile = []
1010
+ native_libs = []
1011
+ top_level = {}
1012
+
1013
+ def process(src, dst):
1014
+ s = src.lower()
1015
+ for old, new in prefixes:
1016
+ if s.startswith(old):
1017
+ src = new + src[len(old):]
1018
+ parts = src.split('/')
1019
+ dst = os.path.join(egg_tmp, *parts)
1020
+ dl = dst.lower()
1021
+ if dl.endswith('.pyd') or dl.endswith('.dll'):
1022
+ parts[-1] = bdist_egg.strip_module(parts[-1])
1023
+ top_level[os.path.splitext(parts[0])[0]] = 1
1024
+ native_libs.append(src)
1025
+ elif dl.endswith('.py') and old != 'SCRIPTS/':
1026
+ top_level[os.path.splitext(parts[0])[0]] = 1
1027
+ to_compile.append(dst)
1028
+ return dst
1029
+ if not src.endswith('.pth'):
1030
+ log.warn("WARNING: can't process %s", src)
1031
+ return None
1032
+
1033
+ # extract, tracking .pyd/.dll->native_libs and .py -> to_compile
1034
+ unpack_archive(dist_filename, egg_tmp, process)
1035
+ stubs = []
1036
+ for res in native_libs:
1037
+ if res.lower().endswith('.pyd'): # create stubs for .pyd's
1038
+ parts = res.split('/')
1039
+ resource = parts[-1]
1040
+ parts[-1] = bdist_egg.strip_module(parts[-1]) + '.py'
1041
+ pyfile = os.path.join(egg_tmp, *parts)
1042
+ to_compile.append(pyfile)
1043
+ stubs.append(pyfile)
1044
+ bdist_egg.write_stub(resource, pyfile)
1045
+ self.byte_compile(to_compile) # compile .py's
1046
+ bdist_egg.write_safety_flag(
1047
+ os.path.join(egg_tmp, 'EGG-INFO'),
1048
+ bdist_egg.analyze_egg(egg_tmp, stubs)) # write zip-safety flag
1049
+
1050
+ for name in 'top_level', 'native_libs':
1051
+ if locals()[name]:
1052
+ txt = os.path.join(egg_tmp, 'EGG-INFO', name + '.txt')
1053
+ if not os.path.exists(txt):
1054
+ f = open(txt, 'w')
1055
+ f.write('\n'.join(locals()[name]) + '\n')
1056
+ f.close()
1057
+
1058
+ def install_wheel(self, wheel_path, tmpdir):
1059
+ wheel = Wheel(wheel_path)
1060
+ assert wheel.is_compatible()
1061
+ destination = os.path.join(self.install_dir, wheel.egg_name())
1062
+ destination = os.path.abspath(destination)
1063
+ if not self.dry_run:
1064
+ ensure_directory(destination)
1065
+ if os.path.isdir(destination) and not os.path.islink(destination):
1066
+ dir_util.remove_tree(destination, dry_run=self.dry_run)
1067
+ elif os.path.exists(destination):
1068
+ self.execute(
1069
+ os.unlink,
1070
+ (destination,),
1071
+ "Removing " + destination,
1072
+ )
1073
+ try:
1074
+ self.execute(
1075
+ wheel.install_as_egg,
1076
+ (destination,),
1077
+ ("Installing %s to %s") % (
1078
+ os.path.basename(wheel_path),
1079
+ os.path.dirname(destination)
1080
+ ),
1081
+ )
1082
+ finally:
1083
+ update_dist_caches(destination, fix_zipimporter_caches=False)
1084
+ self.add_output(destination)
1085
+ return self.egg_distribution(destination)
1086
+
1087
+ __mv_warning = textwrap.dedent("""
1088
+ Because this distribution was installed --multi-version, before you can
1089
+ import modules from this package in an application, you will need to
1090
+ 'import pkg_resources' and then use a 'require()' call similar to one of
1091
+ these examples, in order to select the desired version:
1092
+
1093
+ pkg_resources.require("%(name)s") # latest installed version
1094
+ pkg_resources.require("%(name)s==%(version)s") # this exact version
1095
+ pkg_resources.require("%(name)s>=%(version)s") # this version or higher
1096
+ """).lstrip()
1097
+
1098
+ __id_warning = textwrap.dedent("""
1099
+ Note also that the installation directory must be on sys.path at runtime for
1100
+ this to work. (e.g. by being the application's script directory, by being on
1101
+ PYTHONPATH, or by being added to sys.path by your code.)
1102
+ """)
1103
+
1104
+ def installation_report(self, req, dist, what="Installed"):
1105
+ """Helpful installation message for display to package users"""
1106
+ msg = "\n%(what)s %(eggloc)s%(extras)s"
1107
+ if self.multi_version and not self.no_report:
1108
+ msg += '\n' + self.__mv_warning
1109
+ if self.install_dir not in map(normalize_path, sys.path):
1110
+ msg += '\n' + self.__id_warning
1111
+
1112
+ eggloc = dist.location
1113
+ name = dist.project_name
1114
+ version = dist.version
1115
+ extras = '' # TODO: self.report_extras(req, dist)
1116
+ return msg % locals()
1117
+
1118
+ __editable_msg = textwrap.dedent("""
1119
+ Extracted editable version of %(spec)s to %(dirname)s
1120
+
1121
+ If it uses setuptools in its setup script, you can activate it in
1122
+ "development" mode by going to that directory and running::
1123
+
1124
+ %(python)s setup.py develop
1125
+
1126
+ See the setuptools documentation for the "develop" command for more info.
1127
+ """).lstrip()
1128
+
1129
+ def report_editable(self, spec, setup_script):
1130
+ dirname = os.path.dirname(setup_script)
1131
+ python = sys.executable
1132
+ return '\n' + self.__editable_msg % locals()
1133
+
1134
+ def run_setup(self, setup_script, setup_base, args):
1135
+ sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg)
1136
+ sys.modules.setdefault('distutils.command.egg_info', egg_info)
1137
+
1138
+ args = list(args)
1139
+ if self.verbose > 2:
1140
+ v = 'v' * (self.verbose - 1)
1141
+ args.insert(0, '-' + v)
1142
+ elif self.verbose < 2:
1143
+ args.insert(0, '-q')
1144
+ if self.dry_run:
1145
+ args.insert(0, '-n')
1146
+ log.info(
1147
+ "Running %s %s", setup_script[len(setup_base) + 1:], ' '.join(args)
1148
+ )
1149
+ try:
1150
+ run_setup(setup_script, args)
1151
+ except SystemExit as v:
1152
+ raise DistutilsError("Setup script exited with %s" % (v.args[0],))
1153
+
1154
+ def build_and_install(self, setup_script, setup_base):
1155
+ args = ['bdist_egg', '--dist-dir']
1156
+
1157
+ dist_dir = tempfile.mkdtemp(
1158
+ prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script)
1159
+ )
1160
+ try:
1161
+ self._set_fetcher_options(os.path.dirname(setup_script))
1162
+ args.append(dist_dir)
1163
+
1164
+ self.run_setup(setup_script, setup_base, args)
1165
+ all_eggs = Environment([dist_dir])
1166
+ eggs = []
1167
+ for key in all_eggs:
1168
+ for dist in all_eggs[key]:
1169
+ eggs.append(self.install_egg(dist.location, setup_base))
1170
+ if not eggs and not self.dry_run:
1171
+ log.warn("No eggs found in %s (setup script problem?)",
1172
+ dist_dir)
1173
+ return eggs
1174
+ finally:
1175
+ rmtree(dist_dir)
1176
+ log.set_verbosity(self.verbose) # restore our log verbosity
1177
+
1178
+ def _set_fetcher_options(self, base):
1179
+ """
1180
+ When easy_install is about to run bdist_egg on a source dist, that
1181
+ source dist might have 'setup_requires' directives, requiring
1182
+ additional fetching. Ensure the fetcher options given to easy_install
1183
+ are available to that command as well.
1184
+ """
1185
+ # find the fetch options from easy_install and write them out
1186
+ # to the setup.cfg file.
1187
+ ei_opts = self.distribution.get_option_dict('easy_install').copy()
1188
+ fetch_directives = (
1189
+ 'find_links', 'site_dirs', 'index_url', 'optimize', 'allow_hosts',
1190
+ )
1191
+ fetch_options = {}
1192
+ for key, val in ei_opts.items():
1193
+ if key not in fetch_directives:
1194
+ continue
1195
+ fetch_options[key.replace('_', '-')] = val[1]
1196
+ # create a settings dictionary suitable for `edit_config`
1197
+ settings = dict(easy_install=fetch_options)
1198
+ cfg_filename = os.path.join(base, 'setup.cfg')
1199
+ setopt.edit_config(cfg_filename, settings)
1200
+
1201
+ def update_pth(self, dist):
1202
+ if self.pth_file is None:
1203
+ return
1204
+
1205
+ for d in self.pth_file[dist.key]: # drop old entries
1206
+ if self.multi_version or d.location != dist.location:
1207
+ log.info("Removing %s from easy-install.pth file", d)
1208
+ self.pth_file.remove(d)
1209
+ if d.location in self.shadow_path:
1210
+ self.shadow_path.remove(d.location)
1211
+
1212
+ if not self.multi_version:
1213
+ if dist.location in self.pth_file.paths:
1214
+ log.info(
1215
+ "%s is already the active version in easy-install.pth",
1216
+ dist,
1217
+ )
1218
+ else:
1219
+ log.info("Adding %s to easy-install.pth file", dist)
1220
+ self.pth_file.add(dist) # add new entry
1221
+ if dist.location not in self.shadow_path:
1222
+ self.shadow_path.append(dist.location)
1223
+
1224
+ if not self.dry_run:
1225
+
1226
+ self.pth_file.save()
1227
+
1228
+ if dist.key == 'setuptools':
1229
+ # Ensure that setuptools itself never becomes unavailable!
1230
+ # XXX should this check for latest version?
1231
+ filename = os.path.join(self.install_dir, 'setuptools.pth')
1232
+ if os.path.islink(filename):
1233
+ os.unlink(filename)
1234
+ f = open(filename, 'wt')
1235
+ f.write(self.pth_file.make_relative(dist.location) + '\n')
1236
+ f.close()
1237
+
1238
+ def unpack_progress(self, src, dst):
1239
+ # Progress filter for unpacking
1240
+ log.debug("Unpacking %s to %s", src, dst)
1241
+ return dst # only unpack-and-compile skips files for dry run
1242
+
1243
+ def unpack_and_compile(self, egg_path, destination):
1244
+ to_compile = []
1245
+ to_chmod = []
1246
+
1247
+ def pf(src, dst):
1248
+ if dst.endswith('.py') and not src.startswith('EGG-INFO/'):
1249
+ to_compile.append(dst)
1250
+ elif dst.endswith('.dll') or dst.endswith('.so'):
1251
+ to_chmod.append(dst)
1252
+ self.unpack_progress(src, dst)
1253
+ return not self.dry_run and dst or None
1254
+
1255
+ unpack_archive(egg_path, destination, pf)
1256
+ self.byte_compile(to_compile)
1257
+ if not self.dry_run:
1258
+ for f in to_chmod:
1259
+ mode = ((os.stat(f)[stat.ST_MODE]) | 0o555) & 0o7755
1260
+ chmod(f, mode)
1261
+
1262
+ def byte_compile(self, to_compile):
1263
+ if sys.dont_write_bytecode:
1264
+ return
1265
+
1266
+ from distutils.util import byte_compile
1267
+
1268
+ try:
1269
+ # try to make the byte compile messages quieter
1270
+ log.set_verbosity(self.verbose - 1)
1271
+
1272
+ byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run)
1273
+ if self.optimize:
1274
+ byte_compile(
1275
+ to_compile, optimize=self.optimize, force=1,
1276
+ dry_run=self.dry_run,
1277
+ )
1278
+ finally:
1279
+ log.set_verbosity(self.verbose) # restore original verbosity
1280
+
1281
+ __no_default_msg = textwrap.dedent("""
1282
+ bad install directory or PYTHONPATH
1283
+
1284
+ You are attempting to install a package to a directory that is not
1285
+ on PYTHONPATH and which Python does not read ".pth" files from. The
1286
+ installation directory you specified (via --install-dir, --prefix, or
1287
+ the distutils default setting) was:
1288
+
1289
+ %s
1290
+
1291
+ and your PYTHONPATH environment variable currently contains:
1292
+
1293
+ %r
1294
+
1295
+ Here are some of your options for correcting the problem:
1296
+
1297
+ * You can choose a different installation directory, i.e., one that is
1298
+ on PYTHONPATH or supports .pth files
1299
+
1300
+ * You can add the installation directory to the PYTHONPATH environment
1301
+ variable. (It must then also be on PYTHONPATH whenever you run
1302
+ Python and want to use the package(s) you are installing.)
1303
+
1304
+ * You can set up the installation directory to support ".pth" files by
1305
+ using one of the approaches described here:
1306
+
1307
+ https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations
1308
+
1309
+
1310
+ Please make the appropriate changes for your system and try again.""").lstrip()
1311
+
1312
+ def no_default_version_msg(self):
1313
+ template = self.__no_default_msg
1314
+ return template % (self.install_dir, os.environ.get('PYTHONPATH', ''))
1315
+
1316
+ def install_site_py(self):
1317
+ """Make sure there's a site.py in the target dir, if needed"""
1318
+
1319
+ if self.sitepy_installed:
1320
+ return # already did it, or don't need to
1321
+
1322
+ sitepy = os.path.join(self.install_dir, "site.py")
1323
+ source = resource_string("setuptools", "site-patch.py")
1324
+ source = source.decode('utf-8')
1325
+ current = ""
1326
+
1327
+ if os.path.exists(sitepy):
1328
+ log.debug("Checking existing site.py in %s", self.install_dir)
1329
+ with io.open(sitepy) as strm:
1330
+ current = strm.read()
1331
+
1332
+ if not current.startswith('def __boot():'):
1333
+ raise DistutilsError(
1334
+ "%s is not a setuptools-generated site.py; please"
1335
+ " remove it." % sitepy
1336
+ )
1337
+
1338
+ if current != source:
1339
+ log.info("Creating %s", sitepy)
1340
+ if not self.dry_run:
1341
+ ensure_directory(sitepy)
1342
+ with io.open(sitepy, 'w', encoding='utf-8') as strm:
1343
+ strm.write(source)
1344
+ self.byte_compile([sitepy])
1345
+
1346
+ self.sitepy_installed = True
1347
+
1348
+ def create_home_path(self):
1349
+ """Create directories under ~."""
1350
+ if not self.user:
1351
+ return
1352
+ home = convert_path(os.path.expanduser("~"))
1353
+ for name, path in six.iteritems(self.config_vars):
1354
+ if path.startswith(home) and not os.path.isdir(path):
1355
+ self.debug_print("os.makedirs('%s', 0o700)" % path)
1356
+ os.makedirs(path, 0o700)
1357
+
1358
+ INSTALL_SCHEMES = dict(
1359
+ posix=dict(
1360
+ install_dir='$base/lib/python$py_version_short/site-packages',
1361
+ script_dir='$base/bin',
1362
+ ),
1363
+ )
1364
+
1365
+ DEFAULT_SCHEME = dict(
1366
+ install_dir='$base/Lib/site-packages',
1367
+ script_dir='$base/Scripts',
1368
+ )
1369
+
1370
+ def _expand(self, *attrs):
1371
+ config_vars = self.get_finalized_command('install').config_vars
1372
+
1373
+ if self.prefix:
1374
+ # Set default install_dir/scripts from --prefix
1375
+ config_vars = config_vars.copy()
1376
+ config_vars['base'] = self.prefix
1377
+ scheme = self.INSTALL_SCHEMES.get(os.name, self.DEFAULT_SCHEME)
1378
+ for attr, val in scheme.items():
1379
+ if getattr(self, attr, None) is None:
1380
+ setattr(self, attr, val)
1381
+
1382
+ from distutils.util import subst_vars
1383
+
1384
+ for attr in attrs:
1385
+ val = getattr(self, attr)
1386
+ if val is not None:
1387
+ val = subst_vars(val, config_vars)
1388
+ if os.name == 'posix':
1389
+ val = os.path.expanduser(val)
1390
+ setattr(self, attr, val)
1391
+
1392
+
1393
+ def _pythonpath():
1394
+ items = os.environ.get('PYTHONPATH', '').split(os.pathsep)
1395
+ return filter(None, items)
1396
+
1397
+
1398
+ def get_site_dirs():
1399
+ """
1400
+ Return a list of 'site' dirs
1401
+ """
1402
+
1403
+ sitedirs = []
1404
+
1405
+ # start with PYTHONPATH
1406
+ sitedirs.extend(_pythonpath())
1407
+
1408
+ prefixes = [sys.prefix]
1409
+ if sys.exec_prefix != sys.prefix:
1410
+ prefixes.append(sys.exec_prefix)
1411
+ for prefix in prefixes:
1412
+ if prefix:
1413
+ if sys.platform in ('os2emx', 'riscos'):
1414
+ sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
1415
+ elif os.sep == '/':
1416
+ sitedirs.extend([
1417
+ os.path.join(
1418
+ prefix,
1419
+ "lib",
1420
+ "python{}.{}".format(*sys.version_info),
1421
+ "site-packages",
1422
+ ),
1423
+ os.path.join(prefix, "lib", "site-python"),
1424
+ ])
1425
+ else:
1426
+ sitedirs.extend([
1427
+ prefix,
1428
+ os.path.join(prefix, "lib", "site-packages"),
1429
+ ])
1430
+ if sys.platform == 'darwin':
1431
+ # for framework builds *only* we add the standard Apple
1432
+ # locations. Currently only per-user, but /Library and
1433
+ # /Network/Library could be added too
1434
+ if 'Python.framework' in prefix:
1435
+ home = os.environ.get('HOME')
1436
+ if home:
1437
+ home_sp = os.path.join(
1438
+ home,
1439
+ 'Library',
1440
+ 'Python',
1441
+ '{}.{}'.format(*sys.version_info),
1442
+ 'site-packages',
1443
+ )
1444
+ sitedirs.append(home_sp)
1445
+ lib_paths = get_path('purelib'), get_path('platlib')
1446
+ for site_lib in lib_paths:
1447
+ if site_lib not in sitedirs:
1448
+ sitedirs.append(site_lib)
1449
+
1450
+ if site.ENABLE_USER_SITE:
1451
+ sitedirs.append(site.USER_SITE)
1452
+
1453
+ try:
1454
+ sitedirs.extend(site.getsitepackages())
1455
+ except AttributeError:
1456
+ pass
1457
+
1458
+ sitedirs = list(map(normalize_path, sitedirs))
1459
+
1460
+ return sitedirs
1461
+
1462
+
1463
+ def expand_paths(inputs):
1464
+ """Yield sys.path directories that might contain "old-style" packages"""
1465
+
1466
+ seen = {}
1467
+
1468
+ for dirname in inputs:
1469
+ dirname = normalize_path(dirname)
1470
+ if dirname in seen:
1471
+ continue
1472
+
1473
+ seen[dirname] = 1
1474
+ if not os.path.isdir(dirname):
1475
+ continue
1476
+
1477
+ files = os.listdir(dirname)
1478
+ yield dirname, files
1479
+
1480
+ for name in files:
1481
+ if not name.endswith('.pth'):
1482
+ # We only care about the .pth files
1483
+ continue
1484
+ if name in ('easy-install.pth', 'setuptools.pth'):
1485
+ # Ignore .pth files that we control
1486
+ continue
1487
+
1488
+ # Read the .pth file
1489
+ f = open(os.path.join(dirname, name))
1490
+ lines = list(yield_lines(f))
1491
+ f.close()
1492
+
1493
+ # Yield existing non-dupe, non-import directory lines from it
1494
+ for line in lines:
1495
+ if not line.startswith("import"):
1496
+ line = normalize_path(line.rstrip())
1497
+ if line not in seen:
1498
+ seen[line] = 1
1499
+ if not os.path.isdir(line):
1500
+ continue
1501
+ yield line, os.listdir(line)
1502
+
1503
+
1504
+ def extract_wininst_cfg(dist_filename):
1505
+ """Extract configuration data from a bdist_wininst .exe
1506
+
1507
+ Returns a configparser.RawConfigParser, or None
1508
+ """
1509
+ f = open(dist_filename, 'rb')
1510
+ try:
1511
+ endrec = zipfile._EndRecData(f)
1512
+ if endrec is None:
1513
+ return None
1514
+
1515
+ prepended = (endrec[9] - endrec[5]) - endrec[6]
1516
+ if prepended < 12: # no wininst data here
1517
+ return None
1518
+ f.seek(prepended - 12)
1519
+
1520
+ tag, cfglen, bmlen = struct.unpack("<iii", f.read(12))
1521
+ if tag not in (0x1234567A, 0x1234567B):
1522
+ return None # not a valid tag
1523
+
1524
+ f.seek(prepended - (12 + cfglen))
1525
+ init = {'version': '', 'target_version': ''}
1526
+ cfg = configparser.RawConfigParser(init)
1527
+ try:
1528
+ part = f.read(cfglen)
1529
+ # Read up to the first null byte.
1530
+ config = part.split(b'\0', 1)[0]
1531
+ # Now the config is in bytes, but for RawConfigParser, it should
1532
+ # be text, so decode it.
1533
+ config = config.decode(sys.getfilesystemencoding())
1534
+ cfg.readfp(six.StringIO(config))
1535
+ except configparser.Error:
1536
+ return None
1537
+ if not cfg.has_section('metadata') or not cfg.has_section('Setup'):
1538
+ return None
1539
+ return cfg
1540
+
1541
+ finally:
1542
+ f.close()
1543
+
1544
+
1545
+ def get_exe_prefixes(exe_filename):
1546
+ """Get exe->egg path translations for a given .exe file"""
1547
+
1548
+ prefixes = [
1549
+ ('PURELIB/', ''),
1550
+ ('PLATLIB/pywin32_system32', ''),
1551
+ ('PLATLIB/', ''),
1552
+ ('SCRIPTS/', 'EGG-INFO/scripts/'),
1553
+ ('DATA/lib/site-packages', ''),
1554
+ ]
1555
+ z = zipfile.ZipFile(exe_filename)
1556
+ try:
1557
+ for info in z.infolist():
1558
+ name = info.filename
1559
+ parts = name.split('/')
1560
+ if len(parts) == 3 and parts[2] == 'PKG-INFO':
1561
+ if parts[1].endswith('.egg-info'):
1562
+ prefixes.insert(0, ('/'.join(parts[:2]), 'EGG-INFO/'))
1563
+ break
1564
+ if len(parts) != 2 or not name.endswith('.pth'):
1565
+ continue
1566
+ if name.endswith('-nspkg.pth'):
1567
+ continue
1568
+ if parts[0].upper() in ('PURELIB', 'PLATLIB'):
1569
+ contents = z.read(name)
1570
+ if not six.PY2:
1571
+ contents = contents.decode()
1572
+ for pth in yield_lines(contents):
1573
+ pth = pth.strip().replace('\\', '/')
1574
+ if not pth.startswith('import'):
1575
+ prefixes.append((('%s/%s/' % (parts[0], pth)), ''))
1576
+ finally:
1577
+ z.close()
1578
+ prefixes = [(x.lower(), y) for x, y in prefixes]
1579
+ prefixes.sort()
1580
+ prefixes.reverse()
1581
+ return prefixes
1582
+
1583
+
1584
+ class PthDistributions(Environment):
1585
+ """A .pth file with Distribution paths in it"""
1586
+
1587
+ dirty = False
1588
+
1589
+ def __init__(self, filename, sitedirs=()):
1590
+ self.filename = filename
1591
+ self.sitedirs = list(map(normalize_path, sitedirs))
1592
+ self.basedir = normalize_path(os.path.dirname(self.filename))
1593
+ self._load()
1594
+ Environment.__init__(self, [], None, None)
1595
+ for path in yield_lines(self.paths):
1596
+ list(map(self.add, find_distributions(path, True)))
1597
+
1598
+ def _load(self):
1599
+ self.paths = []
1600
+ saw_import = False
1601
+ seen = dict.fromkeys(self.sitedirs)
1602
+ if os.path.isfile(self.filename):
1603
+ f = open(self.filename, 'rt')
1604
+ for line in f:
1605
+ if line.startswith('import'):
1606
+ saw_import = True
1607
+ continue
1608
+ path = line.rstrip()
1609
+ self.paths.append(path)
1610
+ if not path.strip() or path.strip().startswith('#'):
1611
+ continue
1612
+ # skip non-existent paths, in case somebody deleted a package
1613
+ # manually, and duplicate paths as well
1614
+ path = self.paths[-1] = normalize_path(
1615
+ os.path.join(self.basedir, path)
1616
+ )
1617
+ if not os.path.exists(path) or path in seen:
1618
+ self.paths.pop() # skip it
1619
+ self.dirty = True # we cleaned up, so we're dirty now :)
1620
+ continue
1621
+ seen[path] = 1
1622
+ f.close()
1623
+
1624
+ if self.paths and not saw_import:
1625
+ self.dirty = True # ensure anything we touch has import wrappers
1626
+ while self.paths and not self.paths[-1].strip():
1627
+ self.paths.pop()
1628
+
1629
+ def save(self):
1630
+ """Write changed .pth file back to disk"""
1631
+ if not self.dirty:
1632
+ return
1633
+
1634
+ rel_paths = list(map(self.make_relative, self.paths))
1635
+ if rel_paths:
1636
+ log.debug("Saving %s", self.filename)
1637
+ lines = self._wrap_lines(rel_paths)
1638
+ data = '\n'.join(lines) + '\n'
1639
+
1640
+ if os.path.islink(self.filename):
1641
+ os.unlink(self.filename)
1642
+ with open(self.filename, 'wt') as f:
1643
+ f.write(data)
1644
+
1645
+ elif os.path.exists(self.filename):
1646
+ log.debug("Deleting empty %s", self.filename)
1647
+ os.unlink(self.filename)
1648
+
1649
+ self.dirty = False
1650
+
1651
+ @staticmethod
1652
+ def _wrap_lines(lines):
1653
+ return lines
1654
+
1655
+ def add(self, dist):
1656
+ """Add `dist` to the distribution map"""
1657
+ new_path = (
1658
+ dist.location not in self.paths and (
1659
+ dist.location not in self.sitedirs or
1660
+ # account for '.' being in PYTHONPATH
1661
+ dist.location == os.getcwd()
1662
+ )
1663
+ )
1664
+ if new_path:
1665
+ self.paths.append(dist.location)
1666
+ self.dirty = True
1667
+ Environment.add(self, dist)
1668
+
1669
+ def remove(self, dist):
1670
+ """Remove `dist` from the distribution map"""
1671
+ while dist.location in self.paths:
1672
+ self.paths.remove(dist.location)
1673
+ self.dirty = True
1674
+ Environment.remove(self, dist)
1675
+
1676
+ def make_relative(self, path):
1677
+ npath, last = os.path.split(normalize_path(path))
1678
+ baselen = len(self.basedir)
1679
+ parts = [last]
1680
+ sep = os.altsep == '/' and '/' or os.sep
1681
+ while len(npath) >= baselen:
1682
+ if npath == self.basedir:
1683
+ parts.append(os.curdir)
1684
+ parts.reverse()
1685
+ return sep.join(parts)
1686
+ npath, last = os.path.split(npath)
1687
+ parts.append(last)
1688
+ else:
1689
+ return path
1690
+
1691
+
1692
+ class RewritePthDistributions(PthDistributions):
1693
+ @classmethod
1694
+ def _wrap_lines(cls, lines):
1695
+ yield cls.prelude
1696
+ for line in lines:
1697
+ yield line
1698
+ yield cls.postlude
1699
+
1700
+ prelude = _one_liner("""
1701
+ import sys
1702
+ sys.__plen = len(sys.path)
1703
+ """)
1704
+ postlude = _one_liner("""
1705
+ import sys
1706
+ new = sys.path[sys.__plen:]
1707
+ del sys.path[sys.__plen:]
1708
+ p = getattr(sys, '__egginsert', 0)
1709
+ sys.path[p:p] = new
1710
+ sys.__egginsert = p + len(new)
1711
+ """)
1712
+
1713
+
1714
+ if os.environ.get('SETUPTOOLS_SYS_PATH_TECHNIQUE', 'raw') == 'rewrite':
1715
+ PthDistributions = RewritePthDistributions
1716
+
1717
+
1718
+ def _first_line_re():
1719
+ """
1720
+ Return a regular expression based on first_line_re suitable for matching
1721
+ strings.
1722
+ """
1723
+ if isinstance(first_line_re.pattern, str):
1724
+ return first_line_re
1725
+
1726
+ # first_line_re in Python >=3.1.4 and >=3.2.1 is a bytes pattern.
1727
+ return re.compile(first_line_re.pattern.decode())
1728
+
1729
+
1730
+ def auto_chmod(func, arg, exc):
1731
+ if func in [os.unlink, os.remove] and os.name == 'nt':
1732
+ chmod(arg, stat.S_IWRITE)
1733
+ return func(arg)
1734
+ et, ev, _ = sys.exc_info()
1735
+ six.reraise(et, (ev[0], ev[1] + (" %s %s" % (func, arg))))
1736
+
1737
+
1738
+ def update_dist_caches(dist_path, fix_zipimporter_caches):
1739
+ """
1740
+ Fix any globally cached `dist_path` related data
1741
+
1742
+ `dist_path` should be a path of a newly installed egg distribution (zipped
1743
+ or unzipped).
1744
+
1745
+ sys.path_importer_cache contains finder objects that have been cached when
1746
+ importing data from the original distribution. Any such finders need to be
1747
+ cleared since the replacement distribution might be packaged differently,
1748
+ e.g. a zipped egg distribution might get replaced with an unzipped egg
1749
+ folder or vice versa. Having the old finders cached may then cause Python
1750
+ to attempt loading modules from the replacement distribution using an
1751
+ incorrect loader.
1752
+
1753
+ zipimport.zipimporter objects are Python loaders charged with importing
1754
+ data packaged inside zip archives. If stale loaders referencing the
1755
+ original distribution, are left behind, they can fail to load modules from
1756
+ the replacement distribution. E.g. if an old zipimport.zipimporter instance
1757
+ is used to load data from a new zipped egg archive, it may cause the
1758
+ operation to attempt to locate the requested data in the wrong location -
1759
+ one indicated by the original distribution's zip archive directory
1760
+ information. Such an operation may then fail outright, e.g. report having
1761
+ read a 'bad local file header', or even worse, it may fail silently &
1762
+ return invalid data.
1763
+
1764
+ zipimport._zip_directory_cache contains cached zip archive directory
1765
+ information for all existing zipimport.zipimporter instances and all such
1766
+ instances connected to the same archive share the same cached directory
1767
+ information.
1768
+
1769
+ If asked, and the underlying Python implementation allows it, we can fix
1770
+ all existing zipimport.zipimporter instances instead of having to track
1771
+ them down and remove them one by one, by updating their shared cached zip
1772
+ archive directory information. This, of course, assumes that the
1773
+ replacement distribution is packaged as a zipped egg.
1774
+
1775
+ If not asked to fix existing zipimport.zipimporter instances, we still do
1776
+ our best to clear any remaining zipimport.zipimporter related cached data
1777
+ that might somehow later get used when attempting to load data from the new
1778
+ distribution and thus cause such load operations to fail. Note that when
1779
+ tracking down such remaining stale data, we can not catch every conceivable
1780
+ usage from here, and we clear only those that we know of and have found to
1781
+ cause problems if left alive. Any remaining caches should be updated by
1782
+ whomever is in charge of maintaining them, i.e. they should be ready to
1783
+ handle us replacing their zip archives with new distributions at runtime.
1784
+
1785
+ """
1786
+ # There are several other known sources of stale zipimport.zipimporter
1787
+ # instances that we do not clear here, but might if ever given a reason to
1788
+ # do so:
1789
+ # * Global setuptools pkg_resources.working_set (a.k.a. 'master working
1790
+ # set') may contain distributions which may in turn contain their
1791
+ # zipimport.zipimporter loaders.
1792
+ # * Several zipimport.zipimporter loaders held by local variables further
1793
+ # up the function call stack when running the setuptools installation.
1794
+ # * Already loaded modules may have their __loader__ attribute set to the
1795
+ # exact loader instance used when importing them. Python 3.4 docs state
1796
+ # that this information is intended mostly for introspection and so is
1797
+ # not expected to cause us problems.
1798
+ normalized_path = normalize_path(dist_path)
1799
+ _uncache(normalized_path, sys.path_importer_cache)
1800
+ if fix_zipimporter_caches:
1801
+ _replace_zip_directory_cache_data(normalized_path)
1802
+ else:
1803
+ # Here, even though we do not want to fix existing and now stale
1804
+ # zipimporter cache information, we still want to remove it. Related to
1805
+ # Python's zip archive directory information cache, we clear each of
1806
+ # its stale entries in two phases:
1807
+ # 1. Clear the entry so attempting to access zip archive information
1808
+ # via any existing stale zipimport.zipimporter instances fails.
1809
+ # 2. Remove the entry from the cache so any newly constructed
1810
+ # zipimport.zipimporter instances do not end up using old stale
1811
+ # zip archive directory information.
1812
+ # This whole stale data removal step does not seem strictly necessary,
1813
+ # but has been left in because it was done before we started replacing
1814
+ # the zip archive directory information cache content if possible, and
1815
+ # there are no relevant unit tests that we can depend on to tell us if
1816
+ # this is really needed.
1817
+ _remove_and_clear_zip_directory_cache_data(normalized_path)
1818
+
1819
+
1820
+ def _collect_zipimporter_cache_entries(normalized_path, cache):
1821
+ """
1822
+ Return zipimporter cache entry keys related to a given normalized path.
1823
+
1824
+ Alternative path spellings (e.g. those using different character case or
1825
+ those using alternative path separators) related to the same path are
1826
+ included. Any sub-path entries are included as well, i.e. those
1827
+ corresponding to zip archives embedded in other zip archives.
1828
+
1829
+ """
1830
+ result = []
1831
+ prefix_len = len(normalized_path)
1832
+ for p in cache:
1833
+ np = normalize_path(p)
1834
+ if (np.startswith(normalized_path) and
1835
+ np[prefix_len:prefix_len + 1] in (os.sep, '')):
1836
+ result.append(p)
1837
+ return result
1838
+
1839
+
1840
+ def _update_zipimporter_cache(normalized_path, cache, updater=None):
1841
+ """
1842
+ Update zipimporter cache data for a given normalized path.
1843
+
1844
+ Any sub-path entries are processed as well, i.e. those corresponding to zip
1845
+ archives embedded in other zip archives.
1846
+
1847
+ Given updater is a callable taking a cache entry key and the original entry
1848
+ (after already removing the entry from the cache), and expected to update
1849
+ the entry and possibly return a new one to be inserted in its place.
1850
+ Returning None indicates that the entry should not be replaced with a new
1851
+ one. If no updater is given, the cache entries are simply removed without
1852
+ any additional processing, the same as if the updater simply returned None.
1853
+
1854
+ """
1855
+ for p in _collect_zipimporter_cache_entries(normalized_path, cache):
1856
+ # N.B. pypy's custom zipimport._zip_directory_cache implementation does
1857
+ # not support the complete dict interface:
1858
+ # * Does not support item assignment, thus not allowing this function
1859
+ # to be used only for removing existing cache entries.
1860
+ # * Does not support the dict.pop() method, forcing us to use the
1861
+ # get/del patterns instead. For more detailed information see the
1862
+ # following links:
1863
+ # https://github.com/pypa/setuptools/issues/202#issuecomment-202913420
1864
+ # http://bit.ly/2h9itJX
1865
+ old_entry = cache[p]
1866
+ del cache[p]
1867
+ new_entry = updater and updater(p, old_entry)
1868
+ if new_entry is not None:
1869
+ cache[p] = new_entry
1870
+
1871
+
1872
+ def _uncache(normalized_path, cache):
1873
+ _update_zipimporter_cache(normalized_path, cache)
1874
+
1875
+
1876
+ def _remove_and_clear_zip_directory_cache_data(normalized_path):
1877
+ def clear_and_remove_cached_zip_archive_directory_data(path, old_entry):
1878
+ old_entry.clear()
1879
+
1880
+ _update_zipimporter_cache(
1881
+ normalized_path, zipimport._zip_directory_cache,
1882
+ updater=clear_and_remove_cached_zip_archive_directory_data)
1883
+
1884
+
1885
+ # PyPy Python implementation does not allow directly writing to the
1886
+ # zipimport._zip_directory_cache and so prevents us from attempting to correct
1887
+ # its content. The best we can do there is clear the problematic cache content
1888
+ # and have PyPy repopulate it as needed. The downside is that if there are any
1889
+ # stale zipimport.zipimporter instances laying around, attempting to use them
1890
+ # will fail due to not having its zip archive directory information available
1891
+ # instead of being automatically corrected to use the new correct zip archive
1892
+ # directory information.
1893
+ if '__pypy__' in sys.builtin_module_names:
1894
+ _replace_zip_directory_cache_data = \
1895
+ _remove_and_clear_zip_directory_cache_data
1896
+ else:
1897
+
1898
+ def _replace_zip_directory_cache_data(normalized_path):
1899
+ def replace_cached_zip_archive_directory_data(path, old_entry):
1900
+ # N.B. In theory, we could load the zip directory information just
1901
+ # once for all updated path spellings, and then copy it locally and
1902
+ # update its contained path strings to contain the correct
1903
+ # spelling, but that seems like a way too invasive move (this cache
1904
+ # structure is not officially documented anywhere and could in
1905
+ # theory change with new Python releases) for no significant
1906
+ # benefit.
1907
+ old_entry.clear()
1908
+ zipimport.zipimporter(path)
1909
+ old_entry.update(zipimport._zip_directory_cache[path])
1910
+ return old_entry
1911
+
1912
+ _update_zipimporter_cache(
1913
+ normalized_path, zipimport._zip_directory_cache,
1914
+ updater=replace_cached_zip_archive_directory_data)
1915
+
1916
+
1917
+ def is_python(text, filename='<string>'):
1918
+ "Is this string a valid Python script?"
1919
+ try:
1920
+ compile(text, filename, 'exec')
1921
+ except (SyntaxError, TypeError):
1922
+ return False
1923
+ else:
1924
+ return True
1925
+
1926
+
1927
+ def is_sh(executable):
1928
+ """Determine if the specified executable is a .sh (contains a #! line)"""
1929
+ try:
1930
+ with io.open(executable, encoding='latin-1') as fp:
1931
+ magic = fp.read(2)
1932
+ except (OSError, IOError):
1933
+ return executable
1934
+ return magic == '#!'
1935
+
1936
+
1937
+ def nt_quote_arg(arg):
1938
+ """Quote a command line argument according to Windows parsing rules"""
1939
+ return subprocess.list2cmdline([arg])
1940
+
1941
+
1942
+ def is_python_script(script_text, filename):
1943
+ """Is this text, as a whole, a Python script? (as opposed to shell/bat/etc.
1944
+ """
1945
+ if filename.endswith('.py') or filename.endswith('.pyw'):
1946
+ return True # extension says it's Python
1947
+ if is_python(script_text, filename):
1948
+ return True # it's syntactically valid Python
1949
+ if script_text.startswith('#!'):
1950
+ # It begins with a '#!' line, so check if 'python' is in it somewhere
1951
+ return 'python' in script_text.splitlines()[0].lower()
1952
+
1953
+ return False # Not any Python I can recognize
1954
+
1955
+
1956
+ try:
1957
+ from os import chmod as _chmod
1958
+ except ImportError:
1959
+ # Jython compatibility
1960
+ def _chmod(*args):
1961
+ pass
1962
+
1963
+
1964
+ def chmod(path, mode):
1965
+ log.debug("changing mode of %s to %o", path, mode)
1966
+ try:
1967
+ _chmod(path, mode)
1968
+ except os.error as e:
1969
+ log.debug("chmod failed: %s", e)
1970
+
1971
+
1972
+ class CommandSpec(list):
1973
+ """
1974
+ A command spec for a #! header, specified as a list of arguments akin to
1975
+ those passed to Popen.
1976
+ """
1977
+
1978
+ options = []
1979
+ split_args = dict()
1980
+
1981
+ @classmethod
1982
+ def best(cls):
1983
+ """
1984
+ Choose the best CommandSpec class based on environmental conditions.
1985
+ """
1986
+ return cls
1987
+
1988
+ @classmethod
1989
+ def _sys_executable(cls):
1990
+ _default = os.path.normpath(sys.executable)
1991
+ return os.environ.get('__PYVENV_LAUNCHER__', _default)
1992
+
1993
+ @classmethod
1994
+ def from_param(cls, param):
1995
+ """
1996
+ Construct a CommandSpec from a parameter to build_scripts, which may
1997
+ be None.
1998
+ """
1999
+ if isinstance(param, cls):
2000
+ return param
2001
+ if isinstance(param, list):
2002
+ return cls(param)
2003
+ if param is None:
2004
+ return cls.from_environment()
2005
+ # otherwise, assume it's a string.
2006
+ return cls.from_string(param)
2007
+
2008
+ @classmethod
2009
+ def from_environment(cls):
2010
+ return cls([cls._sys_executable()])
2011
+
2012
+ @classmethod
2013
+ def from_string(cls, string):
2014
+ """
2015
+ Construct a command spec from a simple string representing a command
2016
+ line parseable by shlex.split.
2017
+ """
2018
+ items = shlex.split(string, **cls.split_args)
2019
+ return cls(items)
2020
+
2021
+ def install_options(self, script_text):
2022
+ self.options = shlex.split(self._extract_options(script_text))
2023
+ cmdline = subprocess.list2cmdline(self)
2024
+ if not isascii(cmdline):
2025
+ self.options[:0] = ['-x']
2026
+
2027
+ @staticmethod
2028
+ def _extract_options(orig_script):
2029
+ """
2030
+ Extract any options from the first line of the script.
2031
+ """
2032
+ first = (orig_script + '\n').splitlines()[0]
2033
+ match = _first_line_re().match(first)
2034
+ options = match.group(1) or '' if match else ''
2035
+ return options.strip()
2036
+
2037
+ def as_header(self):
2038
+ return self._render(self + list(self.options))
2039
+
2040
+ @staticmethod
2041
+ def _strip_quotes(item):
2042
+ _QUOTES = '"\''
2043
+ for q in _QUOTES:
2044
+ if item.startswith(q) and item.endswith(q):
2045
+ return item[1:-1]
2046
+ return item
2047
+
2048
+ @staticmethod
2049
+ def _render(items):
2050
+ cmdline = subprocess.list2cmdline(
2051
+ CommandSpec._strip_quotes(item.strip()) for item in items)
2052
+ return '#!' + cmdline + '\n'
2053
+
2054
+
2055
+ # For pbr compat; will be removed in a future version.
2056
+ sys_executable = CommandSpec._sys_executable()
2057
+
2058
+
2059
+ class WindowsCommandSpec(CommandSpec):
2060
+ split_args = dict(posix=False)
2061
+
2062
+
2063
+ class ScriptWriter:
2064
+ """
2065
+ Encapsulates behavior around writing entry point scripts for console and
2066
+ gui apps.
2067
+ """
2068
+
2069
+ template = textwrap.dedent(r"""
2070
+ # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r
2071
+ __requires__ = %(spec)r
2072
+ import re
2073
+ import sys
2074
+ from pkg_resources import load_entry_point
2075
+
2076
+ if __name__ == '__main__':
2077
+ sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
2078
+ sys.exit(
2079
+ load_entry_point(%(spec)r, %(group)r, %(name)r)()
2080
+ )
2081
+ """).lstrip()
2082
+
2083
+ command_spec_class = CommandSpec
2084
+
2085
+ @classmethod
2086
+ def get_script_args(cls, dist, executable=None, wininst=False):
2087
+ # for backward compatibility
2088
+ warnings.warn("Use get_args", EasyInstallDeprecationWarning)
2089
+ writer = (WindowsScriptWriter if wininst else ScriptWriter).best()
2090
+ header = cls.get_script_header("", executable, wininst)
2091
+ return writer.get_args(dist, header)
2092
+
2093
+ @classmethod
2094
+ def get_script_header(cls, script_text, executable=None, wininst=False):
2095
+ # for backward compatibility
2096
+ warnings.warn("Use get_header", EasyInstallDeprecationWarning, stacklevel=2)
2097
+ if wininst:
2098
+ executable = "python.exe"
2099
+ return cls.get_header(script_text, executable)
2100
+
2101
+ @classmethod
2102
+ def get_args(cls, dist, header=None):
2103
+ """
2104
+ Yield write_script() argument tuples for a distribution's
2105
+ console_scripts and gui_scripts entry points.
2106
+ """
2107
+ if header is None:
2108
+ header = cls.get_header()
2109
+ spec = str(dist.as_requirement())
2110
+ for type_ in 'console', 'gui':
2111
+ group = type_ + '_scripts'
2112
+ for name, ep in dist.get_entry_map(group).items():
2113
+ cls._ensure_safe_name(name)
2114
+ script_text = cls.template % locals()
2115
+ args = cls._get_script_args(type_, name, header, script_text)
2116
+ for res in args:
2117
+ yield res
2118
+
2119
+ @staticmethod
2120
+ def _ensure_safe_name(name):
2121
+ """
2122
+ Prevent paths in *_scripts entry point names.
2123
+ """
2124
+ has_path_sep = re.search(r'[\\/]', name)
2125
+ if has_path_sep:
2126
+ raise ValueError("Path separators not allowed in script names")
2127
+
2128
+ @classmethod
2129
+ def get_writer(cls, force_windows):
2130
+ # for backward compatibility
2131
+ warnings.warn("Use best", EasyInstallDeprecationWarning)
2132
+ return WindowsScriptWriter.best() if force_windows else cls.best()
2133
+
2134
+ @classmethod
2135
+ def best(cls):
2136
+ """
2137
+ Select the best ScriptWriter for this environment.
2138
+ """
2139
+ if sys.platform == 'win32' or (os.name == 'java' and os._name == 'nt'):
2140
+ return WindowsScriptWriter.best()
2141
+ else:
2142
+ return cls
2143
+
2144
+ @classmethod
2145
+ def _get_script_args(cls, type_, name, header, script_text):
2146
+ # Simply write the stub with no extension.
2147
+ yield (name, header + script_text)
2148
+
2149
+ @classmethod
2150
+ def get_header(cls, script_text="", executable=None):
2151
+ """Create a #! line, getting options (if any) from script_text"""
2152
+ cmd = cls.command_spec_class.best().from_param(executable)
2153
+ cmd.install_options(script_text)
2154
+ return cmd.as_header()
2155
+
2156
+
2157
+ class WindowsScriptWriter(ScriptWriter):
2158
+ command_spec_class = WindowsCommandSpec
2159
+
2160
+ @classmethod
2161
+ def get_writer(cls):
2162
+ # for backward compatibility
2163
+ warnings.warn("Use best", EasyInstallDeprecationWarning)
2164
+ return cls.best()
2165
+
2166
+ @classmethod
2167
+ def best(cls):
2168
+ """
2169
+ Select the best ScriptWriter suitable for Windows
2170
+ """
2171
+ writer_lookup = dict(
2172
+ executable=WindowsExecutableLauncherWriter,
2173
+ natural=cls,
2174
+ )
2175
+ # for compatibility, use the executable launcher by default
2176
+ launcher = os.environ.get('SETUPTOOLS_LAUNCHER', 'executable')
2177
+ return writer_lookup[launcher]
2178
+
2179
+ @classmethod
2180
+ def _get_script_args(cls, type_, name, header, script_text):
2181
+ "For Windows, add a .py extension"
2182
+ ext = dict(console='.pya', gui='.pyw')[type_]
2183
+ if ext not in os.environ['PATHEXT'].lower().split(';'):
2184
+ msg = (
2185
+ "{ext} not listed in PATHEXT; scripts will not be "
2186
+ "recognized as executables."
2187
+ ).format(**locals())
2188
+ warnings.warn(msg, UserWarning)
2189
+ old = ['.pya', '.py', '-script.py', '.pyc', '.pyo', '.pyw', '.exe']
2190
+ old.remove(ext)
2191
+ header = cls._adjust_header(type_, header)
2192
+ blockers = [name + x for x in old]
2193
+ yield name + ext, header + script_text, 't', blockers
2194
+
2195
+ @classmethod
2196
+ def _adjust_header(cls, type_, orig_header):
2197
+ """
2198
+ Make sure 'pythonw' is used for gui and and 'python' is used for
2199
+ console (regardless of what sys.executable is).
2200
+ """
2201
+ pattern = 'pythonw.exe'
2202
+ repl = 'python.exe'
2203
+ if type_ == 'gui':
2204
+ pattern, repl = repl, pattern
2205
+ pattern_ob = re.compile(re.escape(pattern), re.IGNORECASE)
2206
+ new_header = pattern_ob.sub(string=orig_header, repl=repl)
2207
+ return new_header if cls._use_header(new_header) else orig_header
2208
+
2209
+ @staticmethod
2210
+ def _use_header(new_header):
2211
+ """
2212
+ Should _adjust_header use the replaced header?
2213
+
2214
+ On non-windows systems, always use. On
2215
+ Windows systems, only use the replaced header if it resolves
2216
+ to an executable on the system.
2217
+ """
2218
+ clean_header = new_header[2:-1].strip('"')
2219
+ return sys.platform != 'win32' or find_executable(clean_header)
2220
+
2221
+
2222
+ class WindowsExecutableLauncherWriter(WindowsScriptWriter):
2223
+ @classmethod
2224
+ def _get_script_args(cls, type_, name, header, script_text):
2225
+ """
2226
+ For Windows, add a .py extension and an .exe launcher
2227
+ """
2228
+ if type_ == 'gui':
2229
+ launcher_type = 'gui'
2230
+ ext = '-script.pyw'
2231
+ old = ['.pyw']
2232
+ else:
2233
+ launcher_type = 'cli'
2234
+ ext = '-script.py'
2235
+ old = ['.py', '.pyc', '.pyo']
2236
+ hdr = cls._adjust_header(type_, header)
2237
+ blockers = [name + x for x in old]
2238
+ yield (name + ext, hdr + script_text, 't', blockers)
2239
+ yield (
2240
+ name + '.exe', get_win_launcher(launcher_type),
2241
+ 'b' # write in binary mode
2242
+ )
2243
+ if not is_64bit():
2244
+ # install a manifest for the launcher to prevent Windows
2245
+ # from detecting it as an installer (which it will for
2246
+ # launchers like easy_install.exe). Consider only
2247
+ # adding a manifest for launchers detected as installers.
2248
+ # See Distribute #143 for details.
2249
+ m_name = name + '.exe.manifest'
2250
+ yield (m_name, load_launcher_manifest(name), 't')
2251
+
2252
+
2253
+ # for backward-compatibility
2254
+ get_script_args = ScriptWriter.get_script_args
2255
+ get_script_header = ScriptWriter.get_script_header
2256
+
2257
+
2258
+ def get_win_launcher(type):
2259
+ """
2260
+ Load the Windows launcher (executable) suitable for launching a script.
2261
+
2262
+ `type` should be either 'cli' or 'gui'
2263
+
2264
+ Returns the executable as a byte string.
2265
+ """
2266
+ launcher_fn = '%s.exe' % type
2267
+ if is_64bit():
2268
+ launcher_fn = launcher_fn.replace(".", "-64.")
2269
+ else:
2270
+ launcher_fn = launcher_fn.replace(".", "-32.")
2271
+ return resource_string('setuptools', launcher_fn)
2272
+
2273
+
2274
+ def load_launcher_manifest(name):
2275
+ manifest = pkg_resources.resource_string(__name__, 'launcher manifest.xml')
2276
+ if six.PY2:
2277
+ return manifest % vars()
2278
+ else:
2279
+ return manifest.decode('utf-8') % vars()
2280
+
2281
+
2282
+ def rmtree(path, ignore_errors=False, onerror=auto_chmod):
2283
+ return shutil.rmtree(path, ignore_errors, onerror)
2284
+
2285
+
2286
+ def current_umask():
2287
+ tmp = os.umask(0o022)
2288
+ os.umask(tmp)
2289
+ return tmp
2290
+
2291
+
2292
+ def bootstrap():
2293
+ # This function is called when setuptools*.egg is run using /bin/sh
2294
+ import setuptools
2295
+
2296
+ argv0 = os.path.dirname(setuptools.__path__[0])
2297
+ sys.argv[0] = argv0
2298
+ sys.argv.append(argv0)
2299
+ main()
2300
+
2301
+
2302
+ def main(argv=None, **kw):
2303
+ from setuptools import setup
2304
+ from setuptools.dist import Distribution
2305
+
2306
+ class DistributionWithoutHelpCommands(Distribution):
2307
+ common_usage = ""
2308
+
2309
+ def _show_help(self, *args, **kw):
2310
+ with _patch_usage():
2311
+ Distribution._show_help(self, *args, **kw)
2312
+
2313
+ if argv is None:
2314
+ argv = sys.argv[1:]
2315
+
2316
+ with _patch_usage():
2317
+ setup(
2318
+ script_args=['-q', 'easy_install', '-v'] + argv,
2319
+ script_name=sys.argv[0] or 'easy_install',
2320
+ distclass=DistributionWithoutHelpCommands,
2321
+ **kw
2322
+ )
2323
+
2324
+
2325
+ @contextlib.contextmanager
2326
+ def _patch_usage():
2327
+ import distutils.core
2328
+ USAGE = textwrap.dedent("""
2329
+ usage: %(script)s [options] requirement_or_url ...
2330
+ or: %(script)s --help
2331
+ """).lstrip()
2332
+
2333
+ def gen_usage(script_name):
2334
+ return USAGE % dict(
2335
+ script=os.path.basename(script_name),
2336
+ )
2337
+
2338
+ saved = distutils.core.gen_usage
2339
+ distutils.core.gen_usage = gen_usage
2340
+ try:
2341
+ yield
2342
+ finally:
2343
+ distutils.core.gen_usage = saved
2344
+
2345
+ class EasyInstallDeprecationWarning(SetuptoolsDeprecationWarning):
2346
+ """Class for warning about deprecations in EasyInstall in SetupTools. Not ignored by default, unlike DeprecationWarning."""
2347
+