rhythmic-morning-87313
10/29/2023, 6:52 AMrhythmic-morning-87313
10/29/2023, 6:53 AMrhythmic-morning-87313
10/29/2023, 7:13 AMscience
executable, but this makes it portable with PATH.wide-midnight-78598
10/29/2023, 2:21 PMwide-midnight-78598
10/29/2023, 2:22 PMrhythmic-morning-87313
10/29/2023, 2:36 PMrhythmic-morning-87313
11/01/2023, 8:29 AM__main__.py
and main.py
are lost in the pex package.;; I haven't done anything special with them....rhythmic-morning-87313
11/01/2023, 8:33 AMmain.py
or __main__.py
when building pex?rhythmic-morning-87313
11/01/2023, 9:12 AM___init___.py
has from . import module
patterns. I have added an explicit import there and resolved the missing main.py
issue.rhythmic-morning-87313
11/01/2023, 9:13 AMrhythmic-morning-87313
11/01/2023, 9:13 AMrhythmic-morning-87313
11/01/2023, 9:18 AMwide-midnight-78598
11/01/2023, 12:55 PMwide-midnight-78598
11/01/2023, 12:56 PMrhythmic-morning-87313
11/01/2023, 1:15 PMwide-midnight-78598
11/01/2023, 1:25 PMenough-analyst-54434
11/01/2023, 4:25 PM__main__.py
is treated specially, not by Pex per-se, but by any Python zipapp Pex-like thing. That file is taken over since it's the bootstrap entry point and Pex (or Shiv, etc.) uses it to wire up the sys.path
for 3rd party dep consumption. In Pex's case the __main__.py
contents are: https://github.com/pantsbuild/pex/blob/a43c48c2a4b18b352be2c3175e0ae363ff8876d7/pex/pex_builder.py#L122-L229
For Shiv it's much simpler: https://github.com/linkedin/shiv/blob/a0cb71d04e0d7b58bb8561677ea148eb89d5a499/src/shiv/builder.py#L33-L38