Lost this somehow in refactoring, but right now failed commands are silent.
Raise an exception and print the error details.
Restore behaviour where we can print command output on success if desired.
Fix a couple tests that were actually failing due to missing rsync dest.
Older versions of git-annex don't support `git annex lock --force`, so peform
a version check and call without --force on these.
The EL6 Docker image is changed to one that contains locales, in order for
git-annex to run successfully.
Particularly useful when creating new projects and wanting to avoid
creating an initial tag, this allows `tito build --test --srpm` etc
to run without any tag.
With a general 'scl' builder option, a software collection name can be
specified irrespective of the releaser used. RsyncReleaser's own 'scl'
option has been deprecated in favour of using 'builder.scl' in
releasers.conf.
Avoids...
Traceback (most recent call last):
File "/home/sandbox/test/functional/build_gitannex_tests.py", line 87, in test_simple_build
self.assertEquals(1, len(builder.sources))
nose.proxy.TypeError: TypeError: object of type 'map' has no len()
Use RawConfigParser instead of ConfigParser to avoid...
Traceback (most recent call last):
File "/home/sandbox/test/functional/multiproject_tests.py", line 68, in setUp
self.create_project(TEST_PKG_1, os.path.join(self.repo_dir, 'pkg1'))
File "/home/sandbox/test/functional/fixture.py", line 198, in create_project
tito('tag --keep-version --debug --accept-auto-changelog')
File "/home/sandbox/test/functional/fixture.py", line 103, in tito
return CLI().main(argstring.split(' '))
File "/home/sandbox/src/tito/cli.py", line 222, in main
return module.main(argv)
File "/home/sandbox/src/tito/cli.py", line 671, in main
offline=self.options.offline)
File "/home/sandbox/src/tito/tagger/main.py", line 51, in __init__
ConfigObject.__init__(self, config=config)
File "/home/sandbox/src/tito/config_object.py", line 38, in __init__
config.get(section, options))
File "/usr/lib64/python3.3/configparser.py", line 1184, in set
super().set(section, option, value)
File "/usr/lib64/python3.3/configparser.py", line 889, in set
value)
File "/usr/lib64/python3.3/configparser.py", line 399, in before_set
"position %d" % (value, tmp_value.find('%')))
nose.proxy.ValueError: ValueError: invalid interpolation syntax in '%s (%ae)' at position 0
03255001d6 moved commands module to src/tito/compat.py to handle
differences between python2 and python3, but missed a bit that
did not show up in unit or functional tests.
Fix those occurences and add unit test to detect the regression.
before this commit: fetch_tests and release_yum_tests
allow *any* dist tag, but the tag must not be empty or
else the glob fails on double-dot in path name.
after this commit: allow the tag to be any *or* empty.
resolves from a73c90cb...
Using Python 2.4
Using nose 0.1
Running tito tests against: /home/sandbox/src
EEEE.Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
..............................F...........
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (fixture.py, line 159))
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/nose/loader.py", line 381, in loadTestsFromName
module = self.importer.importFromPath(
File "/usr/lib/python2.4/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.4/site-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/sandbox/test/functional/fetch_tests.py", line 27, in ?
from fixture import TitoGitTestFixture, tito
File "/home/sandbox/test/functional/fixture.py", line 159
with open(os.path.join(full_pkg_dir, 'tito.props'), 'w') \
^
SyntaxError: invalid syntax
python3 does not allow relative imports.
test/unit/__init.py__ and test/functional/__init.py__ already exist,
which means we can use absolute import on all versions of python
without resorting to http://legacy.python.org/dev/peps/pep-0328/
Python 3 does not have the print statement, so convert all
print statements to print functions and add an ugly duckling
unit test to detect regressions.
Add modules compat lib to support both python 2 and 3, and
add unit test to detect regressions.
Tito uses two modules that have changed significantly between
python 2 and 3:
* commands module merged into subprocess module
* ConfigParser module renamed as configparser
Exceptions are now compatible with both python 2.4 and 3.3,
and we have unit tests to detect regressions.
The syntax for capturing exceptions changed in python 3, but
we need to continue supporting python 2.4 syntax since many
people use tito on RHEL 5, which has python 2.4.
http://docs.python.org/dev/howto/pyporting.html#capturing-the-currently-raised-exception
These are the pep8 tests that break python3,
such as mixing tabs and spaces for indentation.
I ignored all the pep8 tests that seemed only stylistic,
such as "visual" indentation.
http://docs.python.org/3.3/reference/lexical_analysis.html
GitPython's git.util.get_user_id() calls os.getlogin(), which
throws an OSError if there is no tty:
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
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.
Instead of passing package specific and global config around separately, parse
them as one config object where package specific can override global should the
same sections and properties exist.
If you maintain custom builders/releasers, they will need to have their
constructors updated.
This may have been a recent change in rpmbuild that caused this as the
_buildroot macro appears to be somewhat new. However it seems using topdir
accomplishes the same thing more thoroughly.