[tor-commits] [ooni-probe/master] Make Beautiful soup a soft depedency

art at torproject.org art at torproject.org
Thu Dec 6 21:39:18 UTC 2012


commit 40da6429be3348ae7a968658419402dba3b79dcc
Author: Arturo Filastò <art at fuffa.org>
Date:   Thu Dec 6 22:36:10 2012 +0100

    Make Beautiful soup a soft depedency
    * Remove un-needed dependencies from requirements.txt
---
 ooni/kit/domclass.py   |    9 +++++++--
 oonib/requirements.txt |   40 +++++++++++++++++-----------------------
 requirements.txt       |    2 --
 3 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/ooni/kit/domclass.py b/ooni/kit/domclass.py
index 1cf33a0..f287f98 100644
--- a/ooni/kit/domclass.py
+++ b/ooni/kit/domclass.py
@@ -28,12 +28,12 @@
 #          resepectively the eigenvalues for the probability matrix A and the
 #          probability matrix B.
 #
-
 import yaml
 import numpy
-from bs4 import BeautifulSoup
 import time
 
+from ooni import log
+
 # All HTML4 tags
 # XXX add link to W3C page where these came from
 alltags = ['A', 'ABBR', 'ACRONYM', 'ADDRESS', 'APPLET', 'AREA', 'B', 'BASE',
@@ -118,6 +118,11 @@ def readDOM(content=None, filename=None, debug=False):
     :filename: the filename to be read from for getting the content of the
                page.
     """
+    try:
+        from bs4 import BeautifulSoup
+    except ImportError:
+        log.err("BeautifulSoup is not installed. This test canno run")
+        raise Exception
 
     if filename:
         f = open(filename)
diff --git a/oonib/requirements.txt b/oonib/requirements.txt
index e84e681..90fece5 100644
--- a/oonib/requirements.txt
+++ b/oonib/requirements.txt
@@ -1,24 +1,18 @@
-BeautifulSoup==3.2.1
-Jinja2==2.6
-PyYAML==3.10
-Pygments==1.5
-Sphinx==1.1.3
-Twisted==12.2.0
-argparse==1.2.1
-cyclone==1.0-rc13
-distribute==0.6.24
-dnspython==1.10.0
-docutils==0.9.1
-ipaddr==2.1.10
-numpy==1.6.2
-pyOpenSSL==0.13
-pygeoip==0.2.5
-repoze.sphinx.autointerface==0.7.1
-https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy
-storm==0.19
-transaction==1.3.0
+PyYAML>=3.10
+Pygments>=1.5
+Twisted>=12.2.0
+argparse>=1.2.1
+cyclone>=1.0-rc13
+distribute>=0.6.24
+docutils>=0.9.1
+ipaddr>=2.1.10
+pyOpenSSL>=0.13
+pygeoip>=0.2.5
+http://hg.secdev.org/scapy/archive/tip.zip#egg=scapy
+storm>=0.19
+transaction>=1.3.0
 txtorcon
-wsgiref==0.1.2
-zope.component==4.0.0
-zope.event==4.0.0
-zope.interface==4.0.1
+wsgiref>=0.1.2
+zope.component>=4.0.0
+zope.event>=4.0.0
+zope.interface>=4.0.1
diff --git a/requirements.txt b/requirements.txt
index ce2e721..1243806 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,7 +1,5 @@
-Jinja2>=2.6
 PyYAML>=3.10
 Pygments>=1.5
-Sphinx>=1.1.3
 Twisted>=12.1.0
 argparse>=1.2.1
 distribute>=0.6.24





More information about the tor-commits mailing list