Skip to content

Commit

Permalink
Merge pull request #443 from lukpueh/rm-colorama
Browse files Browse the repository at this point in the history
Remove colorama optional dependency
  • Loading branch information
lukpueh authored Oct 26, 2022
2 parents 600aca1 + bbf51bc commit 7252e60
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 17 deletions.
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

0 comments on commit 7252e60

Please sign in to comment.