Changeset 19b2ef9 in trunk
- Timestamp:
- 2013-03-19T23:07:22Z (12 years ago)
- Branches:
- master
- Children:
- 8b144fa1
- Parents:
- 9e449db
- git-author:
- Brian Warner <warner@…> (2013-03-19 22:26:21)
- git-committer:
- Brian Warner <warner@…> (2013-03-19 23:07:22)
- Files:
-
- 14 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified MANIFEST.in ¶
r9e449db r19b2ef9 1 1 include COPYING.GPL COPYING.TGPPL.rst CREDITS Makefile NEWS.rst Tahoe.home 2 include relnotes.txt .darcs-boringfile2 include relnotes.txt 3 3 include bin/tahoe-script.template 4 4 recursive-include src *.xhtml *.js *.png *.css … … 7 7 graft misc 8 8 graft static 9 graft darcsver-1.7.2.egg10 9 11 10 graft setuptools-0.6c16dev4.egg -
TabularUnified setup.cfg ¶
r9e449db r19b2ef9 15 15 16 16 # https://tahoe-lafs.org/source/tahoe-lafs/deps/tahoe-deps.tar.gz contains a 17 # bundle of these dependencies (as Python source distributions or "sdists"). So 18 # it you want to avoid the build-time download (say, if you're on an airplane, 19 # or a desert island), just grab a copy and unpack it in your tahoe darcs tree. 17 # bundle of these dependencies (as Python source distributions or "sdists"). 18 # So it you want to avoid the build-time download (say, if you're on an 19 # airplane, or a desert island), just grab a copy and unpack it in your tahoe 20 # source tree. 20 21 21 22 # Alternatively, if you're building from a release/nightly tarball instead of 22 # a darcstree, the 'sumo' tarball variant will include all of these23 # a git tree, the 'sumo' tarball variant will include all of these 23 24 # dependencies in the tahoe-deps/ directory. 24 25 -
TabularUnified setup.py ¶
r9e449db r19b2ef9 72 72 73 73 egg = os.path.realpath(glob.glob('setuptools-*.egg')[0]) 74 sys.path.insert(0, egg)75 egg = os.path.realpath(glob.glob('darcsver-*.egg')[0])76 74 sys.path.insert(0, egg) 77 75 import setuptools; setuptools.bootstrap_install_from = egg … … 121 119 setup_requires = [] 122 120 123 # The darcsver command from the darcsver plugin is needed to initialize the124 # distribution's .version attribute correctly. (It does this either by125 # examining darcs history, or if that fails by reading the126 # src/allmydata/_version.py file). darcsver will also write a new version127 # stamp in src/allmydata/_version.py, with a version number derived from128 # darcs history. Note that the setup.cfg file has an "[aliases]" section129 # which enumerates commands that you might run and specifies that it will run130 # darcsver before each one. If you add different commands (or if I forgot131 # some that are already in use), you may need to add it to setup.cfg and132 # configure it to run darcsver before your command, if you want the version133 # number to be correct when that command runs.134 # http://pypi.python.org/pypi/darcsver135 setup_requires.append('darcsver >= 1.7.2')136 137 121 # Nevow imports itself when building, which causes Twisted and zope.interface 138 122 # to be imported. We need to make sure that the versions of Twisted and … … 256 240 raise 257 241 258 259 DARCS_VERSION_BODY = '''260 # This _version.py is generated from darcs metadata by the tahoe setup.py261 # and the "darcsver" package.262 263 __pkgname__ = "%(pkgname)s"264 verstr = "%(pkgversion)s"265 __version__ = verstr266 '''267 242 268 243 GIT_VERSION_BODY = ''' … … 344 319 return {"version": version, "normalized": normalized_version, "full": full} 345 320 321 # setup.cfg has an [aliases] section which runs "update_version" before many 322 # commands (like "build" and "sdist") that need to know our package version 323 # ahead of time. If you add different commands (or if we forgot some), you 324 # may need to add it to setup.cfg and configure it to run update_version 325 # before your command. 346 326 347 327 class UpdateVersion(Command): … … 354 334 pass 355 335 def run(self): 356 target = self.distribution.versionfiles[0] 357 if os.path.isdir(os.path.join(basedir, "_darcs")): 358 verstr = self.try_from_darcs(target) 359 elif os.path.isdir(os.path.join(basedir, ".git")): 360 verstr = self.try_from_git(target) 336 if os.path.isdir(os.path.join(basedir, ".git")): 337 verstr = self.try_from_git() 361 338 else: 362 339 print("no version-control data found, leaving _version.py alone") … … 365 342 self.distribution.metadata.version = verstr 366 343 367 def try_from_darcs(self, target): 368 from darcsver.darcsvermodule import update 369 (rc, verstr) = update(pkgname=self.distribution.get_name(), 370 verfilename=self.distribution.versionfiles, 371 revision_number=True, 372 version_body=DARCS_VERSION_BODY) 373 if rc == 0: 374 return verstr 375 376 def try_from_git(self, target): 344 def try_from_git(self): 377 345 versions = versions_from_git("allmydata-tahoe-", verbose=True) 378 346 if versions: 379 f or fn in self.distribution.versionfiles:380 381 382 383 384 385 386 387 347 fn = 'src/allmydata/_version.py' 348 f = open(fn, "wb") 349 f.write(GIT_VERSION_BODY % 350 { "pkgname": self.distribution.get_name(), 351 "version": versions["version"], 352 "normalized": versions["normalized"], 353 "full": versions["full"] }) 354 f.close() 355 print("git-version: wrote '%s' into '%s'" % (versions["version"], fn)) 388 356 return versions.get("normalized", None) 389 357 … … 480 448 entry_points = { 'console_scripts': [ 'tahoe = allmydata.scripts.runner:run' ] }, 481 449 zip_safe=False, # We prefer unzipped for easier access. 482 versionfiles=['src/allmydata/_version.py',],483 450 **setup_args 484 451 ) -
TabularUnified src/allmydata/test/test_runner.py ¶
r9e449db r19b2ef9 155 155 self.failIfEqual(required_verstr, "unknown", 156 156 "We don't know our version, because this distribution didn't come " 157 "with a _version.py and 'setup.py darcsver' hasn't been run.")157 "with a _version.py and 'setup.py update_version' hasn't been run.") 158 158 159 159 srcdir = os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
Note: See TracChangeset
for help on using the changeset viewer.