Skip to content

Implement type hint stubs #287

Description

@ryanraaschCDC

Summary

We want to add type hinting stubs to the package like we did for data ops.

Blockers/Related work
Note blockers here and in the relationship panel

Definition of Done
Can access type hints for cfa-cloudops when the package is installed.

Expected amount of work (days)
2

Remove question label once details are complete, change task to bug if bug.

Activity

  1. uhc7 commented on Sep 21, 2026

    @uhc7
    Contributor

    Initial analysis / implementation plan

    Reviewed the existing type-stub implementation in cfa-dataops and compared it with the current cfa-cloudops package structure.

    Findings:

    • cfa-dataops uses a py.typed marker and explicitly includes the typing resources in its package build.
    • DataOps also generates .pyi files for its catalog because the catalog API is dynamically constructed at runtime.
    • cfa-cloudops currently does not contain a py.typed marker or package-specific type stub configuration.
    • CloudOps already has inline type annotations across much of the implementation.
    • The top-level cfa.cloudops API exposes CloudClient, ContainerAppClient, FunctionAppClient, run_experiment, run_tasks, and Task lazily through getattr, so the top-level public API needs particular attention for static type discovery.

    Proposed implementation:

    • Add and package a py.typed marker for cfa.cloudops.
    • Add the minimal stub support needed for the lazy top-level public API.
    • Add tests to verify typing resources are included and accessible from the installed package.
    • Validate the built/installed package to confirm the Definition of Done: type hints are available to consumers after installation.

    The DataOps catalog-specific stub generation/template logic does not appear necessary for CloudOps, so the implementation will remain minimal unless validation identifies a need for additional generated stubs.

  2. uhc7 commented on Sep 21, 2026

    @uhc7
    Contributor

    Implementation is complete and PR #293 is open for review.

    Added py.typed and a top-level init.pyi for the CloudOps public API, updated the Hatch build configuration to package the typing resources, and added focused tests.

    Validation completed:

    Type-stub tests: 2 passed
    Ruff and targeted pre-commit checks passed
    Built and inspected the wheel successfully
    Installed the wheel in an isolated environment and confirmed py.typed, init.pyi, and the public CloudOps exports are available from the installed package
    Full test suite: 272 passed; 1 existing Windows-specific /tmp path failure unrelated to this change

    PR: #293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions