dgoodwin/tito — pull request #111 by jumanjiman (2014-03-10 15:39:44+00:00)
Title: alpha support for python3

full tito test suite now passes on...

* python 2.4 with centos-5.9
* python 2.6 with centos-6.4
* python 2.7 with fedora-20
* python 3.3 with fedora-20

support is alpha since some code paths are not exercised in the test suite.
exception handlers come to mind.

## my test method

i tested using docker images created from [these titotest-* dockerfiles](https://github.com/jumanjiman/dockerfiles),
and i ran the tests both on rhel-6.5 with realtime kernel and on coreos.

my branch commits at the moment:

```
$ git ahead
4138dd7 avoid TB on python3 due to strict dict type
051f99b avoid TB on python3 due to encoding within subprocess pipeline
6701183 avoid TB on python3 due to git format string
99070ab StringIO is part of io in python3
```

pull static docker images:

```
$ images="centos-5.9 centos-6.4 fedora-20"
$ for image in $images; do sudo docker pull jumanjiman/titotest-$image:latest; done
Pulling repository jumanjiman/titotest-centos-5.9
-snip-
0d31af367d48: Download complete
Pulling repository jumanjiman/titotest-centos-6.4
-snip-
10fe86eac89b: Download complete
Pulling repository jumanjiman/titotest-fedora-20
-snip-
b2f84b42108b: Download complete
```

run python2 tests:

```
$ for image in $images; do
> sudo docker run --rm -i -t -v $PWD:/home/sandbox:ro jumanjiman/titotest-$image ./runtests.py
> done
Using Python 2.4
Using nose 0.1
Running tito tests against: /home/sandbox/src
.....................Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
...........................................
----------------------------------------------------------------------
Ran 64 tests in 11.523s
OK
Using Python 2.6
Using nose 0.1
Running tito tests against: /home/sandbox/src
.....................Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
...........................................
----------------------------------------------------------------------
Ran 64 tests in 12.106s
OK
Using Python 2.7
Using nose 1.3
Running tito tests against: /home/sandbox/src
.....................Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
...........................................
----------------------------------------------------------------------
Ran 64 tests in 13.098s
OK
```

run python3 tests on fedora-20

```
$ sudo docker run --rm -i -t -v $PWD:/home/sandbox:ro jumanjiman/titotest-fedora-20 python3 ./runtests.py
Using Python 3.3
Using nose 1.3
Running tito tests against: /home/sandbox/src
.....................Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
Warning: spacewalk.releng.* namespace in tito.props is obsolete. Use tito.* instead.
...........................................
----------------------------------------------------------------------
Ran 64 tests in 13.581s
OK
```

## remaining challenges

* test further code paths by building a variety of packages with tito from this branch
* figure out how to require rpm-python3 but only if user has python3 on system
(subpackage?)
* make sure the code doesn't smell