Repository navigation
Add Python modernization and deprecation guardrails - #327
Open
andystaples wants to merge 5 commits into
Open
andystaples wants to merge 5 commits into
andystaples wants to merge 5 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The Python modernization and deprecation-check changes have no active review issues.
No open issues 🎉
What changed in this PR
Adds Python modernization and deprecation checks across the core SDK and both providers without changing package minimum versions or public API behavior.
Changes:
- Integrates Ruff modernization rules with Nox linting, using package-specific Python targets and scoped exclusions.
- Makes deprecation warnings fail tests by default, with Python 3.13 as the strict Nox gate while retaining compatibility coverage.
- Updates affected tests and documents guardrails and deferred cleanup.
| File | Description |
|---|---|
tests/durabletask/test_proto_task_hub_shim.py |
Removes unnecessary class declaration parentheses. |
tests/durabletask/test_orchestration_executor.py |
Replaces deprecated UTC calls while preserving naive timestamps. |
tests/durabletask/test_batch_actions.py |
Uses the supported client logger parameter. |
tests/durabletask/extensions/history_export/test_activities.py |
Removes a redundant UTF-8 encoding argument. |
tests/durabletask-azuremanaged/test_dts_batch_actions.py |
Uses the supported Managed client logger parameter. |
tests/azure-functions-durable/test_worker_compat.py |
Asserts the expected retry-options deprecation warning. |
tests/azure-functions-durable/test_client_compat.py |
Asserts the expected entity unpickling deprecation warning. |
pyproject.toml |
Configures Ruff targets, exclusions, and pytest warning enforcement. |
noxfile.py |
Adds Ruff linting and interpreter-specific warning handling. |
docs/development.md |
Explains checks, exceptions, and focused validation commands. |
dev-requirements.txt |
Adds Ruff as a development dependency. |
.github/copilot-instructions.md |
Documents compatibility-aware modernization and warning-handling guidance. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
UPrules alongside Flake8 in the existing Nox lint session. Target Python 3.11 for core/Managed and Python 3.13 for Functions, including tests and examples; exclude generated protobuf files.DeprecationWarningandPendingDeprecationWarningas errors in the root pytest configuration. Use Python 3.13 as the strict Nox deprecation gate while retaining the full compatibility matrices; other Nox interpreter versions continue to report these warnings without failing.utcnow()calls in executor tests without changing naive-UTC timestamp comparisons, migrate the pagination test to the supported logger API, and assert warnings in tests deliberately exercising deprecated compatibility APIs.Deliberate limits and follow-up
This does not attempt a repository-wide modernization sweep. Temporarily excluded rules do not reject new occurrences until their cleanup is complete:
Ruff is not a comprehensive deprecated-API database, and runtime warning enforcement only covers executed code. Parent pytest filters do not govern separately launched Functions workers. Package versions and dependency minimums are unchanged.