dgoodwin/tito — pull request #106 by jumanjiman (2014-02-18 03:42:38+00:00)
Title: avoid TB in nose tests if there is no tty

avoid TB in nose tests if there is no tty

GitPython's git.util.get_user_id() calls os.getlogin(), which is
throws an OSError if there is no tty. But GitPython also allows
to avoid the call by setting environment variable
"USER" to anything other than "UNKNOWN".

Therefore we preempt GitPython by calling os.getlogin() ourselves.
If we have to rescue the exception, export the environment var to
avoid traceback:

Traceback (most recent call last):
File "/home/sandbox/test/functional/multiproject_tests.py", line 65, in setUp
TitoGitTestFixture.setUp(self)
File "/home/sandbox/test/functional/fixture.py", line 129, in setUp
index.commit('Setting offline.')
File "/usr/lib/python2.7/site-packages/git/index/base.py", line 887, in commit
return Commit.create_from_tree(self.repo, tree, message, parent_commits, head)
File "/usr/lib/python2.7/site-packages/git/objects/commit.py", line 303, in create_from_tree
committer = Actor.committer(cr)
File "/usr/lib/python2.7/site-packages/git/util.py", line 354, in committer
return cls._main_actor(cls.env_committer_name, cls.env_committer_email, config_reader)
File "/usr/lib/python2.7/site-packages/git/util.py", line 327, in _main_actor
default_email = get_user_id()
File "/usr/lib/python2.7/site-packages/git/util.py", line 120, in get_user_id
username = os.getlogin()
OSError: [Errno 25] Inappropriate ioctl for device

____

resolve build errors on travis-ci

* travis-ci no longer supports python 2.5

http://blog.travis-ci.com/2013-11-18-upcoming-build-environment-updates/

> Python 2.5 has been removed due to very low overall usage and
> breaking changes in pip and virtualenv.

Removal makes me sad because RHEL 5 uses python 2.5.

* GitPython

pip install no longer supports pre-release versions by default
http://www.pip-installer.org/en/latest/reference/pip_install.html#pre-release-versions

resolves build error:

$ pip install 'GitPython >= 0.2.0' --use-mirrors
--use-mirrors has been deprecated and will be removed in the future.
Explicit uses of --index-url and/or --extra-index-url is suggested.
Downloading/unpacking GitPython>=0.2.0
Could not find a version that satisfies the requirement
GitPython>=0.2.0 (from versions: 0.1.7, 0.2.0-beta1, 0.3.0-beta1,
0.3.0-beta2, 0.3.1-beta2, 0.3.2.RC1)
Cleaning up...
No distributions matching the version for GitPython>=0.2.0