Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing type hint py.typed files. #403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blane-nelson
Copy link

@blane-nelson blane-nelson commented Mar 21, 2021

In order for utilities like MyPy to take advantage of the type hints in the package. There needs to be a py.typed file installed with the package and modules as per PEP 561

@@ -35,6 +35,10 @@
'alpaca_trade_api',
'alpaca_trade_api.polygon',
],
package_data={
'alpaca_trade_api': ['py.typed'],
'alpaca_trade_api.polygon': ['py.typed'],
Copy link
Contributor

@haxdds haxdds Nov 18, 2021

Choose a reason for hiding this comment

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

Hi blane-Nelson, thanks for contributing!

Why have you added a py.typed file for alpaca_trade_api.polygon package? What is the purpose?

Copy link
Author

Choose a reason for hiding this comment

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

This file lets utilities (like MyPy) know that the package is using the new typing library. The files doesn't need to contain anything, it just has to be present in the package's root folder. Refer to the PEP 561 - https://www.python.org/dev/peps/pep-0561/ on python.org for a full explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants