6 patches for repository http://tahoe-lafs.org/source/tahoe-lafs/trunk:
Sat Jan 1 11:01:41 GMT Standard Time 2011 david-sarah@jacaranda.org
* allmydata/__init__.py: don't use pkg_resources.require to get versions and paths. Also change pyOpenSSL to pyopenssl since that is the package name. fixes #1287
Sat Jan 1 20:05:02 GMT Standard Time 2011 david-sarah@jacaranda.org
* allmydata/_auto_deps.py: add a comment reminding to change __init__.py when dependencies are added or removed. Clarify a comment in __init__.py. refs #1287
Tue Jan 4 05:01:51 GMT Standard Time 2011 david-sarah@jacaranda.org
* bundled darcsver: write the _version.py file with LF line endings. This works around a problem with bb-freeze (refs #585). Don't apply this to trunk; instead, make a new darcsver release.
Tue Jan 4 11:18:25 GMT Standard Time 2011 david-sarah@jacaranda.org
* Make bbfreeze work. This also refactors allmydata/__init__.py and _auto_deps.py and implements more robust checking of dependency requirements, as discussed in ticket:585#comment:10 . However, the executable is not yet testable. refs #585
Tue Jan 4 11:23:00 GMT Standard Time 2011 david-sarah@jacaranda.org
* Delete obsolete code due to refactoring of allmydata/__init__.py and _auto_deps.py (done in a separate patch to avoid a confusing diff). refs #585
Tue Jan 4 11:24:41 GMT Standard Time 2011 david-sarah@jacaranda.org
* Add static/tahoe.py, to support bbfreeze, py2exe etc. refs #585
New patches:
[allmydata/__init__.py: don't use pkg_resources.require to get versions and paths. Also change pyOpenSSL to pyopenssl since that is the package name. fixes #1287
david-sarah@jacaranda.org**20110101110141
Ignore-this: 48593ba449d7453005c9d2683fed6a69
] {
hunk ./src/allmydata/__init__.py 178
else:
return platform.platform()
-def get_package_versions_from_setuptools():
- import pkg_resources
- return dict([(p.project_name, (p.version, p.location)) for p in pkg_resources.require(__appname__)])
-
def package_dir(srcfile):
return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
hunk ./src/allmydata/__init__.py 182
def get_package_versions_and_locations():
- # because there are a few dependencies that are outside setuptools's ken
- # (Python and platform, and sqlite3 if you are on Python >= 2.5), and
- # because setuptools might fail to find something even though import
- # finds it:
- import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface
+ # pkg_resources.require returns the distribution that pkg_resources attempted to put
+ # on sys.path, which can differ from the one that we actually import due to #1258,
+ # or any other bug that causes sys.path to be set up incorrectly. Therefore we
+ # must import the packages in order to check their versions and paths. Note that
+ # this needs to be updated if dependencies are added.
+
+ import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface, Crypto
pysqlitever = None
pysqlitefile = None
sqlitever = None
hunk ./src/allmydata/__init__.py 208
pysqlitefile = package_dir(sqlite3.__file__)
sqlitever = sqlite3.sqlite_version
- d1 = {
- 'pyOpenSSL': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),
+ return {
+ 'pyopenssl': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),
__appname__: (allmydata.__version__, package_dir(allmydata.__file__)),
'foolscap': (foolscap.api.__version__, package_dir(foolscap.__file__)),
'Nevow': (nevow.__version__, package_dir(nevow.__file__)),
hunk ./src/allmydata/__init__.py 221
'zope.interface': ('unknown', package_dir(zope.interface.__file__)),
'Twisted': (twisted.__version__, package_dir(twisted.__file__)),
'zfec': (zfec.__version__, package_dir(zfec.__file__)),
+ 'pycrypto': (Crypto.__version__, package_dir(Crypto.__file__)),
'python': (platform.python_version(), sys.executable),
'platform': (get_platform(), None),
}
hunk ./src/allmydata/__init__.py 226
- # But we prefer to get all the dependencies as known by setuptools:
- import pkg_resources
- try:
- d2 = get_package_versions_from_setuptools()
- except pkg_resources.DistributionNotFound:
- # See docstring in _auto_deps.require_auto_deps() to explain why it makes sense to ignore this exception.
- pass
- else:
- d1.update(d2)
-
- return d1
-
def get_package_versions():
return dict([(k, v) for k, (v, l) in get_package_versions_and_locations().iteritems()])
}
[allmydata/_auto_deps.py: add a comment reminding to change __init__.py when dependencies are added or removed. Clarify a comment in __init__.py. refs #1287
david-sarah@jacaranda.org**20110101200502
Ignore-this: edb7059211da0c2ce511680d76731da5
] {
hunk ./src/allmydata/__init__.py 186
# on sys.path, which can differ from the one that we actually import due to #1258,
# or any other bug that causes sys.path to be set up incorrectly. Therefore we
# must import the packages in order to check their versions and paths. Note that
- # this needs to be updated if dependencies are added.
+ # this needs to be updated if dependencies are added or removed.
import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface, Crypto
pysqlitever = None
hunk ./src/allmydata/_auto_deps.py 8
# zetuptoolz, distribute, and perhaps in the future distutils2, for
# the require_auto_deps() function.)
+# If you add or remove dependencies, please remember to update
+# get_package_versions_and_locations() in src/allmydata/__init__.py.
+
install_requires=[
# we require newer versions of setuptools (actually
# zetuptoolz) to build, but can handle older versions to run
}
[bundled darcsver: write the _version.py file with LF line endings. This works around a problem with bb-freeze (refs #585). Don't apply this to trunk; instead, make a new darcsver release.
david-sarah@jacaranda.org**20110104050151
Ignore-this: 3cb0bcf2af0dfa1d2cdc957a5aa42ab8
] hunk ./darcsver-1.7.1.egg/darcsver/darcsvermodule.py 50
'''
def write_version_py(verstr, outfname, EXE_NAME, version_body, pkgname):
- f = open(outfname, "wt+")
+ f = open(outfname, "wb+")
f.write(version_body % {
'versiontool': EXE_NAME,
'pkgversion': verstr,
[Make bbfreeze work. This also refactors allmydata/__init__.py and _auto_deps.py and implements more robust checking of dependency requirements, as discussed in ticket:585#comment:10 . However, the executable is not yet testable. refs #585
david-sarah@jacaranda.org**20110104111825
Ignore-this: 60bfc2a64acf642db4f50c9d8c204b6a
] {
hunk ./src/allmydata/__init__.py 7
community web site: U{http://tahoe-lafs.org/}
"""
-# We want to call require_auto_deps() before other imports, because the setuptools
-# docs claim that if a distribution is installed with --multi-version, it might not
-# be importable until after pkg_resources.require() has been called for it. We don't
-# have an example of this happening at this time. It is possible that require() isn't
-# actually needed because we set __requires__ in the generated startup script, but
-# that would be an undocumented property of the setuptools implementation.
-
-from allmydata import _auto_deps
-_auto_deps.require_auto_deps()
-
-# This is just to suppress DeprecationWarnings from nevow and twisted.
-# See http://allmydata.org/trac/tahoe/ticket/859 and
-# http://divmod.org/trac/ticket/2994 .
-import warnings
-warnings.filterwarnings("ignore", category=DeprecationWarning,
- message="the sha module is deprecated; use the hashlib module instead",
- append=True)
-warnings.filterwarnings("ignore", category=DeprecationWarning,
- message="object.__new__\(\) takes no parameters",
- append=True)
-warnings.filterwarnings("ignore", category=DeprecationWarning,
- message="The popen2 module is deprecated. Use the subprocess module.",
- append=True)
-warnings.filterwarnings("ignore", category=DeprecationWarning,
- message="the md5 module is deprecated; use hashlib instead",
- append=True)
-warnings.filterwarnings("ignore", category=DeprecationWarning,
- message="twisted.web.error.NoResource is deprecated since Twisted 9.0. See twisted.web.resource.NoResource.",
- append=True)
-try:
- import nevow
- from twisted.persisted import sob
- from twisted.python import filepath
- hush_pyflakes = (nevow, sob, filepath)
- del hush_pyflakes
-finally:
- warnings.filters.pop()
- warnings.filters.pop()
- warnings.filters.pop()
- warnings.filters.pop()
- # Don't pop the filter for the sha module warning because it is also generated
- # by pycrypto (which we don't want to import unless needed).
- # warnings.filters.pop()
-
-# This warning is generated by twisted, PyRex, and possibly other packages,
-# but can happen at any time, not only when they are imported. See
-# http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1129 .
-warnings.filterwarnings("ignore", category=DeprecationWarning,
- message="BaseException.message has been deprecated as of Python 2.6",
- append=True)
-
__version__ = "unknown"
try:
from allmydata._version import __version__
hunk ./src/allmydata/__init__.py 127
else:
return platform.platform()
+
+from allmydata._auto_deps import get_package_versions_and_locations
+
+_vers_and_locs = get_package_versions_and_locations()
+_vers_and_locs['platform'] = (get_platform(), None)
+
+
+def check_all_requirements():
+ import platform
+ from distutils.version import LooseVersion
+ from allmydata._auto_deps import install_requires
+
+ # we require 2.4.4 on non-UCS-2, non-Redhat builds to avoid
+ # we require 2.4.3 on non-UCS-2 Redhat, because 2.4.3 is common on Redhat-based distros and will have patched the above bug
+ # we require at least 2.4.2 in any case to avoid a bug in the base64 module:
+ if sys.maxunicode == 65535:
+ if sys.version_info < (2, 4, 2) or sys.version_info[0] > 2:
+ raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.2 or greater "
+ "for a UCS-2 build (but less than v3), not %r" %
+ (sys.version_info,))
+ elif platform.platform().lower().find('redhat') >= 0:
+ if sys.version_info < (2, 4, 3) or sys.version_info[0] > 2:
+ raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.3 or greater "
+ "on Redhat-based distributions (but less than v3), not %r" %
+ (sys.version_info,))
+ else:
+ if sys.version_info < (2, 4, 4) or sys.version_info[0] > 2:
+ raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.4 or greater "
+ "for a non-UCS-2 build (but less than v3), not %r" %
+ (sys.version_info,))
+
+ def check_requirement(req):
+ # We only support a single >= or ==.
+ def _check(s, ok, relation):
+ name = s[0].strip(' ').partition('[')[0]
+ required = s[1].strip(' ')
+ if name not in _vers_and_locs:
+ raise AssertionError("no version info for %s" % (name,))
+ (actual, location) = _vers_and_locs[name]
+ actual = str(actual)
+ if actual != 'unknown' and not ok(LooseVersion(actual), LooseVersion(required)):
+ msg = ("We require %s version %s of %s, but could only find version %s.\n"
+ % (relation, required, name, actual))
+ if location and location != 'unknown':
+ msg += "The version we found is from %r.\n" % (location,)
+ msg += ("To resolve this problem, uninstall that version, either using your\n"
+ "operating system's package manager or by moving aside the directory.")
+ raise AssertionError(msg)
+
+ s = req.split('>=')
+ if len(s) == 2:
+ _check(s, lambda x, y: x >= y, "at least")
+ return
+ s = req.split('==')
+ if len(s) == 2:
+ _check(s, lambda x, y: x == y, "exactly")
+ return
+ if req not in _vers_and_locs:
+ raise AssertionError("no version info or could not understand requirement for %r" % (req))
+
+ for requirement in install_requires:
+ check_requirement(requirement)
+
+check_all_requirements()
+
+
def package_dir(srcfile):
return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
hunk ./src/allmydata/__init__.py 196
-def get_package_versions_and_locations():
+def old_get_package_versions_and_locations():
# pkg_resources.require returns the distribution that pkg_resources attempted to put
# on sys.path, which can differ from the one that we actually import due to #1258,
# or any other bug that causes sys.path to be set up incorrectly. Therefore we
hunk ./src/allmydata/__init__.py 242
}
def get_package_versions():
- return dict([(k, v) for k, (v, l) in get_package_versions_and_locations().iteritems()])
+ return dict([(k, v) for k, (v, l) in _vers_and_locs.iteritems()])
def get_package_locations():
hunk ./src/allmydata/__init__.py 245
- return dict([(k, l) for k, (v, l) in get_package_versions_and_locations().iteritems()])
+ return dict([(k, l) for k, (v, l) in _vers_and_locs.iteritems()])
def get_package_versions_string(show_paths=False):
hunk ./src/allmydata/__init__.py 248
- vers_and_locs = get_package_versions_and_locations()
res = []
hunk ./src/allmydata/__init__.py 249
- for p in [__appname__, "foolscap", "pycryptopp", "zfec", "Twisted", "Nevow", "zope.interface", "python", "platform"]:
- (ver, loc) = vers_and_locs.get(p, ('UNKNOWN', 'UNKNOWN'))
+ first = [__appname__, "foolscap", "pycryptopp", "zfec", "Twisted", "Nevow", "zope.interface", "python", "platform"]
+ for p in first:
+ (ver, loc) = _vers_and_locs.get(p, ('UNKNOWN', 'UNKNOWN'))
info = str(p) + ": " + str(ver)
if show_paths:
info = info + " (%s)" % str(loc)
hunk ./src/allmydata/__init__.py 256
res.append(info)
- if vers_and_locs.has_key(p):
- del vers_and_locs[p]
hunk ./src/allmydata/__init__.py 257
- for p, (v, loc) in vers_and_locs.iteritems():
- info = str(p) + ": " + str(v)
- if show_paths:
- info = info + " (%s)" % str(loc)
- res.append(info)
+ for p, (v, loc) in _vers_and_locs.iteritems():
+ if p not in first:
+ info = str(p) + ": " + str(v)
+ if show_paths:
+ info = info + " (%s)" % str(loc)
+ res.append(info)
+
return ', '.join(res)
hunk ./src/allmydata/_auto_deps.py 3
# Note: do not import any module from Tahoe-LAFS itself in this
# file. Also please avoid importing modules from other packages than
-# the Python Standard Library if at all possible (exception: we rely
-# on importing pkg_resources, which is provided by setuptools,
-# zetuptoolz, distribute, and perhaps in the future distutils2, for
-# the require_auto_deps() function.)
+# the Python Standard Library if at all possible. That includes
+# setuptools and pkg_resources.
# If you add or remove dependencies, please remember to update
hunk ./src/allmydata/_auto_deps.py 7
-# get_package_versions_and_locations() in src/allmydata/__init__.py.
+# get_package_versions_and_locations() below.
install_requires=[
# we require newer versions of setuptools (actually
hunk ./src/allmydata/_auto_deps.py 31
# Needed for SFTP. pyasn1 is needed by twisted.conch in Twisted >= 9.0.
# pycrypto 2.2 doesn't work due to https://bugs.launchpad.net/pycrypto/+bug/620253
- "pycrypto == 2.0.1, == 2.1, >= 2.3",
+ "pycrypto >= 2.3",
"pyasn1 >= 0.0.8a",
# Will be needed to test web apps, but not yet. See #1001.
hunk ./src/allmydata/_auto_deps.py 78
install_requires=[]
del sys # clean up namespace
-def require_python_version():
+def old_require_python_version():
import sys, platform
# we require 2.4.4 on non-UCS-2, non-Redhat builds to avoid
hunk ./src/allmydata/_auto_deps.py 100
"for a non-UCS-2 build (but less than v3), not %r" %
(sys.version_info,))
-def require_auto_deps():
+def old_require_auto_deps():
"""
The purpose of this function is to raise a pkg_resources exception if any of the
requirements can't be imported. This is just to give earlier and more explicit error
hunk ./src/allmydata/_auto_deps.py 124
# but it shows a too-old version, then we'll get a
# VersionConflict error instead of DistributionNotFound.
pass
+
+
+def get_package_versions_and_locations():
+ import warnings, os, sys
+ def package_dir(srcfile):
+ return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
+
+ # pkg_resources.require returns the distribution that pkg_resources attempted to put
+ # on sys.path, which can differ from the one that we actually import due to #1258,
+ # or any other bug that causes sys.path to be set up incorrectly. Therefore we
+ # must import the packages in order to check their versions and paths. Note that
+ # this needs to be updated if dependencies are added or removed.
+
+ # This warning is generated by twisted, PyRex, and possibly other packages,
+ # but can happen at any time, not only when they are imported. See
+ # http://tahoe-lafs.org/trac/tahoe-lafs/ticket/1129 .
+ warnings.filterwarnings("ignore", category=DeprecationWarning,
+ message="BaseException.message has been deprecated as of Python 2.6",
+ append=True)
+
+ # This is to suppress DeprecationWarnings from nevow, twisted, and pycrypto.
+ # See http://allmydata.org/trac/tahoe/ticket/859 and
+ # http://divmod.org/trac/ticket/2994 .
+ warnings.filterwarnings("ignore", category=DeprecationWarning,
+ message="the sha module is deprecated; use the hashlib module instead",
+ append=True)
+ warnings.filterwarnings("ignore", category=DeprecationWarning,
+ message="object.__new__\(\) takes no parameters",
+ append=True)
+ warnings.filterwarnings("ignore", category=DeprecationWarning,
+ message="The popen2 module is deprecated. Use the subprocess module.",
+ append=True)
+ warnings.filterwarnings("ignore", category=DeprecationWarning,
+ message="the md5 module is deprecated; use hashlib instead",
+ append=True)
+ warnings.filterwarnings("ignore", category=DeprecationWarning,
+ message="twisted.web.error.NoResource is deprecated since Twisted 9.0. See twisted.web.resource.NoResource.",
+ append=True)
+ try:
+ import nevow
+ from twisted.persisted import sob
+ from twisted.python import filepath
+ import Crypto
+ [sob, filepath] # hush pyflakes
+ finally:
+ warnings.filters.pop()
+ warnings.filters.pop()
+ warnings.filters.pop()
+ warnings.filters.pop()
+ warnings.filters.pop()
+
+ import OpenSSL, allmydata, foolscap.api, platform, pycryptopp, simplejson, twisted, zfec, zope.interface, pyasn1
+ pysqlitever = None
+ pysqlitefile = None
+ sqlitever = None
+ try:
+ import sqlite3
+ except ImportError:
+ try:
+ from pysqlite2 import dbapi2
+ except ImportError:
+ pass
+ else:
+ pysqlitever = dbapi2.version
+ pysqlitefile = package_dir(dbapi2.__file__)
+ sqlitever = dbapi2.sqlite_version
+ else:
+ pysqlitever = sqlite3.version
+ pysqlitefile = package_dir(sqlite3.__file__)
+ sqlitever = sqlite3.sqlite_version
+
+ packages = {
+ 'pyopenssl': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),
+ allmydata.__appname__: (allmydata.__version__, package_dir(allmydata.__file__)),
+ 'foolscap': (foolscap.api.__version__, package_dir(foolscap.__file__)),
+ 'Nevow': (nevow.__version__, package_dir(nevow.__file__)),
+ 'pycryptopp': (pycryptopp.__version__, package_dir(pycryptopp.__file__)),
+ 'simplejson': (simplejson.__version__, package_dir(simplejson.__file__)),
+ 'pysqlite': (pysqlitever, pysqlitefile),
+ 'sqlite': (sqlitever, 'unknown'),
+ 'zope.interface': ('unknown', package_dir(zope.interface.__file__)),
+ 'Twisted': (twisted.__version__, package_dir(twisted.__file__)),
+ 'zfec': (zfec.__version__, package_dir(zfec.__file__)),
+ 'pycrypto': (Crypto.__version__, package_dir(Crypto.__file__)),
+ 'pyasn1': ('unknown', package_dir(pyasn1.__file__)),
+ 'python': (platform.python_version(), sys.executable),
+ }
+
+ if sys.platform == 'win32':
+ try:
+ import win32api
+ packages['pywin32'] = ('unknown', package_dir(win32api.__file__))
+ except ImportError:
+ pass
+
+ if not hasattr(sys, 'frozen'):
+ # Don't try to get the setuptools version if using bbfreeze, py2exe etc. See #585.
+ import setuptools
+ packages['setuptools'] = (setuptools.__version__, package_dir(setuptools.__file__))
+
+ return packages
hunk ./src/allmydata/windows/fixups.py 172
argc = c_int(0)
argv_unicode = CommandLineToArgvW(GetCommandLineW(), byref(argc))
- # Because of (and similar limitations in
- # twisted), the 'bin/tahoe' script cannot invoke us with the actual Unicode arguments.
- # Instead it "mangles" or escapes them using \x7F as an escape character, which we
- # unescape here.
- def unmangle(s):
- return re.sub(ur'\x7F[0-9a-fA-F]*\;', lambda m: unichr(int(m.group(0)[1:-1], 16)), s)
+ if hasattr(sys, 'frozen'):
+ # If this is an executable produced by py2exe or bbfreeze, then it will have been
+ # invoked directly, so the arguments just need to be encoded as UTF-8.
hunk ./src/allmydata/windows/fixups.py 176
- try:
- argv = [unmangle(argv_unicode[i]).encode('utf-8') for i in xrange(1, argc.value)]
- except Exception, e:
- _complain("%s: could not unmangle Unicode arguments.\n%r"
- % (sys.argv[0], [argv_unicode[i] for i in xrange(1, argc.value)]))
- raise
+ argv = [argv_unicode[i].encode('utf-8') for i in xrange(0, argc.value)]
+ else:
+ # Because of (and similar limitations in
+ # twisted), the 'bin/tahoe' script cannot invoke us with the actual Unicode arguments.
+ # Instead it "mangles" or escapes them using \x7F as an escape character, which we
+ # unescape here.
+ def unmangle(s):
+ return re.sub(ur'\x7F[0-9a-fA-F]*\;', lambda m: unichr(int(m.group(0)[1:-1], 16)), s)
hunk ./src/allmydata/windows/fixups.py 185
- # Skip option arguments to the Python interpreter.
- while len(argv) > 0:
- arg = argv[0]
- if not arg.startswith(u"-") or arg == u"-":
- if arg.endswith('.pyscript'):
- argv[0] = arg[:-9]
- break
- argv = argv[1:]
- if arg == u'-m':
- # sys.argv[0] should really be the absolute path of the module source, but never mind
- break
- if arg == u'-c':
- argv[0] = u'-c'
- break
+ # unicode_argv[0] is the Python interpreter, so skip that, and unmangle subsequent
+ # arguments.
+ try:
+ argv = [unmangle(argv_unicode[i]).encode('utf-8') for i in xrange(1, argc.value)]
+ except Exception, e:
+ _complain("%s: could not unmangle Unicode arguments.\n%r"
+ % (sys.argv[0], [argv_unicode[i] for i in xrange(1, argc.value)]))
+ raise
+
+ # Also skip option arguments to the Python interpreter.
+ while len(argv) > 0:
+ arg = argv[0]
+ if not arg.startswith(u"-") or arg == u"-":
+ if arg.endswith('.pyscript'):
+ argv[0] = arg[:-9]
+ break
+ argv = argv[1:]
+ if arg == u'-m':
+ # sys.argv[0] should really be the absolute path of the module source, but never mind
+ break
+ if arg == u'-c':
+ argv[0] = u'-c'
+ break
sys.argv = argv
}
[Delete obsolete code due to refactoring of allmydata/__init__.py and _auto_deps.py (done in a separate patch to avoid a confusing diff). refs #585
david-sarah@jacaranda.org**20110104112300
Ignore-this: 2f607f6e53ee0ba278f43a7ab3396edd
] {
hunk ./src/allmydata/__init__.py 193
check_all_requirements()
-def package_dir(srcfile):
- return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
-
-def old_get_package_versions_and_locations():
- # pkg_resources.require returns the distribution that pkg_resources attempted to put
- # on sys.path, which can differ from the one that we actually import due to #1258,
- # or any other bug that causes sys.path to be set up incorrectly. Therefore we
- # must import the packages in order to check their versions and paths. Note that
- # this needs to be updated if dependencies are added or removed.
-
- import OpenSSL, allmydata, foolscap.api, nevow, platform, pycryptopp, setuptools, simplejson, twisted, zfec, zope.interface, Crypto
- pysqlitever = None
- pysqlitefile = None
- sqlitever = None
- try:
- import sqlite3
- except ImportError:
- try:
- from pysqlite2 import dbapi2
- except ImportError:
- pass
- else:
- pysqlitever = dbapi2.version
- pysqlitefile = package_dir(dbapi2.__file__)
- sqlitever = dbapi2.sqlite_version
- else:
- pysqlitever = sqlite3.version
- pysqlitefile = package_dir(sqlite3.__file__)
- sqlitever = sqlite3.sqlite_version
-
- return {
- 'pyopenssl': (OpenSSL.__version__, package_dir(OpenSSL.__file__)),
- __appname__: (allmydata.__version__, package_dir(allmydata.__file__)),
- 'foolscap': (foolscap.api.__version__, package_dir(foolscap.__file__)),
- 'Nevow': (nevow.__version__, package_dir(nevow.__file__)),
- 'pycryptopp': (pycryptopp.__version__, package_dir(pycryptopp.__file__)),
- 'setuptools': (setuptools.__version__, package_dir(setuptools.__file__)),
- 'simplejson': (simplejson.__version__, package_dir(simplejson.__file__)),
- 'pysqlite': (pysqlitever, pysqlitefile),
- 'sqlite': (sqlitever, 'unknown'),
- 'zope.interface': ('unknown', package_dir(zope.interface.__file__)),
- 'Twisted': (twisted.__version__, package_dir(twisted.__file__)),
- 'zfec': (zfec.__version__, package_dir(zfec.__file__)),
- 'pycrypto': (Crypto.__version__, package_dir(Crypto.__file__)),
- 'python': (platform.python_version(), sys.executable),
- 'platform': (get_platform(), None),
- }
-
def get_package_versions():
return dict([(k, v) for k, (v, l) in _vers_and_locs.iteritems()])
hunk ./src/allmydata/_auto_deps.py 78
install_requires=[]
del sys # clean up namespace
-def old_require_python_version():
- import sys, platform
-
- # we require 2.4.4 on non-UCS-2, non-Redhat builds to avoid
- # we require 2.4.3 on non-UCS-2 Redhat, because 2.4.3 is common on Redhat-based distros and will have patched the above bug
- # we require at least 2.4.2 in any case to avoid a bug in the base64 module:
- if sys.maxunicode == 65535:
- if sys.version_info < (2, 4, 2) or sys.version_info[0] > 2:
- raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.2 or greater "
- "for a UCS-2 build (but less than v3), not %r" %
- (sys.version_info,))
- elif platform.platform().lower().find('redhat') >= 0:
- if sys.version_info < (2, 4, 3) or sys.version_info[0] > 2:
- raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.3 or greater "
- "on Redhat-based distributions (but less than v3), not %r" %
- (sys.version_info,))
- else:
- if sys.version_info < (2, 4, 4) or sys.version_info[0] > 2:
- raise NotImplementedError("Tahoe-LAFS current requires Python v2.4.4 or greater "
- "for a non-UCS-2 build (but less than v3), not %r" %
- (sys.version_info,))
-
-def old_require_auto_deps():
- """
- The purpose of this function is to raise a pkg_resources exception if any of the
- requirements can't be imported. This is just to give earlier and more explicit error
- messages, as opposed to waiting until the source code tries to import some module from one
- of these packages and gets an ImportError. This function gets called from
- src/allmydata/__init__.py .
- """
- require_python_version()
-
- import pkg_resources
- for requirement in install_requires:
- try:
- pkg_resources.require(requirement)
- except pkg_resources.DistributionNotFound:
- # there is no .egg-info present for this requirement, which
- # either means that it isn't installed, or it is installed in a
- # way that pkg_resources can't find it (but regular python
- # might). There are several older Linux distributions which
- # provide our dependencies just fine, but they don't ship
- # .egg-info files. Note that if there *is* an .egg-info file,
- # but it shows a too-old version, then we'll get a
- # VersionConflict error instead of DistributionNotFound.
- pass
-
def get_package_versions_and_locations():
import warnings, os, sys
}
[Add static/tahoe.py, to support bbfreeze, py2exe etc. refs #585
david-sarah@jacaranda.org**20110104112441
Ignore-this: cc749f837d24c23979b740fd8a27a8f0
] {
adddir ./static
addfile ./static/tahoe.py
hunk ./static/tahoe.py 2
+# This checks that we can import the right versions of all dependencies.
+# Import this first to suppress deprecation warnings.
+import allmydata
+
+# nevow requires all these for its voodoo module import time adaptor registrations
+from nevow import accessors, appserver, static, rend, url, util, query, i18n, flat
+from nevow import guard, stan, testutil, context
+from nevow.flat import flatmdom, flatstan, twist
+from formless import webform, processors, annotate, iformless
+from decimal import Decimal
+
+import allmydata.web
+
+# junk to appease pyflakes's outrage
+[
+ accessors, appserver, static, rend, url, util, query, i18n, flat, guard, stan, testutil,
+ context, flatmdom, flatstan, twist, webform, processors, annotate, iformless, Decimal,
+ allmydata,
+]
+
+from allmydata.scripts import runner
+
+runner.run()
}
Context:
[bin/tahoe-script.template: On non-Windows, invoke support/bin/tahoe directly as a script (rather than via python), so that 'top' for example will show it as 'tahoe'. On Windows, simplify some code that set argv[0], which is never used. fixes #174
david-sarah@jacaranda.org**20101127232650
Ignore-this: 42a86f3eecfdc1ea7b76a7cc68626898
]
[test_runner: avoid unnecessary use of non-ASCII.
david-sarah@jacaranda.org**20110101100101
Ignore-this: e2ff40dce6bb3b021306f2913d4e75df
]
[docs/quickstart.html: fix redundant, badly nested tag. refs #1284
david-sarah@jacaranda.org**20110102175159
Ignore-this: 2ae9cc0b47d2e87b9eb64a0f517c4eef
]
[docs/quickstart.html: information about 'troublesome dependencies' and 'verified systems' de-emphasized by smaller italic font. Re-wrap so that the HTML source is readable (just about) as text. Minor wording tweaks. Improve organization by adding 'Windows Caveats' subsection. fixes #1284
david-sarah@jacaranda.org**20110102174212
Ignore-this: e9dc57983974478200856651c5318fee
]
[NEWS: update entry for removal of Mac and Windows apps. refs #1282
david-sarah@jacaranda.org**20101226042245
Ignore-this: c8099bc6e8235718d042c9a13c1e2425
]
[Move dependency imports from windows/depends.py (which has gone away) into src/allmydata/windows/tahoesvc.py. Also fix a pyflakes warning, and change the service display name from 'Allmydata Tahoe Node' to 'Tahoe-LAFS node'. refs #1282
david-sarah@jacaranda.org**20101226042100
Ignore-this: ee45f324934e1251380206dbee6346d0
]
[Remove unmaintained Windows GUI app, except for windows/tahoesvc.py which is moved to src/allmydata/windows. refs #1282
david-sarah@jacaranda.org**20101226040237
Ignore-this: cae37b6622a7dd5940acc7d3e6a98b90
]
[Remove the Makefile targets relating to the Mac GUI app. refs #1282
david-sarah@jacaranda.org**20101226025859
Ignore-this: 75303be783974b41138744ec62b07965
]
[NEWS: remove unmaintained Mac GUI app. refs #1282
david-sarah@jacaranda.org**20101226020858
Ignore-this: 40474a07f4a550b48563d35350be7ab5
]
[Remove unmaintained Mac GUI app. fixes #1282
david-sarah@jacaranda.org**20101226020508
Ignore-this: b3613bf1abfd284d542bf7c753ec557a
]
[Remove src/allmydata/util/find_exe.py which is no longer used. fixes #1150
david-sarah@jacaranda.org**20101226023206
Ignore-this: 7436c9b53bf210aed34a1a973cd9cace
]
[status_web_pages_review.darcs.patch
freestorm77@gmail.com**20110102034214
Ignore-this: 29f1ecb36177f10f3f846b3d56b313b2
I make some changes on status web pages
status.xhtml:
- Delete unused webform_css link
- Align tables on the left
tahoe-css:
- Do some minor changes on code synthax
- changes table.status-download-events style to look like other tables
status.py:
- Align table on the left
- Changes table header
- Add heading tags
- Modify google api graph: add image border, calculate height to feet data
signed-off-by: zooko@zooko.com
fixes #1219
]
[test_storage.py: fix a pyflakes unused import warning.
david-sarah@jacaranda.org**20101231220756
Ignore-this: df08231540cb7dff9d2b038e47ab30ee
]
[test_storage.py: leave at least 512 MiB free when running test_large_share. refs #1195
david-sarah@jacaranda.org**20101231203215
Ignore-this: b2144c0341c3452b5d4ba219e284ea0e
]
[storage: use fileutil's version of get_disk_stats() and get_available_space(), use mockery/fakery in tests, enable large share test on platforms with sparse files and if > 4 GiB of disk space is currently available
zooko@zooko.com**20100910173629
Ignore-this: 1304f1164c661de6d5304f993eb9b27b
]
[fileutil: copy in the get_disk_stats() and get_available_space() functions from storage/server.py
zooko@zooko.com**20100910173520
Ignore-this: 8b15569715f710f4fc5092f7ca109253
]
[Update foolscap version requirement to 0.6.0, to address http://foolscap.lothar.com/trac/ticket/167
david-sarah@jacaranda.org**20101231060039
Ignore-this: 98d2b8086a1a500b9f4565bca5a3810
]
[docs/webapi.rst: typos.
david-sarah@jacaranda.org**20101230034422
Ignore-this: d1f5166d72cc711f7e0d9981eac9105e
]
[docs/webapi.rst: capitalization, formatting of section on URL character encoding, and a correction about Internet Explorer.
david-sarah@jacaranda.org**20101230034049
Ignore-this: b3b9819d2fb264b4cdc5c8afd4e8c48d
]
[docs: corrections and clarifications.
david-sarah@jacaranda.org**20101227051056
Ignore-this: e33202858c7644c58f3f924b164294b6
]
[docs: more formatting cleanups and corrections. Spell webapi and wapi as web-API.
david-sarah@jacaranda.org**20101227050533
Ignore-this: 18b23cbfb780df585d8a722a1ec63e94
]
[docs/debian.rst: bring description of building dependencies from source up-to-date, and change hostname from allmydata.com to tahoe-lafs.org.
david-sarah@jacaranda.org**20101212222912
Ignore-this: f38462afc88b4475195610385a28391c
]
[docs/architecture.rst: correct rst syntax.
david-sarah@jacaranda.org**20101212202003
Ignore-this: 3fbe12feb28bec6f1c63aedbc79aad21
]
[docs/architecture.rst: formatting.
david-sarah@jacaranda.org**20101212201719
Ignore-this: 305fa5dfc2939355eaf6d0d2161eb1ff
]
[docs: linkification, wording improvements.
david-sarah@jacaranda.org**20101212201234
Ignore-this: 4e67287f527a8bc728cfbd93255d2aae
]
[docs: formatting.
david-sarah@jacaranda.org**20101212201115
Ignore-this: 2e0ed394ac7726651d3a4f2c4b0d3798
]
[docs/configuration.rst: more formatting tweaks; which -> that.
david-sarah@jacaranda.org**20101212195522
Ignore-this: a7becb7021854ca5a90edd892b36fdd7
]
[docs/configuration.rst: more changes to formatting.
david-sarah@jacaranda.org**20101212194511
Ignore-this: 491aac33e5f5268d224359f1447d10be
]
[docs/configuration.rst: changes to formatting (mainly putting commands and filenames in monospace).
david-sarah@jacaranda.org**20101212181828
Ignore-this: 8a1480e2d5f43bee678476424615b50f
]
[scripts/backupdb.py: more accurate comment about path field.
david-sarah@jacaranda.org**20101212170320
Ignore-this: 50e47a2228a85207bbcd188a78a0d4e6
]
[scripts/cli.py: fix missing 'put' in usage example for 'tahoe put'.
david-sarah@jacaranda.org**20101212170207
Ignore-this: 2cbadf066fff611fc03d3c0ff97ce6ec
]
[docs/frontends/CLI.rst: changes to formatting (mainly putting commands and filenames in monospace), and to command syntax to reflect that DIRCAP/... is accepted. Clarify the syntax of 'tahoe put' and other minor corrections. Tahoe -> Tahoe-LAFS.
david-sarah@jacaranda.org**20101212165800
Ignore-this: a123ef6b564aa8624d1e79c97068ea12
]
[docs/frontends/CLI.rst: Unicode arguments to 'tahoe' work on Windows as of v1.7.1.
david-sarah@jacaranda.org**20101212063740
Ignore-this: 3977a99dfa86ac33a44171deaf43aaab
]
[docs/known_issues.rst: fix title and linkify another URL. refs #1225
david-sarah@jacaranda.org**20101212062817
Ignore-this: cc91287f7fb51c23440b3d2fe79c449c
]
[docs/known_issues.rst: fix an external link. refs #1225
david-sarah@jacaranda.org**20101212062435
Ignore-this: b8cbf12f353131756c358965c48060ec
]
[Fix a link from uri.rst to dirnodes.rst. refs #1225
david-sarah@jacaranda.org**20101212054502
Ignore-this: af6205299f5c9a33229cab259c00f9d5
]
[Fix a link from webapi.rst to FTP-and-SFTP.rst. refs #1225
david-sarah@jacaranda.org**20101212053435
Ignore-this: 2b9f88678c3447ea860d6b61e8799858
]
[More specific hyperlink to architecture.rst from helper.rst. refs #1225
david-sarah@jacaranda.org**20101212052607
Ignore-this: 50424c768fca481252fabf58424852dc
]
[Update hyperlinks between docs, and linkify some external references. refs #1225
david-sarah@jacaranda.org**20101212051459
Ignore-this: cd43a4c3d3de1f832abfa88d5fc4ace1
]
[docs/specifications/dirnodes.rst: fix references to mutable.rst. refs #1225
david-sarah@jacaranda.org**20101212012720
Ignore-this: 6819b4b4e06e947ee48b365e840db37d
]
[docs/specifications/mutable.rst: correct the magic string for v1 mutable containers. refs #1225
david-sarah@jacaranda.org**20101212011400
Ignore-this: 99a5fcdd40cef83dbb08f323f6cdaaca
]
[Move .txt files in docs/frontends and docs/specifications to .rst. refs #1225
david-sarah@jacaranda.org**20101212010251
Ignore-this: 8796d35d928370f7dc6ad2dafdc1c0fe
]
[Convert docs/frontends and docs/specifications to reStructuredText format (not including file moves).
david-sarah@jacaranda.org**20101212004632
Ignore-this: e3ceb2d832d73875abe48624ddbb5622
]
[scripts/cli.py: remove the disclaimer in the help for 'tahoe cp' that it does not handle non-ASCII filenames well. (At least, we intend to handle them.)
david-sarah@jacaranda.org**20101130002145
Ignore-this: 94c003efaa20b9eb4a83503d79844ca
]
[relnotes.txt: fifth -> sixth labor-of-love release
zooko@zooko.com**20101129045647
Ignore-this: 21c245015268b38916e3a138d256c09d
]
[Makefile: BB_BRANCH is set to the empty string for trunk, not the string 'trunk'.
david-sarah@jacaranda.org**20101128233512
Ignore-this: 5a7ef8eb10475636d21b91e25b56c369
]
[relnotes.txt: eleventh -> twelfth release.
david-sarah@jacaranda.org**20101128223321
Ignore-this: 1e26410156a665271c1170803dea2c0d
]
[relnotes.tst: point to known_issues.rst, not known_issues.txt.
david-sarah@jacaranda.org**20101128222918
Ignore-this: 60194eb4544cac446fe4f60b3e34b887
]
[quickstart.html: fix link to point to allmydata-tahoe-1.8.1.zip.
david-sarah@jacaranda.org**20101128221728
Ignore-this: 7b3ee86f8256aa12f5d862f689f3ee29
]
[TAG allmydata-tahoe-1.8.1
david-sarah@jacaranda.org**20101128212336
Ignore-this: 9c18bdeaef4822f590d2a0d879e00621
]
Patch bundle hash:
05e40d32c3646801698dd18a95af40dc02442706