pb_client.compile.compile_script
async
¶
compile_script(path, *, roots=None)
Compile a script into a program, for a hub whose profile is not known.
Packs immediately with the modern naming, so it is for callers with no hub
in hand -- pb check, which only wants to know that a program builds
and how large it comes out. Anything about to send a program to a hub
should use compile_program and pack
once the hub has said which profile it speaks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The script to compile. |
required |
roots
|
Sequence[Path] | None
|
The directories module names are looked for in. |
None
|
Returns:
| Type | Description |
|---|---|
bytes
|
The compiled program. |
Raises:
| Type | Description |
|---|---|
CompileError
|
If the file cannot be read or the compiler rejects it. |