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

Add type annotations to pl_bolts/__init__.py #435

Merged
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: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
PATH_ROOT = os.path.join(PATH_HERE, '..', '..')
sys.path.insert(0, os.path.abspath(PATH_ROOT))

builtins.__LIGHTNING_BOLT_SETUP__ = True
builtins.__LIGHTNING_BOLT_SETUP__: bool = True

SPHINX_MOCK_REQUIREMENTS = int(os.environ.get('SPHINX_MOCK_REQUIREMENTS', True))

Expand Down
4 changes: 2 additions & 2 deletions pl_bolts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
try:
# This variable is injected in the __builtins__ by the build process.
# It used to enable importing subpackages when the binaries are not built.
__LIGHTNING_BOLT_SETUP__
_ = None if __LIGHTNING_BOLT_SETUP__ else None
except NameError:
__LIGHTNING_BOLT_SETUP__ = False
__LIGHTNING_BOLT_SETUP__: bool = False

if __LIGHTNING_BOLT_SETUP__:
import sys # pragma: no-cover
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ files = pl_bolts, tests
disallow_untyped_defs = True
ignore_missing_imports = True

[mypy-pl_bolts.*]
ignore_errors = True

[mypy-pl_bolts.callbacks.*]
ignore_errors = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# http://blog.ionelmc.ro/2014/05/25/python-packaging/

PATH_ROOT = os.path.dirname(__file__)
builtins.__LIGHTNING_BOLT_SETUP__ = True
builtins.__LIGHTNING_BOLT_SETUP__: bool = True

import pl_bolts # noqa: E402

Expand Down