[tahoe-lafs-trac-stream] [tahoe-lafs] #1387: version parser refuses to recognize foolscap's "in between releases" versions

tahoe-lafs trac at tahoe-lafs.org
Thu Mar 31 22:47:50 PDT 2011


#1387: version parser refuses to recognize foolscap's "in between releases"
versions
-------------------------------------------+--------------------------------
 Reporter:  zooko                          |           Owner:  somebody 
     Type:  defect                         |          Status:  new      
 Priority:  major                          |       Milestone:  undecided
Component:  packaging                      |         Version:  1.8.2    
 Keywords:  packaging setuptools foolscap  |   Launchpad Bug:           
-------------------------------------------+--------------------------------
 If you install foolscap from its source, it will have a version number
 like {{{0.6.1+}}}. If you then run Tahoe-LAFS, it will exit at startup
 with:
 {{{
 Traceback (most recent call last):
   File "/Users/zooko/playground/tahoe-lafs/pristine/support/bin/tahoe",
 line 9, in <module>
     load_entry_point('allmydata-tahoe==1.8.2-r5006', 'console_scripts',
 'tahoe')()
   File "/Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6
 /site-packages/setuptools-0.6c16dev3.egg/pkg_resources.py", line 318, in
 load_entry_point
     return get_distribution(dist).load_entry_point(group, name)
   File "/Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6
 /site-packages/setuptools-0.6c16dev3.egg/pkg_resources.py", line 2245, in
 load_entry_point
     return ep.load()
   File "/Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6
 /site-packages/setuptools-0.6c16dev3.egg/pkg_resources.py", line 1978, in
 load
     entry = __import__(self.module_name, globals(),globals(),
 ['__name__'])
   File "/Users/zooko/playground/tahoe-
 lafs/pristine/src/allmydata/__init__.py", line 375, in <module>
     check_all_requirements()
   File "/Users/zooko/playground/tahoe-
 lafs/pristine/src/allmydata/__init__.py", line 373, in
 check_all_requirements
     raise PackagingError(get_error_string(errors, debug=True))
 allmydata.PackagingError:
 TypeError: expected string or buffer

 For debugging purposes, the PYTHONPATH was
   '/Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages:/usr/local/lib/python2.6/site-packages:/Users/zooko/lib/python2.6
 /site-packages'
 install_requires was
   ['setuptools >= 0.6c6', 'zfec >= 1.1.0', 'simplejson >= 1.4',
 'zope.interface', 'Twisted >= 2.4.0', 'foolscap[secure_connections] >=
 0.6.1', 'Nevow >= 0.6.0', 'pycrypto == 2.0.1, == 2.1.0, >= 2.3', 'pyasn1
 >= 0.0.8a', 'mock', 'pycryptopp >= 0.5.20']
 sys.path after importing pkg_resources was
   /Users/zooko/playground/tahoe-lafs/pristine/support/bin:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/setuptools_darcs-1.2.12.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/src:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/mock-0.6.0-py2.6.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/pyasn1-0.0.13b-py2.6.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/pycrypto-2.3-py2.6-macosx-10.6-universal.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/Nevow-0.10.0-py2.6.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/simplejson-2.1.3-py2.6-macosx-10.6-universal.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/zfec-1.4.10-py2.6-macosx-10.6-universal.egg:
   /Library/Python/2.6/site-packages/foolscap-0.6.1_-py2.6.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages/setuptools-0.6c16dev3.egg:
   /Library/Python/2.6/site-packages/argparse-1.1-py2.6.egg:
   /Library/Python/2.6/site-packages/pexpect-2.4-py2.6.egg:
   /Library/Python/2.6/site-packages/zbase32-1.1.3-py2.6.egg:
   /Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg:
   /Library/Python/2.6/site-packages/setuptools_darcs-1.2.11-py2.6.egg:
   /Library/Python/2.6/site-
 packages/pycryptopp-0.5.29-py2.6-macosx-10.6-universal.egg:
   /Library/Python/2.6/site-
 packages/Twisted-10.2.0-py2.6-macosx-10.6-universal.egg:
   /Library/Python/2.6/site-packages/pyutil-1.8.4-py2.6.egg:
   /Library/Python/2.6/site-
 packages/coverage-3.4-py2.6-macosx-10.6-universal.egg:
   /Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg:
   /Library/Python/2.6/site-packages/txAWS-0.0.1-py2.6.egg:
   /Library/Python/2.6/site-packages/Epsilon-0.6.0-py2.6.egg:
   /Users/zooko/playground/tahoe-lafs/pristine/support/lib/python2.6/site-
 packages:
   /usr/local/lib/python2.6/site-packages:
   /Users/zooko/lib/python2.6/site-packages:
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /plat-darwin:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /plat-mac:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /plat-mac/lib-scriptpackages:
 /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /lib-tk:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /lib-old:
   /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /lib-dynload:
   /Library/Python/2.6/site-packages:
 /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC:
 /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8
 -mac-unicode:
   /Users/zooko/lib/python2.6/site-packages

 }}}
 Part of the problem is that verlib (the nascent Python standard for
 version numbers) doesn't like {{{0.6.1+}}}:
 {{{
 python -i verlib.py
 >>> NormalizedVersion('0.6.1+')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Users/zooko/playground/tahoe-lafs/fileutil/tp/tarek-
 distutilsversion-22a8cdc67ac8/verlib.py", line 86, in __init__
     self._parse(s, error_on_huge_major_num)
   File "/Users/zooko/playground/tahoe-lafs/fileutil/tp/tarek-
 distutilsversion-22a8cdc67ac8/verlib.py", line 97, in _parse
     raise IrrationalVersionError(s)
 __main__.IrrationalVersionError: 0.6.1+
 }}}
 Ways to improve this:
 1. We could extend the copy of verlib that we bundle in Tahoe-LAFS to
 accept {{{0.6.1+}}} and let it sort higher than {{{0.6.1}}} and lower than
 {{{0.6.2}}}. How should {{{0.6.1+}}} compare to {{{0.6.1.1}}}?
 2. Brian (the maintainer of foolscap) could change it to use the Python-
 nascent-standard notation. I think the closest analogue to {{{0.6.1+}}}
 would be {{{0.6.1.post0}}}:
 {{{
 >>> NormalizedVersion('0.6.1.post0')
 NormalizedVersion('0.6.1.post0.f')
 }}}
 Then we could just not worry about the fact that foolscap {{{0.6.1+}}} is
 incompatible with Tahoe-LAFS, and instead quickly make foolscap trunk
 describe itself as {{{0.6.1.post0}}}. (I'll open a separate ticket saying
 that Tahoe-LAFS should more nicely deal with unparseable version numbers
 among its dependencies.)
 3. We could switch back from using {{{verlib}}} as version number parser
 to using {{{pkg_resources}}}, which handles foolscap's version numbers in
 a way that has always worked for Tahoe-LAFS's purposes. I don't know if
 doing that would run afoul of #1258 or if we could separate the version-
 number-parsing from the sys.path-manipulation.

-- 
Ticket URL: <http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1387>
tahoe-lafs <http://tahoe-lafs.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list