Changeset 1675589 in git
- Timestamp:
- 2012-03-13T02:42:54Z (13 years ago)
- Branches:
- master
- Children:
- 4e43e1c
- Parents:
- 6b21e80
- git-author:
- Zooko O'Whielacronx <zooko@…> (2012-03-12 02:01:26)
- git-committer:
- Zooko O'Whielacronx <zooko@…> (2012-03-13 02:42:54)
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified .gitignore ¶
r6b21e80 r1675589 5 5 # extraversion.h is generated at build time, and never checked in 6 6 /src-cryptopp/extraversion.h 7 /src/pycryptopp/_version.py 7 8 8 9 # the .egg-info is mostly generated during 'setup.py bdist_egg' .. -
TabularUnified setup.py ¶
r6b21e80 r1675589 247 247 data_files = [(doc_loc, data_fnames)] 248 248 249 commands = versioneer.get_cmdclass().copy()249 commands = {} 250 250 251 251 ###### Version updating code … … 271 271 return normalized_version 272 272 273 def read_version_py(infname): 274 try: 275 verstrline = open(infname, "rt").read() 276 except EnvironmentError: 277 return None 278 else: 279 VSRE = r"^verstr = ['\"]([^'\"]*)['\"]" 280 mo = re.search(VSRE, verstrline, re.M) 281 if mo: 282 return mo.group(1) 283 284 VERSION_BODY = ''' 285 # This is the version of this tree, as created by %(versiontool)s from the darcs patch 286 # information: the main version number is taken from the most recent release 287 # tag. If some patches have been added since the last release, this will have a 288 # -NN "build number" suffix, or else a -rNN "revision number" suffix. Please see 289 # pyutil.version_class for a description of what the different fields mean. 290 291 __pkgname__ = "%(pkgname)s" 292 verstr = "%(pkgversion)s" 293 try: 294 from pyutil.version_class import Version as pyutil_Version 295 __version__ = pyutil_Version(verstr) 296 except (ImportError, ValueError): 297 # Maybe there is no pyutil installed. 298 from distutils.version import LooseVersion as distutils_Version 299 __version__ = distutils_Version(verstr) 300 ''' 273 301 274 302 class UpdateVersion(Command): … … 291 319 "full": versions["full"] }) 292 320 f.close() 293 print "git-version: wrote '%s' into '%s'" % (versions["version"], fn) 321 self.write_version_py(get_normalized_version(), os.path.join('src', 'pycryptopp', '_version.py'), "pycryptopp's setup.py", VERSION_BODY, 'pycryptopp') 322 print "git-version: wrote '%s' into '%s' and '%s'" % (versions["version"], fn, os.path.join('src', 'pycryptopp', '_version.py')) 323 324 def write_version_py(self, verstr, outfname, EXE_NAME, version_body, pkgname): 325 f = open(outfname, "wb+") 326 f.write(version_body % { 327 'versiontool': EXE_NAME, 328 'pkgversion': verstr, 329 'pkgname': pkgname, 330 }) 331 f.close() 332 294 333 commands["update_version"] = UpdateVersion 295 334 … … 318 357 319 358 setup(name=PKG, 320 version= get_normalized_version(),359 version=read_version_py(os.path.join('src', 'pycryptopp', '_version.py')), 321 360 description='Python wrappers for a few algorithms from the Crypto++ library', 322 361 long_description=readmetext, -
TabularUnified src/pycryptopp/__init__.py ¶
r6b21e80 r1675589 2 2 pycryptopp - Python wrappers for Crypto++ 3 3 """ 4 5 def _build_versions():6 from pycryptopp._version import get_versions7 versions = get_versions()8 # versions_from_git (as copied from python-versioneer) returns strings9 # like "1.9.0-25-gb73aba9-dirty", which means we're in a tree with10 # uncommited changes (-dirty), the latest checkin is revision b73aba9,11 # the most recent tag was 1.9.0, and b73aba9 has 25 commits that weren't12 # in 1.9.0 . The narrow-minded NormalizedVersion parser that takes our13 # output (meant to enable sorting of version strings) refuses most of14 # that, but accepts things like "1.9.0.post25", or "1.9.0.post25.dev0",15 # so dumb down our output to match.16 pieces = versions["version"].split("-")17 if len(pieces) == 1:18 normalized_version = pieces[0]19 else:20 normalized_version = "%s.post%s" % (pieces[0], pieces[1])21 if pieces[-1] == "dirty":22 normalized_version += ".dev0"23 # this returns e.g.:24 # 0.5.29.post51,25 # 0.5.29-51-ga81fad1,26 # a81fad1d4afae353a40cf56fe88aa6ef0eea31a827 return versions["version"], normalized_version, versions["full"]28 __real_version__, __version__, __full_version__ = _build_versions()29 del _build_versions30 4 31 5 # we import our glue .so here, and then other modules use the copy in … … 34 8 import _pycryptopp 35 9 __doc__ = _pycryptopp.__doc__ 10 __version__ = _pycryptopp.__version__ 36 11 37 12 def _import_my_names(thismodule, prefix):
Note: See TracChangeset
for help on using the changeset viewer.