Repository: spotify/luigi

Issue:
Some Docs Have Disappeared
Not sure if this is the right place to report this, but it looks like package documentation has disappeared from readthedocs.  For example:

http://luigi.readthedocs.org/en/latest/api/luigi.html#luigi-file-module

I swear there used to be a lot of useful information here, now there is nothing.



Discussion:
There seems to be an issue with the pyparsing import https://readthedocs.org/builds/luigi/1925033/ Luigi doesn't list any dependencies in setup.py, which I think is wrong.

We should really remove that pyparsing-depending stuff, but until then – how do I make sure RTD knows that it should use pyparsing?


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -17,26 +17,8 @@
 
 try:
     from setuptools import setup
-    from setuptools.command.test import test as TestCommand
 except:
     from distutils.core import setup
-    from distutils.cmd import Command as TestCommand
-
-
-class Tox(TestCommand):
-    user_options = [('tox-args=', None, "Arguments to pass to tox")]
-    def initialize_options(self):
-        TestCommand.initialize_options(self)
-        self.tox_args = ''
-    def finalize_options(self):
-        TestCommand.finalize_options(self)
-        self.test_args = []
-        self.test_suite = True
-    def run_tests(self):
-        #import here, cause outside the eggs aren't loaded
-        import tox
-        errno = tox.cmdline(args=self.tox_args.split())
-        sys.exit(errno)
 
 
 def get_static_files(path):
@@ -57,6 +39,18 @@ def get_static_files(path):
 with open('README.rst') as fobj:
     long_description = readme_note + fobj.read()
 
+install_requires = [
+    'boto',
+    'pyparsing',
+    'requests',
+    'sqlalchemy',
+    'tornado',
+    'whoops',
+    'snakebite>=2.4.10',
+]
+
+if sys.version_info[:2] < (2, 7):
+    install_requires.extend(['argparse', 'ordereddict'])
 
 setup(
     name='luigi',
@@ -79,6 +73,5 @@ def get_static_files(path):
         'bin/luigid',
         'bin/luigi'
     ],
-    tests_require=['tox', 'virtualenv'],
-    cmdclass={'test': Tox},
+    install_requires=install_requires,
 )


Test patch:
diff --git a/test/hdfs_test.py b/test/hdfs_test.py
--- a/test/hdfs_test.py
+++ b/test/hdfs_test.py
@@ -16,7 +16,6 @@
 from calendar import timegm
 from datetime import datetime
 import getpass
-import unittest2
 import luigi
 from luigi import hdfs
 import mock
@@ -25,13 +24,17 @@
 from nose.plugins.attrib import attr
 from snakebite.minicluster import MiniCluster
 
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
 
 class TestException(Exception):
     pass
 
 
 @attr('minicluster')
-class HdfsTestCase(unittest2.TestCase):
+class HdfsTestCase(unittest.TestCase):
     cluster = None
 
     @classmethod
@@ -725,7 +728,7 @@ def test_apache1_client(self, popen):
         self.assertRaises(luigi.hdfs.HDFSCliError, apache_client.exists, "/some/path/somewhere")
 
 if __name__ == "__main__":
-    unittest2.main()
+    unittest.main()
     # Uncomment to run a single test
     # unittest.TextTestRunner(failfast=True, verbosity=2).run(suite())
 
diff --git a/test/requirements.txt b/test/requirements.txt
--- a/test/requirements.txt
+++ b/test/requirements.txt
@@ -1,12 +1,3 @@
-argparse==1.2.1
-boto==2.19.0
-mock==1.0.1
-moto==0.3.6
-nose==1.3.0
-ordereddict==1.1
-pyparsing==2.0.2
-requests==2.1.0
-sqlalchemy==0.9.7
-tornado==3.1.1
-whoops==0.2.1
-wsgiref==0.1.2
+mock
+moto
+nose
diff --git a/test/snakebite_test.py b/test/snakebite_test.py
--- a/test/snakebite_test.py
+++ b/test/snakebite_test.py
@@ -2,7 +2,6 @@
 import os
 import posixpath
 import time
-import unittest2
 import luigi.hdfs
 import luigi.interface
 from luigi.hdfs import SnakebiteHdfsClient
@@ -10,9 +9,14 @@
 from nose.plugins.attrib import attr
 from snakebite.minicluster import MiniCluster
 
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
+
 
 @attr('minicluster')
-class TestSnakebiteClient(unittest2.TestCase):
+class TestSnakebiteClient(unittest.TestCase):
     """This test requires a snakebite -- it finds it from your
     client.cfg"""
     snakebite = None