Skip to content

Commit 1041384

Browse files
committed
Re-organized imports to avoid dependencies check breaking the package install
This fixes issue #7
1 parent 2c204df commit 1041384

File tree

4 files changed

+2
-13
lines changed

4 files changed

+2
-13
lines changed

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include README.md

analytics/__init__.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
11

22
VERSION = '0.3.5'
33

4-
import sys
5-
6-
try:
7-
import requests
8-
except ImportError:
9-
print >>sys.stderr, 'analytics-python requires that you have a Python "requests" library installed. Try running "pip install requests"'
10-
114
import sys
125
this_module = sys.modules[__name__]
136

147
from stats import Statistics
158
stats = Statistics()
16-
17-
from client import Client
18-
199
methods = ['identify', 'track', 'flush', 'on_success', 'on_failure']
2010

21-
2211
def uninitialized(*args, **kwargs):
2312
print >>sys.stderr, 'Please call analytics.init(secret) before calling analytics methods.'
2413

@@ -46,6 +35,7 @@ def init(secret, **kwargs):
4635
enable blocking and making the request on the calling thread.
4736
4837
"""
38+
from client import Client
4939

5040
# if we have already initialized, no-op
5141
if hasattr(this_module, 'default_client'):

analytics/client.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import json
32
import threading
43
import datetime

test.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import unittest
32

43
from datetime import datetime, timedelta

0 commit comments

Comments
 (0)