Related to #20
Allow to install and use MicrobeCensus in Python3. Unittests run ok for Python 2.7.15 and Python 3.5.5.
$ python tests/test_microbe_census.py
...
----------------------------------------------------------------------
Ran 3 tests in 36.410s
OK
Details
There were only two problems with Python 3:
in setup.py, octal number were defined as 0555 and 07777. Since Python 2.6, one shall use 0o555 and 0o7777. The old notation is no longer accepted in Python 3.
in microbe_census.py, the error from process.communicate() was not decoded (apparently it returns a byte-like object in Python 3, that you have to decode() into a string)
Also in Python 3, tests/test_microbe_census.py was complaining about unclosed files (lot of warnings). I fixed the code so all opened files are properly closed when no longer used.
Finally, tests/test_microbe_census.py and microbe_census/microbe_census.py presented a mix of tab and 4-space indentations. I converted everything to 4-space indentation.
Related to #20 Allow to install and use MicrobeCensus in Python3. Unittests run ok for Python 2.7.15 and Python 3.5.5.
Details
There were only two problems with Python 3:
setup.py
, octal number were defined as0555
and07777
. Since Python 2.6, one shall use0o555
and0o7777
. The old notation is no longer accepted in Python 3.microbe_census.py
, the error from process.communicate() was not decoded (apparently it returns a byte-like object in Python 3, that you have todecode()
into a string)Also in Python 3,
tests/test_microbe_census.py
was complaining about unclosed files (lot of warnings). I fixed the code so all opened files are properly closed when no longer used.Finally,
tests/test_microbe_census.py
andmicrobe_census/microbe_census.py
presented a mix of tab and 4-space indentations. I converted everything to 4-space indentation.Best, Nils