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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions alpaca_trade_api/polygon/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Refer to PEP 561 for purpose of this file.
# https://www.python.org/dev/peps/pep-0561/
2 changes: 2 additions & 0 deletions alpaca_trade_api/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Refer to PEP 561 for purpose of this file.
# https://www.python.org/dev/peps/pep-0561/
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

@blane-nelson blane-nelson Jan 7, 2022

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.

},
install_requires=REQUIREMENTS,
tests_require=REQUIREMENTS_TEST,
setup_requires=['pytest-runner', 'flake8'],
Expand Down