pantsbuild / pants

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

Fix k8s-parser not able to load hikaru models (Cherry-pick of #21067) #21090

Closed WorkerPants closed 3 months ago

WorkerPants commented 3 months ago

We use the hikaru package to parse kubernetes manifests. It recently split into a core package and packages for models for each version of kubernetes. This is a problem when deployed via PEX. The core package uses it's __package__ attribute to locate the other members of the namespace package. But in a PEX, those are (by default) symlinked, and symlinked into special shards for the namespace (pex-ns-pkgs). This MR uses the --venv-site-packages-copies option, which was made for this situation:

This can be used to around problems with tools or libraries that are by symlinked source files.