pex 2.54.2__py2.py3-none-any.whl → 2.69.0__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.

Potentially problematic release.


This version of pex might be problematic. Click here for more details.

Files changed (180) hide show
  1. pex/auth.py +1 -1
  2. pex/bin/pex.py +15 -2
  3. pex/build_backend/configuration.py +5 -5
  4. pex/build_backend/wrap.py +27 -23
  5. pex/build_system/pep_517.py +4 -1
  6. pex/cache/dirs.py +17 -12
  7. pex/cli/commands/lock.py +302 -165
  8. pex/cli/commands/pip/core.py +4 -12
  9. pex/cli/commands/pip/wheel.py +1 -1
  10. pex/cli/commands/run.py +13 -20
  11. pex/cli/commands/venv.py +85 -16
  12. pex/cli/pex.py +11 -4
  13. pex/common.py +57 -7
  14. pex/compatibility.py +1 -1
  15. pex/dependency_configuration.py +87 -15
  16. pex/dist_metadata.py +143 -25
  17. pex/docs/html/_pagefind/fragment/en_4250138.pf_fragment +0 -0
  18. pex/docs/html/_pagefind/fragment/en_7125dad.pf_fragment +0 -0
  19. pex/docs/html/_pagefind/fragment/en_785d562.pf_fragment +0 -0
  20. pex/docs/html/_pagefind/fragment/en_8e94bb8.pf_fragment +0 -0
  21. pex/docs/html/_pagefind/fragment/en_a0396bb.pf_fragment +0 -0
  22. pex/docs/html/_pagefind/fragment/en_a8a3588.pf_fragment +0 -0
  23. pex/docs/html/_pagefind/fragment/en_c07d988.pf_fragment +0 -0
  24. pex/docs/html/_pagefind/fragment/en_d718411.pf_fragment +0 -0
  25. pex/docs/html/_pagefind/index/en_a2e3c5e.pf_index +0 -0
  26. pex/docs/html/_pagefind/pagefind-entry.json +1 -1
  27. pex/docs/html/_pagefind/pagefind.en_4ce1afa9e3.pf_meta +0 -0
  28. pex/docs/html/_static/documentation_options.js +1 -1
  29. pex/docs/html/_static/pygments.css +164 -146
  30. pex/docs/html/_static/styles/furo.css +1 -1
  31. pex/docs/html/_static/styles/furo.css.map +1 -1
  32. pex/docs/html/api/vars.html +25 -34
  33. pex/docs/html/buildingpex.html +25 -34
  34. pex/docs/html/genindex.html +24 -33
  35. pex/docs/html/index.html +25 -34
  36. pex/docs/html/recipes.html +25 -34
  37. pex/docs/html/scie.html +25 -34
  38. pex/docs/html/search.html +24 -33
  39. pex/docs/html/whatispex.html +25 -34
  40. pex/entry_points_txt.py +98 -0
  41. pex/environment.py +54 -33
  42. pex/finders.py +1 -1
  43. pex/hashing.py +71 -9
  44. pex/installed_wheel.py +141 -0
  45. pex/interpreter.py +41 -38
  46. pex/interpreter_constraints.py +25 -25
  47. pex/interpreter_implementation.py +40 -0
  48. pex/jobs.py +13 -6
  49. pex/pep_376.py +68 -384
  50. pex/pep_425.py +11 -2
  51. pex/pep_427.py +937 -205
  52. pex/pep_508.py +4 -5
  53. pex/pex_builder.py +5 -8
  54. pex/pex_info.py +14 -9
  55. pex/pip/dependencies/__init__.py +85 -13
  56. pex/pip/dependencies/requires.py +38 -3
  57. pex/pip/foreign_platform/__init__.py +4 -3
  58. pex/pip/installation.py +2 -2
  59. pex/pip/local_project.py +6 -14
  60. pex/pip/package_repositories/__init__.py +78 -0
  61. pex/pip/package_repositories/link_collector.py +96 -0
  62. pex/pip/tool.py +139 -33
  63. pex/pip/vcs.py +109 -43
  64. pex/pip/version.py +8 -1
  65. pex/requirements.py +121 -16
  66. pex/resolve/config.py +5 -1
  67. pex/resolve/configured_resolve.py +32 -10
  68. pex/resolve/configured_resolver.py +10 -39
  69. pex/resolve/downloads.py +4 -3
  70. pex/resolve/lock_downloader.py +16 -23
  71. pex/resolve/lock_resolver.py +41 -51
  72. pex/resolve/locked_resolve.py +89 -32
  73. pex/resolve/locker.py +145 -101
  74. pex/resolve/locker_patches.py +123 -197
  75. pex/resolve/lockfile/create.py +232 -87
  76. pex/resolve/lockfile/download_manager.py +5 -1
  77. pex/resolve/lockfile/json_codec.py +103 -28
  78. pex/resolve/lockfile/model.py +13 -35
  79. pex/resolve/lockfile/pep_751.py +117 -98
  80. pex/resolve/lockfile/requires_dist.py +17 -262
  81. pex/resolve/lockfile/subset.py +11 -0
  82. pex/resolve/lockfile/targets.py +445 -0
  83. pex/resolve/lockfile/updater.py +22 -10
  84. pex/resolve/package_repository.py +406 -0
  85. pex/resolve/pex_repository_resolver.py +1 -1
  86. pex/resolve/pre_resolved_resolver.py +19 -16
  87. pex/resolve/project.py +233 -47
  88. pex/resolve/requirement_configuration.py +28 -10
  89. pex/resolve/resolver_configuration.py +18 -32
  90. pex/resolve/resolver_options.py +234 -28
  91. pex/resolve/resolvers.py +3 -12
  92. pex/resolve/target_options.py +18 -2
  93. pex/resolve/target_system.py +908 -0
  94. pex/resolve/venv_resolver.py +670 -0
  95. pex/resolver.py +673 -209
  96. pex/scie/__init__.py +40 -1
  97. pex/scie/model.py +2 -0
  98. pex/scie/science.py +25 -3
  99. pex/sdist.py +219 -0
  100. pex/sh_boot.py +24 -21
  101. pex/sysconfig.py +5 -3
  102. pex/targets.py +31 -10
  103. pex/third_party/__init__.py +1 -1
  104. pex/tools/commands/repository.py +48 -25
  105. pex/vendor/__init__.py +4 -9
  106. pex/vendor/__main__.py +65 -41
  107. pex/vendor/_vendored/ansicolors/.layout.json +1 -1
  108. pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.dist-info/RECORD +11 -0
  109. pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.pex-info/original-whl-info.json +1 -0
  110. pex/vendor/_vendored/appdirs/.layout.json +1 -1
  111. pex/vendor/_vendored/appdirs/appdirs-1.4.4.dist-info/RECORD +7 -0
  112. pex/vendor/_vendored/appdirs/appdirs-1.4.4.pex-info/original-whl-info.json +1 -0
  113. pex/vendor/_vendored/attrs/.layout.json +1 -1
  114. pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/RECORD +37 -0
  115. pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.pex-info/original-whl-info.json +1 -0
  116. pex/vendor/_vendored/packaging_20_9/.layout.json +1 -1
  117. pex/vendor/_vendored/packaging_20_9/packaging-20.9.dist-info/RECORD +20 -0
  118. pex/vendor/_vendored/packaging_20_9/packaging-20.9.pex-info/original-whl-info.json +1 -0
  119. pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.dist-info/RECORD +7 -0
  120. pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.pex-info/original-whl-info.json +1 -0
  121. pex/vendor/_vendored/packaging_21_3/.layout.json +1 -1
  122. pex/vendor/_vendored/packaging_21_3/packaging-21.3.dist-info/RECORD +20 -0
  123. pex/vendor/_vendored/packaging_21_3/packaging-21.3.pex-info/original-whl-info.json +1 -0
  124. pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.dist-info/RECORD +18 -0
  125. pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.pex-info/original-whl-info.json +1 -0
  126. pex/vendor/_vendored/packaging_24_0/.layout.json +1 -1
  127. pex/vendor/_vendored/packaging_24_0/packaging-24.0.dist-info/RECORD +22 -0
  128. pex/vendor/_vendored/packaging_24_0/packaging-24.0.pex-info/original-whl-info.json +1 -0
  129. pex/vendor/_vendored/packaging_25_0/.layout.json +1 -1
  130. pex/vendor/_vendored/packaging_25_0/packaging-25.0.dist-info/RECORD +24 -0
  131. pex/vendor/_vendored/packaging_25_0/packaging-25.0.pex-info/original-whl-info.json +1 -0
  132. pex/vendor/_vendored/pip/.layout.json +1 -1
  133. pex/vendor/_vendored/pip/pip/_vendor/certifi/cacert.pem +63 -1
  134. pex/vendor/_vendored/pip/pip-20.3.4.dist-info/RECORD +388 -0
  135. pex/vendor/_vendored/pip/pip-20.3.4.pex-info/original-whl-info.json +1 -0
  136. pex/vendor/_vendored/setuptools/.layout.json +1 -1
  137. pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/RECORD +107 -0
  138. pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.pex-info/original-whl-info.json +1 -0
  139. pex/vendor/_vendored/toml/.layout.json +1 -1
  140. pex/vendor/_vendored/toml/toml-0.10.2.dist-info/RECORD +11 -0
  141. pex/vendor/_vendored/toml/toml-0.10.2.pex-info/original-whl-info.json +1 -0
  142. pex/vendor/_vendored/tomli/.layout.json +1 -1
  143. pex/vendor/_vendored/tomli/tomli-2.0.1.dist-info/RECORD +10 -0
  144. pex/vendor/_vendored/tomli/tomli-2.0.1.pex-info/original-whl-info.json +1 -0
  145. pex/venv/installer.py +46 -19
  146. pex/venv/venv_pex.py +6 -3
  147. pex/version.py +1 -1
  148. pex/wheel.py +188 -40
  149. pex/whl.py +67 -0
  150. pex/windows/__init__.py +14 -11
  151. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/METADATA +6 -5
  152. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/RECORD +157 -133
  153. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/entry_points.txt +1 -0
  154. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/pylock/pylock.toml +1 -1
  155. pex/docs/html/_pagefind/fragment/en_42c9d8c.pf_fragment +0 -0
  156. pex/docs/html/_pagefind/fragment/en_45dd5a2.pf_fragment +0 -0
  157. pex/docs/html/_pagefind/fragment/en_4ca74d2.pf_fragment +0 -0
  158. pex/docs/html/_pagefind/fragment/en_77273d5.pf_fragment +0 -0
  159. pex/docs/html/_pagefind/fragment/en_87a59c5.pf_fragment +0 -0
  160. pex/docs/html/_pagefind/fragment/en_8dc89b5.pf_fragment +0 -0
  161. pex/docs/html/_pagefind/fragment/en_9d1319b.pf_fragment +0 -0
  162. pex/docs/html/_pagefind/fragment/en_e55df9d.pf_fragment +0 -0
  163. pex/docs/html/_pagefind/index/en_1e98c6f.pf_index +0 -0
  164. pex/docs/html/_pagefind/pagefind.en_d1c488ecae.pf_meta +0 -0
  165. pex/vendor/_vendored/ansicolors/ansicolors-1.1.8.dist-info/INSTALLER +0 -1
  166. pex/vendor/_vendored/appdirs/appdirs-1.4.4.dist-info/INSTALLER +0 -1
  167. pex/vendor/_vendored/attrs/attrs-21.5.0.dev0.dist-info/INSTALLER +0 -1
  168. pex/vendor/_vendored/packaging_20_9/packaging-20.9.dist-info/INSTALLER +0 -1
  169. pex/vendor/_vendored/packaging_20_9/pyparsing-2.4.7.dist-info/INSTALLER +0 -1
  170. pex/vendor/_vendored/packaging_21_3/packaging-21.3.dist-info/INSTALLER +0 -1
  171. pex/vendor/_vendored/packaging_21_3/pyparsing-3.0.7.dist-info/INSTALLER +0 -1
  172. pex/vendor/_vendored/packaging_24_0/packaging-24.0.dist-info/INSTALLER +0 -1
  173. pex/vendor/_vendored/packaging_25_0/packaging-25.0.dist-info/INSTALLER +0 -1
  174. pex/vendor/_vendored/pip/pip-20.3.4.dist-info/INSTALLER +0 -1
  175. pex/vendor/_vendored/setuptools/setuptools-44.0.0+3acb925dd708430aeaf197ea53ac8a752f7c1863.dist-info/INSTALLER +0 -1
  176. pex/vendor/_vendored/toml/toml-0.10.2.dist-info/INSTALLER +0 -1
  177. pex/vendor/_vendored/tomli/tomli-2.0.1.dist-info/INSTALLER +0 -1
  178. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/WHEEL +0 -0
  179. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/licenses/LICENSE +0 -0
  180. {pex-2.54.2.dist-info → pex-2.69.0.dist-info}/top_level.txt +0 -0
