pyflightstream.workspace.builds (provisional)¶
Generated from the docstrings at build time: every one of the 6 names in the __all__ of pyflightstream.workspace.builds has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
The build registry of a workspace: which executable a FlightStream build id names.
inputs/executables.toml maps a build id to its executable path; an entry
is a bare path string, or a table carrying that path and, optionally, the
FlightStream version the build's scripts are emitted under, checked against
the version registry when it is read (PFS-2009.05). This machine's overlay,
inputs/executables.local.toml (PFS-2031.15), supplies the real path of a
build a versioned workspace carries with a placeholder. An explicit override
path bypasses the registry, and that override is the only way to run an
unregistered build (the MANUAL mode of the run matrix).
Every public name is re-exported, unchanged, by :mod:pyflightstream.workspace.inputs,
its path (AD-11).
Advanced¶
pyflightstream.workspace.builds.EXECUTABLES_FILE
module-attribute
¶
EXECUTABLES_FILE = 'executables.toml'
pyflightstream.workspace.builds.EXECUTABLE_ENTRY_KEYS
module-attribute
¶
EXECUTABLE_ENTRY_KEYS = (
"path",
"version",
"accept_unregistered_build",
)
pyflightstream.workspace.builds.LOCAL_EXECUTABLES_FILE
module-attribute
¶
LOCAL_EXECUTABLES_FILE = 'executables.local.toml'
pyflightstream.workspace.builds.RegisteredBuild
dataclass
¶
RegisteredBuild(
fs_exe: Path,
fs_version: str | None,
accept_unregistered_build: bool = False,
)
One entry of the workspace build registry, as the registry states it.
Attributes:
| Name | Type | Description |
|---|---|---|
fs_exe |
Path
|
The executable this build id names. Existence is checked by the executor at construction, so a campaign can be authored away from the licensed machine. |
fs_version |
str or None
|
The FlightStream version the registry DECLARES this build's
scripts are emitted under, canonical identifier ( It is a DECLARATION and never an inference. Nothing here reads a
version out of the executable path or out of the build id, which
is the rule :class: |
accept_unregistered_build |
bool
|
The entry of this machine's overlay accepts the build installed at
|
pyflightstream.workspace.builds.resolve_build
¶
resolve_build(
inputs_dir: Path,
build_id: str,
override: str | Path | None = None,
) -> RegisteredBuild
Read the registry entry of one build id: its executable and its version.
Two explicit modes, translated from the run matrix's MANUAL pattern:
- Registry mode (default): the build id must exist in
inputs/executables.toml, a top-level TOML table mapping build ids to entries. - Override mode: an explicit
overridepath wins over the registry and is the only way to run an unregistered build; it is never guessed from the environment. An override declares NO version, because it is a bare path with no registry entry behind it to carry one.
TWO ENTRY SHAPES, and the difference is what a build may say about itself:
"26.120" = "C:/fs26120/FlightStream.exe"is the shape this registry has always had and means exactly what it meant: the build id names an executable and declares no version, so a campaign that sends a row to it emits that row's script under the campaign default version."26.123" = { path = "C:/fs26123/FlightStream.exe", version = "26.123" }declares the version as well, which is what lets ONE run matrix send its rows to two solver builds and record each row against the version its own build emits under (PFS-2009.05).
The table is where the declaration lives because it is already the
file in which the user says what a build id MEANS on this machine.
Deriving the version from the build id instead would be the
inference :class:pyflightstream.run.SolverBuild refuses, and the
two are not the same thing: a registry key is a name the campaign
user chose, and nothing stops it naming an installation whose
command database is anything at all.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
build_id
|
str
|
Build identifier key of the registry, for example |
required |
override
|
str or Path
|
Explicit executable path bypassing the registry. |
None
|
Returns:
| Type | Description |
|---|---|
RegisteredBuild
|
The executable, and the declared version or None. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Registry file missing; build id not registered (the message
lists the registered build ids and the override mode); an entry
that is neither a path string nor a table; a table with no
|
Examples:
>>> from pyflightstream.workspace.inputs import resolve_build
>>> build = resolve_build(workspace.inputs_dir, "26.123")
>>> build.fs_version
'26.123'
pyflightstream.workspace.builds.resolve_executable
¶
resolve_executable(
inputs_dir: Path,
build_id: str,
override: str | Path | None = None,
) -> Path
Resolve the FlightStream executable of one build id.
The path half of :func:resolve_build, which is where the registry
is read and where both entry shapes are described. This is the call
for a caller who wants the executable and nothing else; a caller who
also needs the version the build declares calls
:func:resolve_build instead, because the two facts come from one
entry and reading it twice is how they would drift apart.
Existence of the executable is checked by the executor at construction (so campaigns can be authored away from the licensed machine), not here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
build_id
|
str
|
Build identifier key of the registry, for example |
required |
override
|
str or Path
|
Explicit executable path bypassing the registry. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The executable path. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Every refusal of :func: |