Skip to content

Commit

Permalink
apply flake8 and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
hmasdev committed Sep 7, 2024
1 parent d23172c commit a2013aa
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@pytest.fixture(scope='session', autouse=True)
def api_keys():
for envvar in SERVICE_APIKEY_ENVVAR_MAP.values():
os.environ[envvar] = os.getenv(envvar)
os.environ[envvar] = os.getenv(envvar) or '' # type: ignore
load_dotenv()
yield
1 change: 0 additions & 1 deletion werewolf/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class EChatService(Enum):
'gemini-1.5-flash': EChatService.Google,
"gemini-pro-vision": EChatService.Google,
'gemini-pro': EChatService.Google,
'mixtral-8x7b-32768': EChatService.Groq,
'gemma2-9b-it': EChatService.Groq,
'gemma2-7b-it': EChatService.Groq,
'llama3-groq-70b-8192-tool-use-preview': EChatService.Groq,
Expand Down
2 changes: 1 addition & 1 deletion werewolf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def main(
'model': model,
'api_type': service.value,
# FIXME: this is not good because the raw token is on memory
'api_key': os.getenv(SERVICE_APIKEY_ENVVAR_MAP[service]),
'api_key': os.getenv(SERVICE_APIKEY_ENVVAR_MAP[service]), # type: ignore # noqa
}]

result = game(
Expand Down
2 changes: 1 addition & 1 deletion werewolf/utils/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ..utils.utils import deprecate


@deprecate(msg='Use werewolf.chat_models.create_chat_model instead.')
@deprecate(msg='Use werewolf.chat_models.create_chat_model instead.') # type: ignore # noqa
@lru_cache(maxsize=None)
def create_chat_openai_model(
llm: ChatOpenAI | str | None = None,
Expand Down
4 changes: 2 additions & 2 deletions werewolf/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def deprecate(
logger: Logger = getLogger(__name__),
) -> (
Callable[[InputType], OutputType]
| Callable[[Callable[[InputType], OutputType]], Callable[[InputType], OutputType]]
| Callable[[Callable[[InputType], OutputType]], Callable[[InputType], OutputType]] # noqa
):
"""Decorator to deprecate a function.
Expand All @@ -72,7 +72,7 @@ def deprecate(
""" # noqa

if func is None:
return partial(deprecate, msg=msg, logger=logger)
return partial(deprecate, msg=msg, logger=logger) # type: ignore

def wrapper(*args, **kwargs):
if hasattr(func, '__name__'):
Expand Down

0 comments on commit a2013aa

Please sign in to comment.