Repository navigation
TPT-4835: Complete Python 3.11 compatibility cleanup - #766
Open
zliang-akamai wants to merge 1 commit into
Open
zliang-akamai wants to merge 1 commit into
zliang-akamai wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
zliang-akamai
requested review from
josephcardillo-akamai and
psnoch-akamai
and
a balanced review from Copilot
and removed request for
a team
December 3, 2026 04:25
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the Python 3.11 cleanup.
No open issues 🎉
What changed in this PR
Completes the SDK’s Python 3.11 cleanup by replacing compatibility code with standard-library features and consolidating lint configuration.
Changes:
- Adopt
enum.StrEnumwhile preserving the existing import path and testing serialization. - Use
typing.Self, remove redundant imports, and replace externalmockusage. - Move Pylint configuration into
pyproject.toml.
| File | Description |
|---|---|
test/unit/objects/valkey_test.py |
Use unittest.mock.patch. |
test/unit/objects/serializable_test.py |
Test StrEnum identity and serialization. |
test/unit/groups/valkey_test.py |
Use unittest.mock.patch. |
test/unit/base.py |
Use standard-library mocking. |
pyproject.toml |
Remove mock dependency and configure Pylint. |
linode_api4/objects/vpc.py |
Import standard-library StrEnum. |
linode_api4/objects/serializable.py |
Replace custom StrEnum with a compatibility alias. |
linode_api4/objects/region.py |
Import standard-library StrEnum. |
linode_api4/objects/placement.py |
Import standard-library StrEnum. |
linode_api4/objects/object_storage.py |
Import standard-library StrEnum. |
linode_api4/objects/nodebalancer.py |
Import standard-library StrEnum. |
linode_api4/objects/monitor.py |
Import standard-library StrEnum. |
linode_api4/objects/lock.py |
Import standard-library StrEnum. |
linode_api4/objects/linode.py |
Import standard-library StrEnum. |
linode_api4/objects/image.py |
Import standard-library StrEnum. |
linode_api4/objects/account.py |
Adopt StrEnum and remove postponed annotations. |
linode_api4/linode_client.py |
Remove postponed annotations import. |
linode_api4/errors.py |
Use Self return annotations and simplify imports. |
.pylintrc |
Remove migrated legacy configuration. |
Review effort: Balanced
This branch has not been deployed
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.
📝 Description
Complete the SDK cleanup enabled by raising the minimum supported Python version to 3.11. Replace the in-house string enum implementation with the standard library while preserving the existing import path, use
typing.Selffor classmethod return types, remove the externalmockbackport dependency, and migrate the legacy Pylint configuration intopyproject.toml.Also remove redundant compatibility imports and update newly merged tests to use
unittest.mock.✔️ How to Test
The unit suite passed with 584 tests and 61 subtests. Pylint reported 10.00/10, and the formatting/import checks passed.