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

Remove colorama optional dependency #443

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion requirements-pinned.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
cffi==1.15.1 # via cryptography, pynacl
colorama==0.4.5
cryptography==38.0.2
pycparser==2.21 # via cffi
pynacl==1.5.0
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@
#
cryptography >= 37.0.0; python_version >= '3'
pynacl
colorama
16 changes: 2 additions & 14 deletions securesystemslib/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@

logger = logging.getLogger(__name__)

try:
from colorama import Fore

TERM_RED = Fore.RED
TERM_RESET = Fore.RESET
except ImportError: # pragma: no cover
logger.debug(
"Failed to find colorama module, terminal output won't be colored"
)
TERM_RED = ""
TERM_RESET = ""

# Recommended RSA key sizes:
# https://en.wikipedia.org/wiki/Key_size#Asymmetric_algorithm_key_lengths
# Based on the above, RSA keys of size 3072 bits are expected to provide
Expand Down Expand Up @@ -115,7 +103,7 @@ def _get_key_file_encryption_password(password, prompt, path):
if prompt:
password = get_password(
"enter password to encrypt private key file "
"'" + TERM_RED + str(path) + TERM_RESET + "' (leave empty if key "
"'" + str(path) + "' (leave empty if key "
"should not be encrypted): ",
confirm=True,
)
Expand Down Expand Up @@ -162,7 +150,7 @@ def _get_key_file_decryption_password(password, prompt, path):
if prompt:
password = get_password(
"enter password to decrypt private key file "
"'" + TERM_RED + str(path) + TERM_RESET + "' "
"'" + str(path) + "' "
"(leave empty if key not encrypted): ",
confirm=False,
)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
},
python_requires="~=3.7",
extras_require={
"colors": ["colorama>=0.3.9"],
"crypto": ["cryptography>=37.0.0"],
"pynacl": ["pynacl>1.2.0"],
},
Expand Down