pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.19k stars 613 forks source link

Fix running python_sources with pex --executable (Cherry-pick of #21047) #21086

Closed cognifloyd closed 2 weeks ago

cognifloyd commented 2 weeks ago

This fixes the feature added in #20497 as it broke using pants run on a python_source if the file name has - or other invalid characters. Bug reported here: https://pantsbuild.slack.com/archives/C046T6T9U/p1717624913138789?thread_ts=1717624913.138789&cid=C046T6T9U

The other integration test for the pex --executable feature only tested running pex_binary, not python_source. So, I missed applying some of the path logic to both cases.