Perhaps, but from the info you provided this shoul...
# development
Perhaps, but from the info you provided this should not work. Did you leave out a PEX_EXTRA_SYS_PATH or similar from the contents?
Why shouldn't it work? And no, no
Because PEXes are hermetic by default and the entry point you specify is loose outside the PEX.
So the PEX purposefully cannot see
unless you tell it to.
For example:
Copy code
jsirois@Gill-Windows:~/dev/pantsbuild/jsirois-scie-pants (install/specialize-setuptools-version *) $ echo "print(f'Here {__file__}')" >
jsirois@Gill-Windows:~/dev/pantsbuild/jsirois-scie-pants (install/specialize-setuptools-version *) $ pex -oempty.pex
jsirois@Gill-Windows:~/dev/pantsbuild/jsirois-scie-pants (install/specialize-setuptools-version *) $ PEX_MODULE=loose ./empty.pex
Traceback (most recent call last):
  File "/usr/lib/python3.10/", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/", line 86, in _run_code
    exec(code, run_globals)
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/", line 106, in <module>
    bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 618, in bootstrap_pex
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 560, in execute
    sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 467, in _wrap_coverage
    return runner(*args)
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 498, in _wrap_profiling
    return runner(*args)
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 592, in _execute
    return self.execute_entry(
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 800, in execute_entry
    return self.execute_module(entry_point.module)
  File "/home/jsirois/.pex/unzipped_pexes/6d69888624b3304a2671961f15e628c55daf5895/.bootstrap/pex/", line 808, in execute_module
    runpy.run_module(module_name, run_name="__main__", alter_sys=True)
  File "/usr/lib/python3.10/", line 220, in run_module
    mod_name, mod_spec, code = _get_module_details(mod_name)
  File "/usr/lib/python3.10/", line 140, in _get_module_details
    raise error("No module named %s" % mod_name)
ImportError: No module named loose
jsirois@Gill-Windows:~/dev/pantsbuild/jsirois-scie-pants (install/specialize-setuptools-version *) $ PEX_EXTRA_SYS_PATH=. PEX_MODULE=loose ./empty.pex
Here /home/jsirois/dev/pantsbuild/jsirois-scie-pants/./
This is extremely old PEX behavior.
Huh, well TIL. Thanks
So what changed then?
Something from Pants I presume in how it runs VenvPEXs? The branch's diff is minimal and the version is the only thing that makes sense
Might this be ? Do you only see the behaviour change when you run with
? Potentially it was previously inheriting something from your shell...
that's 2.17 only, nevermind...