aws / amazon-redshift-python-driver

Redshift Python Connector. It supports Python Database API Specification v2.0.
Apache License 2.0
202 stars 72 forks source link

Allow inline type hints to be packaged and distributed (PEP561) #223

Closed jamesdow21 closed 1 week ago

jamesdow21 commented 1 month ago

Driver version

Redshift version

Client Operating System

Python version

Table schema

Problem description

It looks like this package has type annotations fully specified inline, but mypy doesn't recognize that the type hints can be used without a "py.typed" marker file (as described in PEP561).

  1. Expected behaviour: Mypy recognizes the inline annotations
  2. Actual behaviour: Mypy errors and skips analyzing anything from the package
  3. Error message/stack trace: error: Skipping analyzing "redshift_connector": module is installed, but missing library stubs or py.typed marker [import-untyped]
  4. Any other details that can be helpful: Very simple fix, just need to add a blank file named "py.typed" to the package root and make sure setuptools includes it in the sdist and wheel

Python Driver trace logs

Reproduction code

Brooke-white commented 1 week ago

Hi @jamesdow21 , my apologies for the delay in response for this issue and your PR. Also, thank you for taking the time to open a PR for this issue.