_loader.py¶
python/src/entropic/_loader.py
librentropic.so resolution.
Owners: @tvanfossen
find_bin
Path | None entropic._loader.find_bin(str name="entropic")
Return the path to the bundled CLI executable, or None.
python/src/entropic/_loader.py:77
Source · 14 lines
def find_bin(name: str = "entropic") -> Path | None:
"""Return the path to the bundled CLI executable, or None.
The install-engine subcommand lays out the tarball under
``<root>/{bin,lib,include,share}``; given a known ``lib/librentropic.so``
we infer ``bin/<name>`` adjacent to it.
"""
lib = find()
if lib is None:
return None
candidate = lib.parent.parent / "bin" / name
return candidate if candidate.is_file() else None