Skip to content

Commit

Permalink
update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
lynxrv21 committed Nov 2, 2023
1 parent 2c09f2a commit f82fcb7
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ style: ## Run code style checks.
@poetry run isort --check --diff .
@echo "🚀 Checking code formatting with black: Running black --check --diff ."
@poetry run black --check --diff .
@echo "🚀 Static type checking: Running mypy -p dream_team_gpt"
@poetry run mypy -p dream_team_gpt


test: ## Test the code with pytest
@echo "🚀 Testing code: Running pytest"
@#poetry run pytest tests/
@poetry run pytest tests/

verify: ## Run style and tests
check
Expand Down
2 changes: 1 addition & 1 deletion dream_team_gpt/clients/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@

class AIClient(ABC):
@abstractmethod
def query(self, transcript: str):
def query(self, transcript: str) -> str:
pass
1 change: 0 additions & 1 deletion dream_team_gpt/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
)
@click.option("-v", "--verbose", default=1, count=True)
def main(idea: str, config: Path = None, verbose: int = 1):

print(idea)
configure_logging(verbose)
load_dotenv()
Expand Down
2 changes: 1 addition & 1 deletion dream_team_gpt/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from loguru import logger


def configure_logging(verbose: int):
def configure_logging(verbose: int = 0) -> None:
logging_levels = {0: "ERROR", 1: "INFO", 2: "DEBUG"}
logger.remove(0)
logger.add(sys.stdout, level=logging_levels.get(verbose))
Expand Down
2 changes: 1 addition & 1 deletion dream_team_gpt/utils/parse_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parse_yaml_config(file_path: Path) -> list[dict]:
return items


def read_yaml(file_path):
def read_yaml(file_path: Path) -> list[dict]:
with open(file_path, "r") as file:
data = yaml.safe_load(file)
return data
2 changes: 1 addition & 1 deletion dream_team_gpt/utils/print_with_wrap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import textwrap


def print_with_wrap(text: str, wrap_length: int = 180):
def print_with_wrap(text: str, wrap_length: int = 180) -> None:
lines = text.split("\n")
for line in lines:
wrapped_text = textwrap.wrap(line, wrap_length)
Expand Down
2 changes: 1 addition & 1 deletion dream_team_gpt/utils/token_counter.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tiktoken


def num_tokens_from_messages(messages, model="gpt-3.5-turbo-0613"):
def num_tokens_from_messages(messages, model="gpt-3.5-turbo-0613") -> int:
"""Return the number of tokens used by a list of messages."""
try:
encoding = tiktoken.encoding_for_model(model)
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ include_trailing_comma = true
use_parentheses = true

[tool.mypy]
disallow_untyped_defs = true
check_untyped_defs = true
disallow_any_unimported = true
disallow_untyped_defs = true
no_implicit_optional = true
check_untyped_defs = true
show_error_codes = true
warn_return_any = true
warn_unused_ignores = true
show_error_codes = true
python_version = 3.11

[tool.pytest.ini_options]
Expand Down

0 comments on commit f82fcb7

Please sign in to comment.