Skip to content

Commit ab5a076

Browse files
committed
Add annotations to __init__
1 parent a0cd842 commit ab5a076

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

stagpy/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,26 @@
1616
and uppercase versions of those.
1717
"""
1818

19+
from __future__ import annotations
1920
import importlib
2021
import os
2122
import pathlib
2223
import shutil
2324
import signal
2425
import sys
26+
import typing
2527

2628
from pkg_resources import get_distribution, DistributionNotFound
2729
from setuptools_scm import get_version
2830
from loam.manager import ConfigurationManager
2931

3032
from . import config
3133

34+
if typing.TYPE_CHECKING:
35+
from typing import Any
3236

33-
def _env(var):
37+
38+
def _env(var: str) -> bool:
3439
"""Return whether var is set to True."""
3540
val = os.getenv(var, default='').lower()
3641
return val in ('true', 't', 'yes', 'y', 'on', '1')
@@ -69,7 +74,7 @@ def _check_config():
6974

7075
def load_mplstyle():
7176
"""Try to load conf.plot.mplstyle matplotlib style."""
72-
plt = importlib.import_module('matplotlib.pyplot')
77+
plt: Any = importlib.import_module('matplotlib.pyplot')
7378
if conf.plot.mplstyle:
7479
for style in conf.plot.mplstyle.split():
7580
found = False

0 commit comments

Comments
 (0)