Skip to content

Commit

Permalink
fix: remove termcolor from requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Armstrong committed Sep 18, 2024
1 parent 18e6d4f commit 845a48c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
24 changes: 3 additions & 21 deletions ivy/data_classes/container/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import re
import abc
import copy
import termcolor
import numpy as np
import json

Expand Down Expand Up @@ -107,9 +106,6 @@ def __init__(
default_key_color
The default key color for printing the container to the terminal.
Default is 'green'.
keyword_color_dict
A dict mapping keywords to their termcolor color codes for printing the
container. (Default value = None)
rebuild_child_containers
Whether to rebuild container found in dict_in with these constructor params.
Default is ``False``, in which case the original container are kept as are.
Expand Down Expand Up @@ -3888,12 +3884,9 @@ def _add_newline(str_in):
' "'.join(
sub_str.split(' "')[:-1]
+ [
termcolor.colored(
ivy.Container.cont_trim_key(
sub_str.split(' "')[-1], self._key_length_limit
),
self._default_key_color,
)
ivy.Container.cont_trim_key(
sub_str.split(' "')[-1], self._key_length_limit
),
]
)
if i < split_size - 1
Expand All @@ -3906,20 +3899,9 @@ def _add_newline(str_in):
ret = (
json_dumped_str.replace('"', "")
.replace(", 'shape=', [", " shape=[")
.replace(":", termcolor.colored(":", "magenta"))
.replace("{", termcolor.colored("{", "blue"))
.replace("}", termcolor.colored("}", "blue"))
.replace("shape=", termcolor.colored("shape=", "magenta"))
.replace("device=", termcolor.colored("device=", "magenta"))
.replace("<class'", "<class '")
.replace("'", "")
.replace("<class", "<" + termcolor.colored("class", "blue"))
)
# ToDo: make the solution below more elegant
for i in range(10):
ret = ret.replace(f"diff_{i}", termcolor.colored(f"diff_{i}", "red"))
for keyword, color in self._keyword_color_dict.items():
ret = ret.replace(keyword, termcolor.colored(keyword, color))
return ret
return new_dict

Expand Down
1 change: 0 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ packaging
psutil
requests
ruff
termcolor
tqdm
3 changes: 1 addition & 2 deletions scripts/test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import os
import argparse
import termcolor
import importlib
import faulthandler
from packaging import version
Expand Down Expand Up @@ -144,7 +143,7 @@ def main(filepaths, assert_matching_versions, update_versions):
)
print(PRINT_MSG)
if WARN:
print(termcolor.colored("WARNING\n" + WARN_MSG, "red"))
print("WARNING\n" + WARN_MSG)
if ERROR:
raise Exception(ERROR_MSG)

Expand Down

0 comments on commit 845a48c

Please sign in to comment.