Skip to content

plugins.aea-helpers.aea_helpers.pyinstaller_deps

Generate PyInstaller hidden-import and collect-all flags from agent dependencies.

get_modules_from_dist

def get_modules_from_dist(dist) -> List[str]

Get top-level modules from dist metadata, fallback to directory names.

Arguments:

  • dist: an importlib.metadata Distribution object.

Returns:

sorted list of unique module names.

get_agent_dependency_modules

def get_agent_dependency_modules(agent_dir: str) -> List[str]

Read agent config and resolve installed modules for all dependencies.

Arguments:

  • agent_dir: path to the agent directory.

Returns:

sorted list of module names.

filter_modules

def filter_modules(modules: List[str]) -> List[str]

Remove test-related and problematic modules.

Arguments:

  • modules: list of module names.

Returns:

filtered list.

build_pyinstaller_flags

def build_pyinstaller_flags(modules: List[str]) -> str

Build --hidden-import and --collect-all flags for PyInstaller.

Arguments:

  • modules: list of module names.

Returns:

space-separated flag string.

build_binary_deps

@click.command(name="build-binary-deps")
@click.argument("agent_dir", type=click.Path(exists=True), default="agent")
def build_binary_deps(agent_dir: str) -> None

Print PyInstaller dependency flags for an agent.

Reads the agent's aea-config.yaml, resolves all installed dependencies, and outputs --hidden-import and --collect-all flags for PyInstaller.

Arguments:

  • agent_dir: path to the agent directory.

bin_template_path

@click.command(name="bin-template-path")
def bin_template_path() -> None

Print the filesystem path to the PyInstaller entry point template.

Agent repos can pass this directly to pyinstaller's --onefile flag instead of maintaining a local copy of the template.