Commit Graph

62 Commits

Author SHA1 Message Date
Zooko O'Whielacronx
4911510e0d remove unused variable detected by pyflakes 2011-04-07 10:22:31 -07:00
david-sarah
f3246a9ca0 allmydata/__init__.py: Nicer reporting of unparseable version numbers in dependencies. fixes #1388 2011-04-01 13:27:50 -07:00
david-sarah
787d12165a Add unit tests for cross_check_pkg_resources_versus_import, and a regression test for ref #1355. This requires a little refactoring to make it testable. 2011-02-20 17:58:17 -08:00
david-sarah
71c301ca34 allmydata/__init__.py: .name was used in place of the correct .__name__ when printing an exception. Also, robustify string formatting by using %r instead of %s in some places. fixes #1355. 2011-02-20 18:01:25 -08:00
david-sarah
c71a19b9ed src/allmydata/__init__.py: fix #1339, give an indication in the --version[-and-path] output of when the imported setuptools is distribute, and use a separate element in _vers_and_locs_list tuples for information other than the package name and location. This also changes slightly how the sqlite version is reported. 2011-01-27 21:41:50 -08:00
david-sarah
cb02adb110 Don't put debugging information in 'My versions' section of the Welcome page. Also remove the extra blank line between version and command output when --version[-and-path] is used. refs #1306 2011-01-21 20:02:20 -08:00
david-sarah
29336a0916 Refactor _auto_deps.py and __init__.py, adding more robust checking of dependency versions, and not trusting pkg_resources to get the versions right. refs #1258, #1287 2011-01-20 21:36:10 -08:00
david-sarah
b8905fc766 allmydata/__init__.py: move the call to require_auto_deps() to the top again, since the [4784] patch turned out not to be the cause of the failure on the 'mm netbsd5' buildslave. 2010-10-31 17:33:16 -07:00
david-sarah
63c010a9ca allmydata/__init__.py: put the _auto_deps.require_auto_deps() call back in exactly the same place it was prior to [4784]. 2010-10-31 10:46:49 -07:00
david-sarah
7e2ed2054c allmydata/__init__.py: suppress a DeprecationWarning for the sha module on importing pycrypto. 2010-10-31 09:06:36 -07:00
david-sarah
6e76653913 allmydata/__init__.py: call require_auto_deps() after importing nevow and twisted, reverting change in [4784]. Also fix a missing 'warnings.filters.pop()'. 2010-10-31 08:38:28 -07:00
david-sarah
2ab0b1aa2c allmydata.__init__.py: temporary hack to debug failure on midnightmagic's buildslave 2010-10-30 22:50:03 -07:00
Zooko O'Whielacronx
3b2d0d9609 setup: run require_auto_deps() before attempting to import any deps in __init__.py
For one thing, this makes missing-dependency failures into DistributionNotFound errors instead of ImportErrors, which might be more useful to the user. For another thing, if someone is using distributions that were installed with --multi-version, then they might be not importable until after require_auto_deps() has been run. (The docs claim that this would be the case, but we don't have an example of this happening at this time.)
2010-10-30 01:10:35 -07:00
david-sarah
fd9a2205de test_runner.py: correct and simplify normalization of package directory for case-insensitive filesystems. 2010-08-08 11:50:05 -07:00
david-sarah
f5bf900d64 src/allmydata/__init__.py: make the package paths more accurate when we fail to get them from setuptools. 2010-08-08 10:12:35 -07:00
Zooko O'Whielacronx
44edecb36c setup: replace hardcoded 'allmydata-tahoe' with allmydata.__appname__ 2010-08-01 09:05:17 -07:00
david-sarah
94bec75dda __init__.py: silence DeprecationWarning about BaseException.message globally. fixes #1129 2010-07-19 18:19:39 -07:00
david-sarah
8ed28a95e7 Move suppression of DeprecationWarning about BaseException.message from sftpd.py to main __init__.py. Also, remove the global suppression of the 'integer argument expected, got float' warning, which turned out to be a bug. 2010-05-28 22:05:37 -07:00
david-sarah
aac94a8d89 Suppress 'integer argument expected, got float' DeprecationWarning everywhere 2010-05-23 15:11:57 -07:00
david-sarah
b8641f8f9b allmydata.org -> tahoe-lafs.org in __init__.py 2010-06-02 23:35:30 -07:00
david-sarah
a80f19a084 Correct harmless indentation errors found by pylint 2010-02-25 23:21:51 -07:00
david-sarah
e76092e16c Change relative imports to absolute 2010-02-26 01:14:33 -07:00
david-sarah
e880fc2ce4 Suppress deprecation warning for twisted.web.error.NoResource when using Twisted >= 9.0.0. 2010-05-16 13:56:25 -07:00
david-sarah
6215ebd95e cli: suppress DeprecationWarnings emitted from importing nevow and twisted. Fixes #859 2010-01-31 16:44:29 -08:00
Zooko O'Whielacronx
2841d6a266 setup: add pysqlite and sqlite to get_package_versions() 2009-06-04 08:37:28 -07:00
Brian Warner
c9803d5217 switch all foolscap imports to use foolscap.api or foolscap.logging 2009-05-21 17:38:23 -07:00
Zooko O'Whielacronx
14d23d99a5 setup: make the "full version string" be "allmydata-tahoe/1.3.0" instead of "allmydata-tahoe-1.3.0" and the UserAgent string of the cli be "allmydata-tahoe/1.3.0 (tahoe-client)"
This is webbish.  Thanks to kpreid for suggesting it.
2009-02-12 22:37:38 -07:00
Zooko O'Whielacronx
7eb260a9cf versioning: include an "appname" in the application version string in the versioning protocol, and make that appname be controlled by setup.py
It is currently hardcoded in setup.py to be 'allmydata-tahoe'.  Ticket #556 is to make it configurable by a runtime command-line argument to setup.py: "--appname=foo", but I suddenly wondered if we really wanted that and at the same time realized that we don't need that for tahoe-1.3.0 release, so this patch just hardcodes it in setup.py.
setup.py inspects a file named 'src/allmydata/_appname.py' and assert that it contains the string "__appname__ = 'allmydata-tahoe'", and creates it if it isn't already present.  src/allmydata/__init__.py import _appname and reads __appname__ from it.  The rest of the Python code imports allmydata and inspects "allmydata.__appname__", although actually every use it uses "allmydata.__full_version__" instead, where "allmydata.__full_version__" is created in src/allmydata/__init__.py to be:

__full_version__ = __appname + '-' + str(__version__).

All the code that emits an "application version string" when describing what version of a protocol it supports (introducer server, storage server, upload helper), or when describing itself in general (introducer client), usese allmydata.__full_version__.

This fixes ticket #556 at least well enough for tahoe-1.3.0 release.
2009-02-11 17:18:16 -07:00
Zooko O'Whielacronx
f4f69f4a95 setup: refactor versions-and-paths and use pkg_resources to find them
Using pkg_resources is probably better if it works -- zope.interface doesn't have a __version__ attribute that we can query, but pkg_resources knows zope.interface's version number, for one thing.
This code falls back to the old way -- looking at the __version__ attributes and __file__ attributes -- if the pkg_resources way doesn't answer.
Note that this patch also changes the capitalization of "Nevow", "Twisted", and "pyOpenSSL", and the spelling of "allmydata-tahoe".  These changes are not frivolous: they are reflecting the fact that we are naming Python packages (technically called Python "distributions") instead of Python modules (technically and confusingly called Python "packages") here.  The package ("distribution") is named "allmydata-tahoe".  The module ("package") is named "allmydata".
2009-01-19 15:04:35 -07:00
cgalvan
7bfaa74ef1 add option to show version and path to the tahoe executable 2009-01-16 12:47:51 -07:00
Zooko O'Whielacronx
51c7580fc8 setup: fix missing import -- thanks, pyflakes 2008-11-25 09:55:28 -07:00
Zooko O'Whielacronx
de9edde8f5 setup: correctly detect Arch Linux in platform description 2008-11-25 09:51:18 -07:00
Zooko O'Whielacronx
7339e09c72 setup: when detecting platform, ask the Python Standard Library's platform.dist() before executing lsb_release, and cache the result in global (module) variables
This should make it sufficiently fast, while still giving a better answer on Ubuntu than platform.dist() currently does, and also falling back to lsb_release if platform.dist() says that it doesn't know.
2008-09-24 11:09:22 -07:00
Zooko O'Whielacronx
2ef977d85a setup: try parsing /etc/lsb-release first, then invoking lsb_release, because the latter takes half-a-second on my workstation, which is too long
Also because in some cases the former will work and the latter won't.
This patch also tightens the regexes so it won't match random junk.
2008-09-23 10:14:31 -07:00
Zooko O'Whielacronx
37dd91238b setup: fix a cut-and-paste error in the fallback to parsing /etc/lsb-release 2008-09-23 09:55:51 -07:00
Zooko O'Whielacronx
8a35d2ed83 setup: if executing lsb_release doesn't work, fall back to parsing /etc/lsb-release before falling back to platform.dist()
An explanatio of why we do it this way is in the docstring.
2008-09-23 09:28:58 -07:00
Zooko O'Whielacronx
e2b1ce13f5 setup: if invoking lsb_release doesn't work (which it doesn't on our etch buildslave), then fall back to the Python Standard Library's platform.dist() function 2008-09-23 08:48:20 -07:00
Zooko O'Whielacronx
5075c12725 setup: simplify the implementation of allmydata.get_package_versions() and add "platform" which is a human-oriented summary of the underlying operating system and machine 2008-09-22 16:53:54 -07:00
Zooko O'Whielacronx
037c9157dc setup: simplify parsing of python version number 2008-08-28 17:00:45 -07:00
Zooko O'Whielacronx
6801d5f572 setup: emit the version of python in the list of versions 2008-08-28 15:04:54 -07:00
Zooko O'Whielacronx
fc271a0ee9 setup: don't catch ImportError when importing _auto_deps in allmydata/__init__.py
Nowadays pkg_resources is a runtime requirement, and if there is something screwed up in the installation, we want an explicit ImportError exception as early as possible.
2008-04-30 13:22:04 -07:00
Zooko O'Whielacronx
348eecd615 setup: require specific versions of dependencies, both at run-time (if pkg_resources is available) and at build-time, and make there be only once place where we specify those versions
Using pkg_resources.require() like this also apparently allows people to install multiple different versions of packages on their system and tahoe (if pkg_resources is available to it) will import the version of the package that it requires.  I haven't tested this feature.
2008-01-22 17:24:33 -07:00
Zooko O'Whielacronx
eaed7a0690 setup: use setuptools (if it is present) at run-time to give a specific error message on startup if a too-old version of a dependency is installed 2008-01-22 17:42:54 -07:00
Zooko O'Whielacronx
84289b2446 setup: update some docs, metadata, and docstrings 2008-01-22 10:22:51 -07:00
Brian Warner
1dd655c59e remove runtime dependency upon setuptools (which crept into allmydata.get_package_versions) 2008-01-04 20:53:41 -07:00
Zooko O'Whielacronx
5e8e2faf5d setup: update doc in __init__.py 2007-12-22 10:46:50 -07:00
Zooko O'Whielacronx
1ac11301a7 setup: finish switching from Tahoe's versions of autoversioning tools to pyutil's versions 2007-12-21 14:42:38 -07:00
Zooko O'Whielacronx
caa69b007e refactor the feature of getting versions of packages, include the version numbers of more of the packages that we use 2007-12-12 19:37:37 -07:00
Zooko O'Whielacronx
094b687d6e import version class and make-version script from pyutil -- fixes win32 build, improves error handling, and eliminates unused features 2007-08-16 14:09:30 -07:00
Brian Warner
3f6b660272 update version-number handling, pull release tags from darcs history 2007-05-03 20:14:07 -07:00