Mark azure-functions-durable as typed - #246
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3775188c-77e9-48a2-9c79-76e7bfdc25f9
There was a problem hiding this comment.
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.typedand include it in distribution package data. - Extend
nox -s typecheck_functionsto build wheel/sdist, verifypy.typedis 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/typingand 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. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3775188c-77e9-48a2-9c79-76e7bfdc25f9
berndverst
left a comment
There was a problem hiding this comment.
Found one reproducible gap in the packaged-consumer validation; see the inline comment.
| session.install("-r", "requirements.txt") | ||
| _install_packages(session, editable=True) | ||
| session.install("pyright") | ||
| session.install("-e", str(REPO_ROOT)) |
There was a problem hiding this comment.
[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.
Summary
py.typedmarker withazure-functions-durableValidation
nox -s typecheck_functionsnox -s lint -- noxfile.py azure-functions-durable tests/azure-functions-durablenox -s functions_unit-3.13Fixes #242