]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
setup.py: factor out dependency stuff, add workaround for nevow-0.6.0-on-dapper problem
authorBrian Warner <warner@lothar.com>
Sat, 15 Sep 2007 22:05:35 +0000 (15:05 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 15 Sep 2007 22:05:35 +0000 (15:05 -0700)
README
calcdeps.py [new file with mode: 0644]
misc/dependencies/build-deps-setup.py
setup.py

diff --git a/README b/README
index f4c3cd3b58188f4ab61eac179827a8e57abf7731..dc1c8bb2dfc853b7153615c36dfbed043b2284e0 100644 (file)
--- a/README
+++ b/README
@@ -69,8 +69,8 @@ gcc make python-dev python-twisted python-nevow python-pyopenssl".
 
    http://python.org/
 
- + Python Twisted (tested against both 2.4 and 2.5) (network and operating
-   system integration library)
+ + Twisted Python (tested against 2.2.0, 2.4.0, and 2.5.0) (network and
+   operating system integration library)
 
    http://twistedmatrix.com/
 
@@ -81,12 +81,16 @@ gcc make python-dev python-twisted python-nevow python-pyopenssl".
    * web, trial, conch
 
    Twisted requires zope.interface, a copy of which is included in the
-   Twisted distribution.
+   Twisted distribution. Note that Twisted does *not* require the entire Zope
+   distribution, merely the much smaller zope.interface component.
 
- + Python Nevow (0.9.18 or later) (web presentation language)
+ + Python Nevow (0.6.0 or later) (web presentation language)
 
    http://divmod.org/trac/wiki/DivmodNevow
 
+   Note that the current version of Nevow (0.9.18) requires Twisted 2.4.0 or
+   later.
+
  + Python setuptools (build and distribution tool)
 
    Note: The build process will automatically download and install setuptools
diff --git a/calcdeps.py b/calcdeps.py
new file mode 100644 (file)
index 0000000..4537581
--- /dev/null
@@ -0,0 +1,52 @@
+
+import os.path
+
+# This form is used when the unpacked source distribution is copied into our
+# tree:
+#  "file:misc/dependencies/zfec-1.0.2/"
+# and this form is used when we provide a tarball
+#  "file:misc/dependencies/zfec-1.0.2.tar.gz",
+# The file: URL can start with either 'misc' or './misc' to get a relative path.
+
+dependency_tarballs=[ "file:" + os.path.join("misc", "dependencies", fn)
+                      for fn in os.listdir(os.path.join("misc", "dependencies"))
+                      if fn.endswith(".tar.gz") ]
+
+dependency_links=["http://allmydata.org/trac/tahoe/wiki/Dependencies"] + dependency_tarballs
+
+nevow_version = None
+try:
+    import nevow
+    nevow_version = nevow.__version__
+except ImportError:
+    pass
+
+install_requires=["zfec >= 1.0.3",
+                  "foolscap >= 0.1.6",
+                  "simplejson >= 1.4",
+                  ]
+
+# Ubuntu Dapper includes nevow-0.6.0 and twisted-2.2.0, both of which work.
+# However, setuptools doesn't know about them, so our install_requires=
+# dependency upon nevow causes our 'build-deps' step to try and build the
+# latest version (nevow-0.9.18), which *doesn't* work with twisted-2.2.0 . To
+# work around this, remove nevow from our dependency list if we detect that
+# we've got nevow-0.6.0 installed. This will allow build-deps (and everything
+# else) to work on dapper systems that have the python-nevow package
+# installed, and shouldn't hurt any other systems. Dapper systems *without*
+# python-nevow will try to build it (and will fail unless they also have a
+# newer version of Twisted installed).
+
+if nevow_version != "0.6.0":
+    install_requires.append("nevow >= 0.6.0")
+
+
+if __name__ == '__main__':
+    print "install_requires:"
+    for ir in install_requires:
+        print " ", ir
+    print
+    print "dependency_links:"
+    for dl in dependency_links:
+        print " ", dl
+    print
index 3b123742449e9712933c275312bacfd688d4fe4e..d9692b9d6e95c9ca0c8276320ff838d51aade94f 100644 (file)
@@ -12,17 +12,10 @@ use_setuptools(min_version=min_version, download_base="file:misc/dependencies/")
 
 from setuptools import setup
 
-dependency_tarballs=[ os.path.join("misc", "dependencies", fn)
-                      for fn in os.listdir(os.path.join("misc", "dependencies"))
-                      if fn.endswith(".tar.gz") ]
-dependency_links=["http://allmydata.org/trac/tahoe/wiki/Dependencies"] + dependency_tarballs
+from calcdeps import install_requires, dependency_links
 
 setup(name='tahoe-deps',
       version="1",
-      install_requires=["zfec >= 1.0.3",
-                        "foolscap >= 0.1.6",
-                        "simplejson >= 1.4",
-                        "nevow",
-                        ],
+      install_requires=install_requires,
       dependency_links=dependency_links,
       )
index 3dec614f8dffa88b2ed5875b495fadc0a912c9fa..0b6accb67929865d0f9230cfa1b63d3f77634e7a 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,8 @@ use_setuptools(min_version=min_version, download_base="file:misc/dependencies/")
 from setuptools import Extension, setup
 import re, os.path
 
+from calcdeps import install_requires, dependency_links
+
 trove_classifiers=[
     "Development Status :: 3 - Alpha", 
     "Environment :: Console",
@@ -85,19 +87,6 @@ participating nodes, using an algorithm that can recover the data even if a
 majority of the nodes are no longer available."""
 
 
-# This form is used when the unpacked source distribution is copied into our
-# tree:
-#  "file:misc/dependencies/zfec-1.0.2/"
-# and this form is used when we provide a tarball
-#  "file:misc/dependencies/zfec-1.0.2.tar.gz",
-# The file: URL can start with either 'misc' or './misc' to get a relative path.
-
-dependency_tarballs=[ "file:" + os.path.join("misc", "dependencies", fn)
-                      for fn in os.listdir(os.path.join("misc", "dependencies"))
-                      if fn.endswith(".tar.gz") ]
-
-dependency_links=["http://allmydata.org/trac/tahoe/wiki/Dependencies"] + dependency_tarballs
-
 setup(name='allmydata-tahoe',
       version=verstr,
       description='secure, distributed storage grid',
@@ -117,11 +106,7 @@ setup(name='allmydata-tahoe',
       package_data={ 'allmydata': ['web/*.xhtml', 'web/*.html', 'web/*.css'] },
       classifiers=trove_classifiers,
       test_suite="allmydata.test",
-      install_requires=["zfec >= 1.0.3",
-                        "foolscap >= 0.1.6",
-                        "simplejson >= 1.4",
-                        "nevow",
-                        ],
+      install_requires=install_requires,
       dependency_links=dependency_links,
       ext_modules=[
           Extension("allmydata.Crypto.Cipher.AES",