pex/docs/html/scie.html CHANGED
@@ -1,16 +1,16 @@
1
1
  <!doctype html>
2
2
  <html class="no-js" lang="en" data-content_root="./">
3
- <head><meta charset="utf-8"/>
4
- <meta name="viewport" content="width=device-width,initial-scale=1"/>
3
+ <head><meta charset="utf-8">
4
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
5
  <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="PEX Recipes and Notes" href="recipes.html" /><link rel="prev" title="Building .pex files" href="buildingpex.html" />
7
- <link rel="prefetch" href="_static/pex-logo-light.png" as="image" />
8
- <link rel="prefetch" href="_static/pex-logo-dark.png" as="image" />
6
+ <link rel="index" title="Index" href="genindex.html"><link rel="search" title="Search" href="search.html"><link rel="next" title="PEX Recipes and Notes" href="recipes.html"><link rel="prev" title="Building .pex files" href="buildingpex.html">
7
+ <link rel="prefetch" href="_static/pex-logo-light.png" as="image">
8
+ <link rel="prefetch" href="_static/pex-logo-dark.png" as="image">
9
9
 
10
- <link rel="shortcut icon" href="_static/pex-icon.png"/><!-- Generated with Sphinx 8.2.3 and Furo 2025.07.19 -->
11
- <title>PEX with included Python interpreter - Pex Docs (v2.54.2)</title>
10
+ <link rel="shortcut icon" href="_static/pex-icon.png"><!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25 -->
11
+ <title>PEX with included Python interpreter - Pex Docs (v2.69.0)</title>
12
12
  <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
