Fix pyright type errors across codebase

- Add pyrightconfig.json for pyright 1.1.408 TOML parsing workaround
- Add NoReturn annotations to fatal() functions for proper type narrowing
- Add None checks and assertions after require=True get_record() calls
- Fix AttrDict class with __getattr__ for dynamic attribute access
- Add type annotations and casts for Kubernetes client objects
- Store compose config as DockerDeployer instance attributes
- Filter None values from dotenv and environment mappings
- Use hasattr/getattr patterns for optional container attributes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
A. F. Dudley
2026-01-22 01:10:36 -05:00
co-authored by Claude Opus 4.5
parent cd3d908d0d
commit dd856af2d3
29 changed files with 512 additions and 267 deletions
@@ -248,7 +248,7 @@ def setup(
network_dir = Path(parameters.network_dir).absolute()
laconicd_home_path_in_container = "/laconicd-home"
mounts = [VolumeMapping(network_dir, laconicd_home_path_in_container)]
mounts = [VolumeMapping(str(network_dir), laconicd_home_path_in_container)]
if phase == SetupPhase.INITIALIZE:
# We want to create the directory so if it exists that's an error
@@ -379,6 +379,7 @@ def setup(
parameters.gentx_address_list
)
# Add those keys to our genesis, with balances we determine here (why?)
outputk = None
for other_node_key in other_node_keys:
outputk, statusk = run_container_command(
command_context,
@@ -389,7 +390,7 @@ def setup(
"--keyring-backend test",
mounts,
)
if options.debug:
if options.debug and outputk is not None:
print(f"Command output: {outputk}")
# Copy the gentx json files into our network dir
_copy_gentx_files(network_dir, parameters.gentx_file_list)
@@ -15,6 +15,7 @@
from stack_orchestrator.util import get_yaml
from stack_orchestrator.deploy.deploy_types import DeployCommandContext
from stack_orchestrator.deploy.deployment_context import DeploymentContext
from stack_orchestrator.deploy.stack_state import State
from stack_orchestrator.deploy.deploy_util import VolumeMapping, run_container_command
from pathlib import Path
@@ -31,7 +32,7 @@ def setup(command_context: DeployCommandContext, parameters, extra_args):
host_directory = "./container-output-dir"
host_directory_absolute = Path(extra_args[0]).absolute().joinpath(host_directory)
host_directory_absolute.mkdir(parents=True, exist_ok=True)
mounts = [VolumeMapping(host_directory_absolute, "/data")]
mounts = [VolumeMapping(str(host_directory_absolute), "/data")]
output, status = run_container_command(
command_context,
"test",
@@ -45,9 +46,9 @@ def init(command_context: DeployCommandContext):
return yaml.load(default_spec_file_content)
def create(command_context: DeployCommandContext, extra_args):
def create(deployment_context: DeploymentContext, extra_args):
data = "create-command-output-data"
output_file_path = command_context.deployment_dir.joinpath("create-file")
output_file_path = deployment_context.deployment_dir.joinpath("create-file")
with open(output_file_path, "w+") as output_file:
output_file.write(data)