You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build: add Pyright configuration with type safety improvements
Adds Pyright type checking to the project with initial coverage of select
scripts. Configuration uses 'basic' mode for gradual typing adoption.
Scripts included in type checking:
- scripts/generate_gallery_examples.py (new)
- scripts/build_datapackage.py
- scripts/species.py
- scripts/flights.py
- scripts/income.py
- scripts/us-state-capitals.py
Type safety improvements to scripts/species.py (required to pass checks):
- Add TypedDict definitions for configuration structures (FilterItem,
GeographicFilter, ProcessingConfig, Config)
- Add semantic type aliases (ItemId, SpeciesCode, CountyId, FileExtension,
ExactExtractOp) for domain clarity
- Add type guard function is_file_extension() for FileExtension validation
- Improve function signatures with complete type annotations
- Add TYPE_CHECKING block for type-only imports
These changes ensure the build passes with Pyright enabled while improving
code maintainability and IDE support.
0 commit comments