Commit graph

511 commits

Author SHA1 Message Date
Paul Morgan
a0d0f859c7 resolve another use of commands module for python3 compat
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.
2014-03-09 13:12:32 +00:00
Paul Morgan
0e218077b3 HACKING: tests on python3 require rpm-python3 2014-03-08 22:36:57 +00:00
Devan Goodwin
b88ae7c4bb Bad config references. 2014-03-07 14:52:52 -04:00
Devan Goodwin
a49649ce3e Fix some missed references to deprecated config names. 2014-03-07 14:29:10 -04:00
Devan Goodwin
4ec0213959 Rename for new config section. 2014-03-07 14:21:01 -04:00
Devan Goodwin
11b58b62ae Remove legacy CvsBuilder and CvsReleaser.
These build systems no longer exist to the best of my knowledge.
2014-03-07 14:18:43 -04:00
Devan Goodwin
9c671d09e0 Stop writing temp file to load tito.props from past tag. 2014-03-07 14:02:06 -04:00
Devan Goodwin
167800f75f Remove deprecated support for build.py.props config filename. 2014-03-07 13:53:57 -04:00
Devan Goodwin
e2ac2cac32 Remove a very old hack for assuming config from Makefiles.
This predates build.py.props which predates tito.props. Extremely unlikely
anyone is still using this.
2014-03-07 13:41:22 -04:00
Devan Goodwin
6ee7cf631f Refactor config overriding.
Merge rel-eng/tito.props with package specific tito.props. Package specific
values will be used whenever the same property appears in both.

This patch deprecates the use of [globalconfig], instead favoring
[buildconfig]. Globalconfig will continue to work and just print a warning to
the user, support will be removed entirely later on.
2014-03-07 13:30:43 -04:00
Devan Goodwin
d637425496 Move taggers to sub-directory. 2014-03-07 09:40:05 -04:00
Devan Goodwin
c888383b31 Move releasers to sub-directory. 2014-03-06 15:02:02 -04:00
Devan Goodwin
eeef2ae6e9 Merge pull request #105 from jumanjiman/python3
prepare for python3 compatibility
2014-03-03 08:30:53 -04:00
Devan Goodwin
0ccb1f8e21 Merge pull request #108 from stpierre/version-template-docs
Improved docs for [version_template] section of tito.props
2014-03-03 08:22:22 -04:00
Chris St. Pierre
a5d9bcc3ab Improved docs for [version_template] section of tito.props 2014-02-28 16:42:14 -05:00
Paul Morgan
2a58a9b8e7 allow empty dist tag in functional tests
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.
2014-02-28 19:07:53 +00:00
Paul Morgan
4e29304554 docs: createrepo is needed for functional tests 2014-02-28 15:38:25 +00:00
Paul Morgan
9f2c259c85 python 2.4 (rhel 5) does not support 'with...as' syntax
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
2014-02-28 15:38:25 +00:00
Paul Morgan
25c6f7f1e0 avoid ImportError in test suite on python 3
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/
2014-02-28 15:38:25 +00:00
Paul Morgan
2380fd81a0 add python 3.3 to travis-ci build matrix 2014-02-28 15:38:25 +00:00
Paul Morgan
22896be9ce add unit test and use print function for python3 compat
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.
2014-02-28 15:38:25 +00:00
Paul Morgan
03255001d6 add unit test and module compatibility lib
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
2014-02-28 15:38:25 +00:00
Paul Morgan
1182b13713 add unit tests and fix exception clause compatibility
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
2014-02-28 15:02:50 +00:00
Paul Morgan
1597d7956a add pep8 tests and fix lexical indentation for python3
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
2014-02-28 01:34:34 +00:00
Paul Morgan
7846ee875d add pep8 tests and fix redundant backslashes between brackets 2014-02-28 01:34:34 +00:00
Paul Morgan
4fe4ed4de7 add pep8 tests and fix statement errors 2014-02-28 01:34:34 +00:00
Paul Morgan
1a8ac66e06 add pep8 tests for import errors 2014-02-28 01:34:34 +00:00
Paul Morgan
97b29d6c35 add pep8 tests and fix blank line errors and warnings 2014-02-28 01:34:34 +00:00
Paul Morgan
1a772c5995 add pep8 tests and fix whitespace errors and warnings 2014-02-28 01:34:34 +00:00
Paul Morgan
5d336d0ce3 add pep8 tests for deprecated python usage 2014-02-27 21:22:05 +00:00
Paul Morgan
c108f6022a add pep8 tests for syntax errors 2014-02-27 21:22:05 +00:00
Paul Morgan
53f9a02442 avoid TB in nose tests if there is no tty
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.
2014-02-27 21:22:05 +00:00
Paul Morgan
3be5a2d1b6 provide config for editorconfig plugins
* If a dev adds an editorconfig plugin to their editor,
  automatically configure their editor for code style.

* Specify 4-space softtabs so new code will be compatible
  with Python 3.

* Put the same settings in .gitattributes so git diff
  highlights whitespace errors.
2014-02-27 21:22:05 +00:00
Paul Morgan
47a5cda981 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.

* 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
2014-02-27 21:13:40 +00:00
Devan Goodwin
4e902ddf93 Add more missing documentation to MANIFEST.in. 2014-02-27 15:48:38 -04:00
Devan Goodwin
c90ed288ae Merge branch 'add-asciidoc-to-sdist' of https://github.com/grosskur/tito into grosskur-add-asciidoc-to-sdist 2014-02-27 15:46:29 -04:00
Devan Goodwin
8d64e56b4e Fix bug with fetch builder source replacement. 2014-02-27 15:44:42 -04:00
Devan Goodwin
faded8fe3a Fix a problem with spec file.
Newline was causing a problem somehow, not sure what this one was.
2014-02-27 15:38:34 -04:00
Devan Goodwin
952157f245 Add a missing rpm macro to fetch builder. 2014-02-27 15:06:06 -04:00
Devan Goodwin
bd5a31b716 Assume a default fetch strategy. 2014-02-27 13:27:09 -04:00
Devan Goodwin
52d1a59c58 Markdown fixes. 2014-02-27 12:34:04 -04:00
Devan Goodwin
2ad5b03cc4 Add markdown docs for FetchBuilder instead of manpage. 2014-02-27 12:26:17 -04:00
Devan Goodwin
49d7d20de9 Add some documentation for FetchBuilder. 2014-02-27 12:02:50 -04:00
Devan Goodwin
8342529dd9 Fix releasers and respect offline flag. 2014-02-27 11:46:00 -04:00
Devan Goodwin
9474b0ab95 Support release with fetch builder. 2014-02-26 15:58:58 -04:00
Devan Goodwin
a6d71534bb Add support for passing builder args through a releaser. 2014-02-26 14:52:56 -04:00
Devan Goodwin
1535850328 More testing. 2014-02-03 15:59:26 -04:00
Alan Grosskurth
71345eeec8 MANIFEST.in: include README.mkd and asciidoc files
When `python setup.py sdist` is run to generate a source tarball for
`rpmbuild`, it currently doesn't include some key files which causes
`rpmbuild` to fail. So add these to `MANIFEST.in`.
2014-01-19 15:51:10 -08:00
Devan Goodwin
922c0f2850 Rename --builder-arg to just --arg in build command. 2014-01-16 14:52:55 -04:00
Devan Goodwin
e1a0017144 Rename to FetchBuilder. 2014-01-15 16:17:02 -04:00