Skip to content

Mark azure-functions-durable as typed - #246

Open
andystaples wants to merge 2 commits into
microsoft:mainfrom
andystaples:andystaples-mark-functions-package-typed
Open

Mark azure-functions-durable as typed#246
andystaples wants to merge 2 commits into
microsoft:mainfrom
andystaples:andystaples-mark-functions-package-typed

Conversation

@andystaples

Copy link
Copy Markdown
Contributor

Summary

  • ship a PEP 561 py.typed marker with azure-functions-durable
  • verify the marker is present in both wheel and source distributions
  • type-check a strict consumer import against the installed wheel

Validation

  • nox -s typecheck_functions
  • nox -s lint -- noxfile.py azure-functions-durable tests/azure-functions-durable
  • nox -s functions_unit-3.13

Fixes #242

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3775188c-77e9-48a2-9c79-76e7bfdc25f9
Copilot AI review requested due to automatic review settings July 29, 2026 20:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds PEP 561 typed-package support for the azure-functions-durable provider so strict type checkers recognize azure.durable_functions, and introduces a packaging/type-check smoke test that validates the marker is present in both wheel and sdist artifacts.

Changes:

  • Add azure.durable_functions/py.typed and include it in distribution package data.
  • Extend nox -s typecheck_functions to build wheel/sdist, verify py.typed is present, and run a strict Pyright “consumer import” check against the installed wheel.
  • Add a strict Pyright smoke-test project under tests/azure-functions-durable/typing and document the user-facing change in the changelog.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/azure-functions-durable/typing/pyrightconfig.json Adds a strict Pyright config for the consumer import smoke test.
tests/azure-functions-durable/typing/import_package.py Minimal strict-typed consumer import exercising azure.durable_functions + DFApp.
noxfile.py Builds and validates artifacts in typecheck_functions, then runs consumer Pyright against the installed wheel.
azure-functions-durable/pyproject.toml Ensures py.typed is shipped via setuptools package data.
azure-functions-durable/CHANGELOG.md Documents the new typed-package behavior under Unreleased.
azure-functions-durable/azure/durable_functions/py.typed Adds the PEP 561 marker file to the package.

Comment thread noxfile.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 3775188c-77e9-48a2-9c79-76e7bfdc25f9
Copilot AI review requested due to automatic review settings July 29, 2026 20:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

@berndverst berndverst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one reproducible gap in the packaged-consumer validation; see the inline comment.

Comment thread noxfile.py
session.install("-r", "requirements.txt")
_install_packages(session, editable=True)
session.install("pyright")
session.install("-e", str(REPO_ROOT))

@berndverst berndverst Jul 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Make the consumer check resolve packaged core types

Pyright does not follow this PEP 660 editable install for the consumer config: pyright --verbose reports Could not import 'durabletask.task', while the new DFApp() probe still passes. A strict probe that also uses the public df.RetryPolicy and DurableOrchestrationContext.call_activity() then produces five reportUnknown* errors; installing the already-typed core wheel makes them disappear. This leaves the packaging smoke test blind to regressions in the provider's core-backed public types. Install/build the core wheel for the consumer phase (forcing it fresh under nox -R) and exercise at least one core-backed export.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark the azure-functions-durable package as typed (PEP 561)

3 participants