13
- <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=25af2a20" />
13
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
14
14
  <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
15
15
 
16
16
 
@@ -24,14 +24,14 @@
24
24
  }
25
25
  @media not print {
26
26
  body[data-theme="dark"] {
27
- --color-code-background: #2b2b2b;
28
- --color-code-foreground: #f8f8f2;
27
+ --color-code-background: #202020;
28
+ --color-code-foreground: #d0d0d0;
29
29
 
30
30
  }
31
31
  @media (prefers-color-scheme: dark) {
32
32
  body:not([data-theme="light"]) {
33
- --color-code-background: #2b2b2b;
34
- --color-code-foreground: #f8f8f2;
33
+ --color-code-background: #202020;
34
+ --color-code-foreground: #d0d0d0;
35
35
 
36
36
  }
37
37
  }
@@ -146,14 +146,10 @@
146
146
  </symbol>
147
147
  </svg>
148
148
 
149
- <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
150
- <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
151
- <label class="overlay sidebar-overlay" for="__navigation">
152
- <div class="visually-hidden">Hide navigation sidebar</div>
153
- </label>
154
- <label class="overlay toc-overlay" for="__toc">
155
- <div class="visually-hidden">Hide table of contents sidebar</div>
156
- </label>
149
+ <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle site navigation sidebar">
150
+ <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc" aria-label="Toggle table of contents sidebar">
151
+ <label class="overlay sidebar-overlay" for="__navigation"></label>
152
+ <label class="overlay toc-overlay" for="__toc"></label>
157
153
 
158
154
  <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
159
155
 
@@ -163,17 +159,15 @@
163
159
  <header class="mobile-header">
164
160
  <div class="header-left">
165
161
  <label class="nav-overlay-icon" for="__navigation">
166
- <div class="visually-hidden">Toggle site navigation sidebar</div>
167
- <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
162
+ <span class="icon"><svg><use href="#svg-menu"></use></svg></span>
168
163
  </label>
169
164
  </div>
170
165
  <div class="header-center">
171
- <a href="index.html"><div class="brand">Pex Docs (v2.54.2)</div></a>
166
+ <a href="index.html"><div class="brand">Pex Docs (v2.69.0)</div></a>
172
167
  </div>
173
168
  <div class="header-right">
174
169
  <div class="theme-toggle-container theme-toggle-header">
175
- <button class="theme-toggle">
176
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
170
+ <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
177
171
  <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
178
172
  <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
179
173
  <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
@@ -181,8 +175,7 @@
181
175
  </button>
182
176
  </div>
183
177
  <label class="toc-overlay-icon toc-header-icon" for="__toc">
184
- <div class="visually-hidden">Toggle table of contents sidebar</div>
185
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
178
+ <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
186
179
  </label>
187
180
  </div>
188
181
  </header>
@@ -241,8 +234,7 @@
241
234
  <span class="visually-hidden">Edit this page</span>
242
235
  </a>
243
236
  </div><div class="theme-toggle-container theme-toggle-content">
244
- <button class="theme-toggle">
245
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
237
+ <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
246
238
  <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
247
239
  <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
248
240
  <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
@@ -250,8 +242,7 @@
250
242
  </button>
251
243
  </div>
252
244
  <label class="toc-overlay-icon toc-content-icon" for="__toc">
253
- <div class="visually-hidden">Toggle table of contents sidebar</div>
254
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
245
+ <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
255
246
  </label>
256
247
  </div>
257
248
  <article role="main" id="furo-main-content">
@@ -632,12 +623,12 @@ uuid
632
623
  </div>
633
624
  <div class="right-details">
634
625
  <div class="icons">
635
- <a class="muted-link " href="https://pypi.org/project/pex/2.54.2/" aria-label="PyPI"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
626
+ <a class="muted-link " href="https://pypi.org/project/pex/2.69.0/" aria-label="PyPI"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
636
627
  <path d="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z">
637
628
  </path>
638
629
  </svg>
639
630
  </a>
640
- <a class="muted-link " href="https://github.com/pex-tool/pex/releases/download/v2.54.2/pex" aria-label="Download"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 640 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
631
+ <a class="muted-link " href="https://github.com/pex-tool/pex/releases/download/v2.69.0/pex" aria-label="Download"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 640 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
641
632
  <path d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z">
642
633
  </path>
643
634
  </svg>
@@ -681,7 +672,7 @@ uuid
681
672
 
682
673
  </aside>
683
674
  </div>
684
- </div><script src="_static/documentation_options.js?v=a32edb08"></script>
675
+ </div><script src="_static/documentation_options.js?v=525daa63"></script>
685
676
  <script src="_static/doctools.js?v=9bcbadda"></script>
686
677
  <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
687
678
  <script src="_static/scripts/furo.js?v=46bd48cc"></script>
pex/docs/html/search.html CHANGED
@@ -1,13 +1,13 @@
1
1
  <!doctype html>
2
2
  <html class="no-js" lang="en" data-content_root="./">
3
- <head><meta charset="utf-8"/>
4
- <meta name="viewport" content="width=device-width,initial-scale=1"/>
5
- <meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="#" />
6
- <link rel="prefetch" href="_static/pex-logo-light.png" as="image" />
7
- <link rel="prefetch" href="_static/pex-logo-dark.png" as="image" />
3
+ <head><meta charset="utf-8">
4
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
+ <meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="genindex.html"><link rel="search" title="Search" href="#">
6
+ <link rel="prefetch" href="_static/pex-logo-light.png" as="image">
7
+ <link rel="prefetch" href="_static/pex-logo-dark.png" as="image">
8
8
 
9
- <link rel="shortcut icon" href="_static/pex-icon.png"/><!-- Generated with Sphinx 8.2.3 and Furo 2025.07.19 --><title>Search - Pex Docs (v2.54.2)</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
10
- <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=25af2a20" />
9
+ <link rel="shortcut icon" href="_static/pex-icon.png"><!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25 --><title>Search - Pex Docs (v2.69.0)</title><link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
10
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
11
11
  <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
12
12
 
13
13
 
@@ -21,14 +21,14 @@
21
21
  }
22
22
  @media not print {
23
23
  body[data-theme="dark"] {
24
- --color-code-background: #2b2b2b;
25
- --color-code-foreground: #f8f8f2;
24
+ --color-code-background: #202020;
25
+ --color-code-foreground: #d0d0d0;
26
26
 
27
27
  }
28
28
  @media (prefers-color-scheme: dark) {
29
29
  body:not([data-theme="light"]) {
30
- --color-code-background: #2b2b2b;
31
- --color-code-foreground: #f8f8f2;
30
+ --color-code-background: #202020;
31
+ --color-code-foreground: #d0d0d0;
32
32
 
33
33
  }
34
34
  }
@@ -159,14 +159,10 @@
159
159
  </symbol>
160
160
  </svg>
161
161
 
162
- <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
163
- <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
164
- <label class="overlay sidebar-overlay" for="__navigation">
165
- <div class="visually-hidden">Hide navigation sidebar</div>
166
- </label>
167
- <label class="overlay toc-overlay" for="__toc">
168
- <div class="visually-hidden">Hide table of contents sidebar</div>
169
- </label>
162
+ <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle site navigation sidebar">
163
+ <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc" aria-label="Toggle table of contents sidebar">
164
+ <label class="overlay sidebar-overlay" for="__navigation"></label>
165
+ <label class="overlay toc-overlay" for="__toc"></label>
170
166
 
171
167
  <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
172
168
 
@@ -176,17 +172,15 @@
176
172
  <header class="mobile-header">
177
173
  <div class="header-left">
178
174
  <label class="nav-overlay-icon" for="__navigation">
179
- <div class="visually-hidden">Toggle site navigation sidebar</div>
180
- <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
175
+ <span class="icon"><svg><use href="#svg-menu"></use></svg></span>
181
176
  </label>
182
177
  </div>
183
178
  <div class="header-center">
184
- <a href="index.html"><div class="brand">Pex Docs (v2.54.2)</div></a>
179
+ <a href="index.html"><div class="brand">Pex Docs (v2.69.0)</div></a>
185
180
  </div>
186
181
  <div class="header-right">
187
182
  <div class="theme-toggle-container theme-toggle-header">
188
- <button class="theme-toggle">
189
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
183
+ <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
190
184
  <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
191
185
  <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
192
186
  <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
@@ -194,8 +188,7 @@
194
188
  </button>
195
189
  </div>
196
190
  <label class="toc-overlay-icon toc-header-icon no-toc" for="__toc">
197
- <div class="visually-hidden">Toggle table of contents sidebar</div>
198
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
191
+ <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
199
192
  </label>
200
193
  </div>
201
194
  </header>
@@ -244,8 +237,7 @@
244
237
  </a>
245
238
  <div class="content-icon-container">
246
239
  <div class="theme-toggle-container theme-toggle-content">
247
- <button class="theme-toggle">
248
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
240
+ <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
249
241
  <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
250
242
  <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
251
243
  <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
@@ -253,8 +245,7 @@
253
245
  </button>
254
246
  </div>
255
247
  <label class="toc-overlay-icon toc-content-icon no-toc" for="__toc">
256
- <div class="visually-hidden">Toggle table of contents sidebar</div>
257
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
248
+ <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
258
249
  </label>
259
250
  </div>
260
251
  <article role="main" id="furo-main-content">
@@ -282,12 +273,12 @@
282
273
  </div>
283
274
  <div class="right-details">
284
275
  <div class="icons">
285
- <a class="muted-link " href="https://pypi.org/project/pex/2.54.2/" aria-label="PyPI"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
276
+ <a class="muted-link " href="https://pypi.org/project/pex/2.69.0/" aria-label="PyPI"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
286
277
  <path d="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z">
287
278
  </path>
288
279
  </svg>
289
280
  </a>
290
- <a class="muted-link " href="https://github.com/pex-tool/pex/releases/download/v2.54.2/pex" aria-label="Download"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 640 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
281
+ <a class="muted-link " href="https://github.com/pex-tool/pex/releases/download/v2.69.0/pex" aria-label="Download"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 640 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
291
282
  <path d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z">
292
283
  </path>
293
284
  </svg>
@@ -310,7 +301,7 @@
310
301
 
311
302
  </aside>
312
303
  </div>
313
- </div><script src="_static/documentation_options.js?v=a32edb08"></script>
304
+ </div><script src="_static/documentation_options.js?v=525daa63"></script>
314
305
  <script src="_static/doctools.js?v=9bcbadda"></script>
315
306
  <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
316
307
  <script src="_static/scripts/furo.js?v=46bd48cc"></script>
@@ -1,16 +1,16 @@
1
1
  <!doctype html>
2
2
  <html class="no-js" lang="en" data-content_root="./">
3
- <head><meta charset="utf-8"/>
4
- <meta name="viewport" content="width=device-width,initial-scale=1"/>
3
+ <head><meta charset="utf-8">
4
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
5
  <meta name="color-scheme" content="light dark"><meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <link rel="index" title="Index" href="genindex.html" /><link rel="search" title="Search" href="search.html" /><link rel="next" title="Building .pex files" href="buildingpex.html" /><link rel="prev" title="pex" href="index.html" />
7
- <link rel="prefetch" href="_static/pex-logo-light.png" as="image" />
8
- <link rel="prefetch" href="_static/pex-logo-dark.png" as="image" />
6
+ <link rel="index" title="Index" href="genindex.html"><link rel="search" title="Search" href="search.html"><link rel="next" title="Building .pex files" href="buildingpex.html"><link rel="prev" title="pex" href="index.html">
7
+ <link rel="prefetch" href="_static/pex-logo-light.png" as="image">
8
+ <link rel="prefetch" href="_static/pex-logo-dark.png" as="image">
9
9
 
10
- <link rel="shortcut icon" href="_static/pex-icon.png"/><!-- Generated with Sphinx 8.2.3 and Furo 2025.07.19 -->
11
- <title>What are .pex files? - Pex Docs (v2.54.2)</title>
10
+ <link rel="shortcut icon" href="_static/pex-icon.png"><!-- Generated with Sphinx 8.2.3 and Furo 2025.09.25 -->
11
+ <title>What are .pex files? - Pex Docs (v2.69.0)</title>
12
12
  <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=d111a655" />
13
- <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=25af2a20" />
13
+ <link rel="stylesheet" type="text/css" href="_static/styles/furo.css?v=580074bf" />
14
14
  <link rel="stylesheet" type="text/css" href="_static/styles/furo-extensions.css?v=8dab3a3b" />
15
15
 
16
16
 
@@ -24,14 +24,14 @@
24
24
  }
