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

Make colorama dependency optional #1180

Merged
merged 2 commits into from
Oct 21, 2020
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
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