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 1 commit
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
Prev Previous commit
mypy
  • Loading branch information
Borda committed Dec 8, 2020
commit c693eb26bc79a87ceba47e67bd5642777f9865e4
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__: bool
_ = 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
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