From: Zooko O'Whielacronx Date: Sat, 22 Dec 2007 17:44:47 +0000 (-0700) Subject: setup: refactor ez_setup.py and setup.py to satisfy the Desert Island scenario, to... X-Git-Tag: allmydata-tahoe-0.7.0~93 X-Git-Url: https://git.rkrishnan.org/pf/content/en/footer/frontends?a=commitdiff_plain;h=c3a265839c3e24590bb1672c2093248a002c7dc0;p=tahoe-lafs%2Ftahoe-lafs.git setup: refactor ez_setup.py and setup.py to satisfy the Desert Island scenario, to find and use setuptools egg in-place in misc/dependencies, and make it setup_require pyutil (for darcsver) --- diff --git a/calcdeps.py b/calcdeps.py index c41f398f..8439bfdc 100644 --- a/calcdeps.py +++ b/calcdeps.py @@ -1,18 +1,18 @@ +import os -import os.path, sys +miscdeps=os.path.join('misc', 'dependencies') +dependency_links=[os.path.join(miscdeps, t) for t in os.listdir(miscdeps) if t.endswith(".tar")] -# 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. +# By adding a web page to the dependency_links we are able to put new packages +# up there and have them be automatically discovered by existing copies of the +# tahoe source when that source was built. +dependency_links.append("http://allmydata.org/trac/tahoe/wiki/Dependencies") -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 +install_requires=["zfec >= 1.0.3", + "foolscap >= 0.2.2", + "simplejson >= 1.4", + "pycryptopp >= 0.2.8", + ] nevow_version = None try: @@ -21,13 +21,6 @@ try: except ImportError: pass -install_requires=["zfec >= 1.0.3", - "foolscap >= 0.2.2", - "simplejson >= 1.4", - "pycryptopp >= 0.2.8", - ] - - # We also require zope.interface, but some older versions of setuptools such # as setuptools v0.6a9 don't handle the "." in its name correctly, and anyway # people have to manually install Twisted before using our automatic diff --git a/misc/dependencies/build-deps-setup.py b/misc/dependencies/build-deps-setup.py index ad5189d1..68612ed7 100644 --- a/misc/dependencies/build-deps-setup.py +++ b/misc/dependencies/build-deps-setup.py @@ -2,18 +2,27 @@ # N.B.: this expects to run from the top of the source tree -import sys +import sys, os + +miscdeps=os.path.join('misc', 'dependencies') + from ez_setup import use_setuptools -if 'cygwin' in sys.platform.lower(): - min_version='0.6c6' +try: + from ez_setup import use_setuptools +except ImportError: + pass else: - # foolscap uses a module-level os.urandom() during import, which - # breaks inside older setuptools' sandboxing. 0.6c4 is the first - # version which fixed this problem. - min_version='0.6c4' -use_setuptools(min_version=min_version, - download_base="file:misc/dependencies/", - download_delay=0) + if 'cygwin' in sys.platform.lower(): + min_version='0.6c6' + else: + # foolscap uses a module-level os.urandom() during import, which + # breaks inside older setuptools' sandboxing. 0.6c4 is the first + # version which fixed this problem. + min_version='0.6c4' + download_base = "file:"+os.path.join('misc', 'dependencies')+os.path.sep + use_setuptools(min_version=min_version, + download_base=download_base, + download_delay=0, to_dir=miscdeps) from setuptools import setup @@ -23,4 +32,5 @@ setup(name='tahoe-deps', version="1", install_requires=install_requires, dependency_links=dependency_links, + zip_safe=False ) diff --git a/setup.py b/setup.py index dddd5e16..6f946cf6 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,9 @@ # http://allmydata.com/. import sys, re, os + +miscdeps=os.path.join('misc', 'dependencies') + try: from ez_setup import use_setuptools except ImportError: @@ -36,7 +39,7 @@ else: download_base = "file:"+os.path.join('misc', 'dependencies')+os.path.sep use_setuptools(min_version=min_version, download_base=download_base, - download_delay=0) + download_delay=0, to_dir=miscdeps) from setuptools import Extension, find_packages, setup @@ -105,7 +108,6 @@ The basic idea is that the data in this storage grid is spread over all participating nodes, using an algorithm that can recover the data even if a majority of the nodes are no longer available.""" - setup(name='allmydata-tahoe', version=verstr, description='secure, distributed storage grid', @@ -120,9 +122,8 @@ setup(name='allmydata-tahoe', test_suite="allmydata.test", install_requires=install_requires, include_package_data=True, - setup_requires=["setuptools_darcs >= 1.0.5",], + setup_requires=['setuptools_darcs >= 1.0.5', 'pyutil >= 1.3.8'], # pyutil is for darcsver dependency_links=dependency_links, entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] }, zip_safe=False, # We prefer unzipped for easier access. - extras_require={'autoversioning':'pyutil >= 1.3.8'}, )