Python use case: Use importlib.metadata.files to call just from a Python package that depends on rust-just!
#2618
blakeNaccarato
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm planning to build out a tool that maps some Justfile recipes to a Python CLI (allowing to keep the implementation in one place). This would use
subprocess.rundirectly onjust.exe, but the problem was in finding a reliable way to locatejust.exeif installed via e.g.pip install rust-just.Well, I think
filesfromimportlib.metadatais the way to go. It produces objects that have a.locate()method to find their actual place, which is a bit more robust than, idk,Path(sys.executable).parent / "just.exe"or something to try and navigate to thebin/scriptsdirectory manually.Anyways, if anyone else is hacking together some abomination of a Python package that calls
justlike myself, this is an option!Beta Was this translation helpful? Give feedback.
All reactions