GitHub
08/06/2025, 4:14 PMtyping.Self where possible
Pull request opened by edgarrmondragon
## Description
• chore: Use typing.Self where possible
• fix: Fix some sys.version_info imports
• fix: Fix some types in core test fixtures
## Related Issues
• Closes #XXXX
## Summary by Sourcery
Improve type annotations and version-specific imports by standardizing use of typing.Self, refactoring test fixtures to NamedTuples, fixing Python version checks for imports, and updating lint configuration.
Bug Fixes:
• Fix conditional imports of TypeAlias, override, and StrEnum based on Python version checks
• Correct sys.version_info import conditions across core modules
Enhancements:
• Refactor core test fixtures to use NamedTuple classes with precise type annotations and return types
• Standardize use of typing.Self for class and method return types across multiple modules
• Remove redundant TypeVar declarations in favor of typing.Self
• Add flake8-pyi to the lint ignore list in pyproject.toml
Tests:
• Update pytest fixtures for payloads, state_ids, and job_args to return NamedTuple types
## Summary by Sourcery
Adopt typing.Self for return type annotations, correct Python version checks for conditional typing imports, and refactor core pytest fixtures to NamedTuple-based fixtures for explicit typing.
Bug Fixes:
• Correct Python version checks for conditional imports of TypeAlias, override, StrEnum, and Self across multiple modules
Enhancements:
• Standardize typing.Self usage for class and method return types
• Remove redundant TypeVar declarations in favor of typing.Self
Build:
• Add flake8-pyi plugin to lint ignore list in pyproject.toml
Tests:
• Refactor core pytest fixtures to use NamedTuple classes with precise type annotations and return types
meltano/meltanoGitHub
08/06/2025, 4:14 PMtyping.Self where possible
Pull request ready for review by edgarrmondragon
meltano/meltanoGitHub
08/06/2025, 4:24 PM