25
25
  @media not print {
26
26
  body[data-theme="dark"] {
27
- --color-code-background: #2b2b2b;
28
- --color-code-foreground: #f8f8f2;
27
+ --color-code-background: #202020;
28
+ --color-code-foreground: #d0d0d0;
29
29
 
30
30
  }
31
31
  @media (prefers-color-scheme: dark) {
32
32
  body:not([data-theme="light"]) {
33
- --color-code-background: #2b2b2b;
34
- --color-code-foreground: #f8f8f2;
33
+ --color-code-background: #202020;
34
+ --color-code-foreground: #d0d0d0;
35
35
 
36
36
  }
37
37
  }
@@ -146,14 +146,10 @@
146
146
  </symbol>
147
147
  </svg>
148
148
 
149
- <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
150
- <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
151
- <label class="overlay sidebar-overlay" for="__navigation">
152
- <div class="visually-hidden">Hide navigation sidebar</div>
153
- </label>
154
- <label class="overlay toc-overlay" for="__toc">
155
- <div class="visually-hidden">Hide table of contents sidebar</div>
156
- </label>
149
+ <input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle site navigation sidebar">
150
+ <input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc" aria-label="Toggle table of contents sidebar">
151
+ <label class="overlay sidebar-overlay" for="__navigation"></label>
152
+ <label class="overlay toc-overlay" for="__toc"></label>
157
153
 
158
154
  <a class="skip-to-content muted-link" href="#furo-main-content">Skip to content</a>
159
155
 
@@ -163,17 +159,15 @@
163
159
  <header class="mobile-header">
164
160
  <div class="header-left">
165
161
  <label class="nav-overlay-icon" for="__navigation">
166
- <div class="visually-hidden">Toggle site navigation sidebar</div>
167
- <i class="icon"><svg><use href="#svg-menu"></use></svg></i>
162
+ <span class="icon"><svg><use href="#svg-menu"></use></svg></span>
168
163
  </label>
169
164
  </div>
170
165
  <div class="header-center">
171
- <a href="index.html"><div class="brand">Pex Docs (v2.54.2)</div></a>
166
+ <a href="index.html"><div class="brand">Pex Docs (v2.69.0)</div></a>
172
167
  </div>
173
168
  <div class="header-right">
174
169
  <div class="theme-toggle-container theme-toggle-header">
175
- <button class="theme-toggle">
176
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
170
+ <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
177
171
  <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
178
172
  <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
179
173
  <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
@@ -181,8 +175,7 @@
181
175
  </button>
182
176
  </div>
183
177
  <label class="toc-overlay-icon toc-header-icon" for="__toc">
184
- <div class="visually-hidden">Toggle table of contents sidebar</div>
185
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
178
+ <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
186
179
  </label>
187
180
  </div>
188
181
  </header>
@@ -241,8 +234,7 @@
241
234
  <span class="visually-hidden">Edit this page</span>
242
235
  </a>
243
236
  </div><div class="theme-toggle-container theme-toggle-content">
244
- <button class="theme-toggle">
245
- <div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
237
+ <button class="theme-toggle" aria-label="Toggle Light / Dark / Auto color theme">
246
238
  <svg class="theme-icon-when-auto-light"><use href="#svg-sun-with-moon"></use></svg>
247
239
  <svg class="theme-icon-when-auto-dark"><use href="#svg-moon-with-sun"></use></svg>
248
240
  <svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
@@ -250,8 +242,7 @@
250
242
  </button>
251
243
  </div>
252
244
  <label class="toc-overlay-icon toc-content-icon" for="__toc">
253
- <div class="visually-hidden">Toggle table of contents sidebar</div>
254
- <i class="icon"><svg><use href="#svg-toc"></use></svg></i>
245
+ <span class="icon"><svg><use href="#svg-toc"></use></svg></span>
255
246
  </label>
256
247
  </div>
257
248
  <article role="main" id="furo-main-content">
@@ -331,12 +322,12 @@ build executable .pex files. This is described more thoroughly in
331
322
  </div>
332
323
  <div class="right-details">
333
324
  <div class="icons">
334
- <a class="muted-link " href="https://pypi.org/project/pex/2.54.2/" aria-label="PyPI"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
325
+ <a class="muted-link " href="https://pypi.org/project/pex/2.69.0/" aria-label="PyPI"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 448 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
335
326
  <path d="M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z">
336
327
  </path>
337
328
  </svg>
338
329
  </a>
339
- <a class="muted-link " href="https://github.com/pex-tool/pex/releases/download/v2.54.2/pex" aria-label="Download"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 640 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
330
+ <a class="muted-link " href="https://github.com/pex-tool/pex/releases/download/v2.69.0/pex" aria-label="Download"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 640 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg">
340
331
  <path d="M537.6 226.6c4.1-10.7 6.4-22.4 6.4-34.6 0-53-43-96-96-96-19.7 0-38.1 6-53.3 16.2C367 64.2 315.3 32 256 32c-88.4 0-160 71.6-160 160 0 2.7.1 5.4.2 8.1C40.2 219.8 0 273.2 0 336c0 79.5 64.5 144 144 144h368c70.7 0 128-57.3 128-128 0-61.9-44-113.6-102.4-125.4zm-132.9 88.7L299.3 420.7c-6.2 6.2-16.4 6.2-22.6 0L171.3 315.3c-10.1-10.1-2.9-27.3 11.3-27.3H248V176c0-8.8 7.2-16 16-16h48c8.8 0 16 7.2 16 16v112h65.4c14.2 0 21.4 17.2 11.3 27.3z">
341
332
  </path>
342
333
  </svg>
@@ -380,7 +371,7 @@ build executable .pex files. This is described more thoroughly in
380
371
 
381
372
  </aside>
382
373
  </div>
383
- </div><script src="_static/documentation_options.js?v=a32edb08"></script>
374
+ </div><script src="_static/documentation_options.js?v=525daa63"></script>
384
375
  <script src="_static/doctools.js?v=9bcbadda"></script>
385
376
  <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
386
377
  <script src="_static/scripts/furo.js?v=46bd48cc"></script>
@@ -0,0 +1,98 @@
1
+ # Copyright 2025 Pex project contributors.
2
+ # Licensed under the Apache License, Version 2.0 (see LICENSE).
3
+
4
+ from __future__ import absolute_import, print_function
5
+
6
+ import itertools
7
+ import os
8
+ from textwrap import dedent
9
+
10
+ from pex import windows
11
+ from pex.common import safe_open
12
+ from pex.dist_metadata import CallableEntryPoint, EntryPoints
13
+ from pex.exceptions import reportable_unexpected_error_msg
14
+ from pex.executables import chmod_plus_x
15
+ from pex.interpreter import PythonInterpreter
16
+ from pex.os import WINDOWS
17
+ from pex.typing import TYPE_CHECKING
18
+
19
+ if TYPE_CHECKING:
20
+ from typing import Iterator, Optional, Text, Tuple
21
+
22
+
23
+ def install_scripts(
24
+ dest_dir, # type: str
25
+ entry_points, # type: EntryPoints
26
+ interpreter=None, # type: Optional[PythonInterpreter]
27
+ overwrite=True, # type: bool
28
+ ):
29
+ # type: (...) -> Iterator[Tuple[Text, Text]]
30
+
31
+ if not entry_points:
32
+ return
33
+
34
+ if entry_points.source is None:
35
+ raise AssertionError(reportable_unexpected_error_msg())
36
+
37
+ script_src = entry_points.source
38
+ shebang = interpreter.shebang() if interpreter else "#!python"
39
+ for named_entry_point, gui in itertools.chain.from_iterable(
40
+ ((value, gui) for value in entry_points.get(key, {}).values())
41
+ for key, gui in (("console_scripts", False), ("gui_scripts", True))
42
+ ):
43
+ entry_point = named_entry_point.entry_point
44
+ if isinstance(entry_point, CallableEntryPoint):
45
+ script = dedent(
46
+ """\
47
+ {shebang}
48
+ # -*- coding: utf-8 -*-
49
+ import importlib
50
+ import sys
51
+
52
+ entry_point = importlib.import_module({modname!r})
53
+ for attr in {attrs!r}:
54
+ entry_point = getattr(entry_point, attr)
55
+
56
+ if __name__ == "__main__":
57
+ import os
58
+ pex_root_fallback = os.environ.get("_PEX_ROOT_FALLBACK")
59
+ if pex_root_fallback:
60
+ import atexit
61
+ import shutil
62
+
63
+ atexit.register(shutil.rmtree, pex_root_fallback, True)
64
+
65
+ sys.exit(entry_point())
66
+ """
67
+ ).format(shebang=shebang, modname=entry_point.module, attrs=entry_point.attrs)
68
+ else:
69
+ script = dedent(
70
+ """\
71
+ {shebang}
72
+ # -*- coding: utf-8 -*-
73
+ import runpy
74
+ import sys
75
+
76
+ if __name__ == "__main__":
77
+ import os
78
+ pex_root_fallback = os.environ.get("_PEX_ROOT_FALLBACK")
79
+ if pex_root_fallback:
80
+ import atexit
81
+ import shutil
82
+
83
+ atexit.register(shutil.rmtree, pex_root_fallback, True)
84
+
85
+ runpy.run_module({modname!r}, run_name="__main__", alter_sys=True)
86
+ sys.exit(0)
87
+ """
88
+ ).format(shebang=shebang, modname=entry_point.module)
89
+ script_abspath = os.path.join(dest_dir, named_entry_point.name)
90
+ if WINDOWS:
91
+ script_abspath = windows.create_script(
92
+ script_abspath, script, gui=gui, overwrite=overwrite
93
+ )
94
+ elif overwrite or not os.path.exists(script_abspath):
95
+ with safe_open(script_abspath, "w") as fp:
96
+ fp.write(script)
97
+ chmod_plus_x(fp.name)
98
+ yield script_src, script_abspath