From c41dca5512109c91aed13eed68bbe420277b5d12 Mon Sep 17 00:00:00 2001 From: Andrei Date: Tue, 18 Apr 2017 05:25:00 -0700 Subject: [PATCH] Make pynacl optional dependency --- disco/voice/client.py | 5 ++++- requirements-optional.txt | 1 + requirements.txt | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 requirements-optional.txt diff --git a/disco/voice/client.py b/disco/voice/client.py index d0d3e09..0c9ce6c 100644 --- a/disco/voice/client.py +++ b/disco/voice/client.py @@ -3,7 +3,10 @@ import socket import struct import time -import nacl.secret +try: + import nacl.secret +except ImportError: + print 'WARNING: nacl is not installed, voice support is disabled' from holster.enum import Enum from holster.emitter import Emitter diff --git a/requirements-optional.txt b/requirements-optional.txt new file mode 100644 index 0000000..44182d9 --- /dev/null +++ b/requirements-optional.txt @@ -0,0 +1 @@ +pynacl==1.1.2 diff --git a/requirements.txt b/requirements.txt index ed9a25c..a22822d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,3 @@ inflection==0.3.1 requests==2.13.0 six==1.10.0 websocket-client==0.40.0 -pynacl==1.1.2