-
I'd like to be able to use As some of you know, I've been workarounding this for a while using a custom entrypoint loader that scans BUILD files with AST parsing for development setups. This is also mentioned in my PyCon KR/JP 2022 talks ([1], [2]). Currently we can only specify the full entrypoint attribute in the If this is supported, I could exploit the full convenience of pex packages. When installing our client SDK in some customer sites, there are cases that we cannot easily modify the target virtual environment. For example, to inject a self-contained SDK inside arbitrary immutable containers, it will be sufficient to mount just a single file and a single directory: the pex package and a standalone python build.
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 27 replies
-
So it sounds like what you want is a way to set some metadata on a pex, so that |
Beta Was this translation helpful? Give feedback.
-
Note that a pex_binary's "entry_point" field is not an entry point in the importlib.metadata sense, but just "what code to run when the pex is invoked", so best not to get those mixed up. |
Beta Was this translation helpful? Give feedback.
-
I did a bit of experimenting, and you can achieve this today with no Pex or Pants changes with something like: src_root/anyname.dist_info/entry_points.txt:
src_root/foo/bar.py:
src_root/foo/BUILD:
src_root/BUILD:
Now:
Note that it's important that the |
Beta Was this translation helpful? Give feedback.
-
I am having issues with this as well, though mostly for local workflows. I'm porting a bunch of loose packages into Pants. Our main application is centered around using "plugins" for various computation workflows, with a centralized entrypoint containing workload and configuration management. So Our old workflow was centered around "editable" installs for development, which meant that for the most part entry_points worked. The sharpest edge was that you needed to reinstall if you added an entry_point, but that is quite rare. And anything beyond that was automated with CI or scripts, so the nitty-gritty of installing the right plugins for the right cloud image etc was never a concern. In Pants; this workflow seemingly gets much worse. Using the above approach works; but due to our heavy set of dependencies (torch, tensorflow, scipy, etc) it ends up being ridiculously slow - I'm measuring > 1minute to just build the pex with the same depset. I've instead opted to make the "host" |
Beta Was this translation helpful? Give feedback.
I did a bit of experimenting, and you can achieve this today with no Pex or Pants changes with something like:
src_root/anyname.dist_info/entry_points.txt:
src_root/foo/bar.py:
src_root/foo/BUILD:
src_root/BUILD:
Now: