Skip to content

Commit

Permalink
Merge pull request #1180 from joshuagl/joshuagl/nocolour
Browse files Browse the repository at this point in the history
Make colorama dependency optional
  • Loading branch information
joshuagl authored Oct 21, 2020
2 parents f2366d5 + eb00d14 commit b570723
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions requirements-pinned.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
certifi==2020.6.20 # via requests
cffi==1.14.3 # via cryptography, pynacl
chardet==3.0.4 # via requests
colorama==0.4.3 # via securesystemslib
cryptography==3.1.1 # via securesystemslib
enum34==1.1.6 ; python_version < '3' # via cryptography
idna==2.10 # via requests
Expand All @@ -10,7 +9,7 @@ pycparser==2.20 # via cffi
pynacl==1.4.0 # via securesystemslib
python-dateutil==2.8.1 # via securesystemslib
requests==2.24.0
securesystemslib[colors,crypto,pynacl]==0.16.0
securesystemslib[crypto,pynacl]==0.16.0
six==1.15.0
subprocess32==3.5.4 ; python_version < '3' # via securesystemslib
urllib3==1.25.10 # via requests
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
# 3. Use this command to remove per-version files
# `rm requirements-?.?.txt`
#
securesystemslib[colors, crypto, pynacl]
securesystemslib[crypto, pynacl]
requests
six
8 changes: 4 additions & 4 deletions tuf/scripts/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Note:
'pip install securesystemslib[crypto,pynacl]' is required by the CLI,
which installs the 3rd-party dependencies: cryptography, pynacl, and colorama.
which installs the 3rd-party dependencies: cryptography and pynacl.
<Usage>
Note: arguments within brackets are optional.
Expand Down Expand Up @@ -153,9 +153,9 @@
import tuf.repository_tool as repo_tool

# 'pip install securesystemslib[crypto,pynacl]' is required for the CLI,
# which installs the cryptography, pynacl, and colorama dependencies.
# which installs the cryptography and pynacl.
import securesystemslib
from colorama import Fore
from securesystemslib import interface
import six


Expand Down Expand Up @@ -428,7 +428,7 @@ def import_privatekey_from_file(keypath, password=None):
# However, care should be taken when including the full path in exceptions
# and log files.
password = securesystemslib.interface.get_password('Enter a password for'
' the encrypted key (' + Fore.RED + repr(keypath) + Fore.RESET + '): ',
' the encrypted key (' + interface.TERM_RED + repr(keypath) + interface.TERM_RED + '): ',
confirm=False)

# Does 'password' have the correct format?
Expand Down

0 comments on commit b570723

Please sign in to comment.