Skip to content

Conversation

webknjaz
Copy link
Member

@webknjaz webknjaz commented Sep 6, 2025

No description provided.

@webknjaz webknjaz self-assigned this Sep 6, 2025
@webknjaz webknjaz added enhancement New feature or request help wanted Extra attention is needed labels Sep 6, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces comprehensive type annotations to enforce type safety across the codebase using MyPy. It adds MyPy configuration for multiple Python versions (3.11-3.13) and creates type definitions to ensure proper type checking.

  • Adds explicit return type annotations (-> None) to functions that were missing them
  • Introduces TypedDict classes to define structured types for JSON data handling
  • Replaces os.getenv() with os.environ[] for required environment variables to improve type safety

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
print-pkg-names.py Adds return type annotation to debug function
oidc-exchange.py Comprehensive type annotations including TypedDict definitions and improved null handling
attestations.py Adds null check for OIDC token detection and environment variable access
_type_stubs/id.pyi Creates type stub file for the id module
.pre-commit-config.yaml Configures MyPy pre-commit hooks for Python 3.11-3.13
.mypy.ini Adds comprehensive MyPy configuration with strict type checking

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@webknjaz webknjaz marked this pull request as ready for review September 8, 2025 12:56
@webknjaz
Copy link
Member Author

webknjaz commented Sep 8, 2025

@woodruffw could you take a look? Specifically, I'm interested in possible runtime side effects. If there's no problems at runtime, I'll merge right away.

@woodruffw
Copy link
Member

Sure, I can look later today 🙂

@webknjaz
Copy link
Member Author

webknjaz commented Sep 8, 2025

@woodruffw thanks!

Copy link
Member

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- I did a pass for side effects and don't see any.

@webknjaz webknjaz enabled auto-merge September 10, 2025 14:05
@webknjaz webknjaz merged commit ab69e43 into pypa:unstable/v1 Sep 11, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants