Ticket #249: tahoe_ext_deps.patch
File tahoe_ext_deps.patch, 3.5 KB (added by cgalvan, at 2008-08-26T23:18:22Z) |
---|
-
setup.py
25 25 use_setuptools(download_delay=0, min_version="0.6c8") 26 26 27 27 from setuptools import Extension, find_packages, setup 28 from setuptools.command import sdist 28 29 29 30 # Make the dependency-version-requirement, which is used by the Makefile at 30 31 # build-time, also available to the app at runtime: … … 93 94 it remains available even when some of the peers are unavailable, 94 95 malfunctioning, or malicious.""" 95 96 96 miscdeps=os.path.join(os.getcwd(), 'misc', 'dependencies') 97 dependency_links=[os.path.join(miscdeps, t) for t in os.listdir(miscdeps) if t.endswith(".tar")] 97 # For Desert Island builds, assume that the user has extracted the dependency 98 # tarball into a parent directory named 'tahoe_deps'. 99 tahoe_deps = os.path.join(os.path.dirname(os.getcwd()), 'tahoe_deps') 100 dependency_links=[tahoe_deps] 98 101 99 102 # By adding a web page to the dependency_links we are able to put new packages 100 103 # up there and have them be automatically discovered by existing copies of the 101 104 # tahoe source when that source was built. 102 105 dependency_links.append("http://allmydata.org/trac/tahoe/wiki/Dependencies") 103 106 107 # Default setup_requires are pyutil for the Windows installer builder(see 108 # misc/sub-ver.py) and Twisted for the tests. 109 #setup_requires = ['pyutil >= 1.3.16', 'Twisted >= 2.4.0'] 104 110 setup_requires = [] 105 setup_requires.append('pyutil >= 1.3.16') # used by the Windows installer builder, see misc/sub-ver.py106 107 111 # darcsver is needed only if you want "./setup.py darcsver" to write a new 108 112 # version stamp in src/allmydata/_version.py, with a version number derived from 109 113 # darcs history. … … 118 122 if not os.path.exists('PKG-INFO'): 119 123 setup_requires.append('setuptools_darcs >= 1.1.0') 120 124 125 class MySdist(sdist.sdist): 126 """ A hook in the sdist command so that we can determine whether this the 127 tarball should be 'SUMO' or not, i.e. whether or not to include the 128 external dependency tarballs. 129 """ 130 131 # Add our own sumo option to the sdist command, which toggles the 132 # external dependencies being included in the sdist. 133 user_options = sdist.sdist.user_options + \ 134 [('sumo', 's', "create a 'sumo' sdist which includes the external " \ 135 "dependencies")] 136 boolean_options = ['sumo'] 137 138 def initialize_options(self): 139 sdist.sdist.initialize_options(self) 140 self.sumo = None 141 142 def run(self): 143 self.run_command('egg_info') 144 ei_cmd = self.get_finalized_command('egg_info') 145 self.filelist = ei_cmd.filelist 146 self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt')) 147 148 # If '--sumo' wasn't specified in the arguments, do not include 149 # the external dependency tarballs in the sdist. 150 if not self.sumo: 151 self.filelist.exclude_pattern(None, prefix='misc/dependencies') 152 153 print self.filelist.files 154 self.check_readme() 155 self.check_metadata() 156 self.make_distribution() 157 158 dist_files = getattr(self.distribution,'dist_files',[]) 159 for file in self.archive_files: 160 data = ('sdist', '', file) 161 if data not in dist_files: 162 dist_files.append(data) 163 121 164 import _auto_deps 122 165 123 166 setup(name='allmydata-tahoe', … … 128 171 author_email='tahoe-dev@allmydata.org', 129 172 url='http://allmydata.org/', 130 173 license='GNU GPL', 174 cmdclass={'sdist': MySdist}, 131 175 package_dir = {'':'src'}, 132 176 packages=find_packages("src"), 133 177 classifiers=trove_classifiers,