databio / pypiper

Python toolkit for building restartable pipelines
http://pypiper.databio.org
BSD 2-Clause "Simplified" License
45 stars 9 forks source link

Test errors #146

Closed vreuter closed 5 years ago

vreuter commented 5 years ago

I'm hitting some snags when running tests. On 2.7.12, I get this:

(py2) ~/code/pypiper (dev) $ pytest
ImportError while loading conftest '/home/vpr9v/code/pypiper/tests/conftest.py'.
../../venvs/py2/local/lib/python2.7/site-packages/six.py:709: in exec_
    exec("""exec _code_ in _globs_, _locs_""")
tests/conftest.py:9: in <module>
    from pypiper import Pipeline, PipelineManager, Stage
pypiper/__init__.py:2: in <module>
    from .manager import *
E     File "/home/vpr9v/code/pypiper/pypiper/manager.py", line 1925
E       mem_use_str = subprocess.check_output(cmd, shell=True).decode().print()
E                                                                           ^
E   SyntaxError: invalid syntax

(most recently changed in https://github.com/databio/pypiper/commit/d27968b103e454c52f033b82c3f496a968cfe2da)

And on 3.6.7, there are errors like this:

>           if "" != str(gitvars['pypiper_diff'].decode()):
E           AttributeError: 'str' object has no attribute 'decode'

pypiper/manager.py:480: AttributeError
-

(most recently changed in https://github.com/databio/pypiper/commit/f6653a13e15626c4340c0349db7d0fab4ce5148e)

nsheff commented 5 years ago

alright, I didn't do a good job of making sure my python3 upgrades didn't break python2...

that check_output change is a real pain.

nsheff commented 5 years ago

hmm for the python3 one I can't explain that I'll have to look at that...it has been working for me...

vreuter commented 5 years ago

hmm for the python3 one I can't explain that I'll have to look at that...it has been working for me...

We may have different versions...I ran this locally (3.6.7)

vreuter commented 5 years ago

alright, I didn't do a good job of making sure my python3 upgrades didn't break python2...

that check_output change is a real pain.

Sorry, should've maybe self-assigned...I didn't mean to raise this and point to those commits to suggest you should look into it--I can do it, and it'd probably be good for me to learn a bit about some of these type-related differences between the major versions--I just wanted note the commits as sort of bookmarks if I look back to tweak the tests and/or main code to get them to pass