Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] update python 3.0 for vsc-base #258

Closed
wants to merge 25 commits into from
Closed

[WIP] update python 3.0 for vsc-base #258

wants to merge 25 commits into from

Conversation

vsoch
Copy link

@vsoch vsoch commented May 9, 2018

Here are the minimal changes to vsc-base to have python 3 support, related to hpcugent/vsc-install#83. Again, I only did a test with:

python setup.py test

after having installed vsc-install from the other branch! I will add comments on areas I wasn't sure about.

@@ -138,7 +138,7 @@ def number(self, otherdate):
def get_other(self, shift=-1):
"""Return month that is shifted shift months: negative integer is in past, positive is in future"""
new = self.date.year * 12 + self.date.month - 1 + shift
return self.__class__(date(new // 12, new % 12 + 1, 01))
return self.__class__(date(new // 12, new % 12 + 1, 1))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line, specifically the 01

return self.__class__(date(new // 12, new % 12 + 1, 01))

wasn't clear to me why it would be used instead of 1?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a good reason for the 01, it's exactly the same as 1...

Maybe because this refers to 1st day of the month? Dunno, but changing it to 1 seems fine to me.

We could double-check that this is covered by the tests to make sure changing it is OK, but I don't see how it could have any impact (famous last words!).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In python2 01 is the octal representation for 1, this is deprecated in python3 (should be 0o1)

If the 01 is needed for programatic reasons here, replace it with 0o1 instead of 1 (but I can't see a reason why it would make a difference)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh interesting! I didn't know this, but it looks like the 1 should be equivalent to 0o1 (see here https://bugs.python.org/issue1715302). And here is a confirmation (in Python 3) that the two produce the same result:

In [8]: datetime.date(2007, 5, 0o1)
Out[8]: datetime.date(2007, 5, 1)

In [9]: datetime.date(2007, 5, 1)
Out[9]: datetime.date(2007, 5, 1)

if hasattr(logging,'_levelNames'):
logging._levelNames['EXCEPTION'] = logging.ERROR
logging._levelNames['FATAL'] = logging.CRITICAL
logging._levelNames['QUIET'] = logging.WARNING

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find this in the logging 3.0 docs, so I'm guessing it is relevant only to some older version and we can just check and pass over if the data structure doesn't exist?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python 2.7, there's this:

>>> import logging
>>> logging._levelNames
{0: 'NOTSET', 10: 'DEBUG', 'WARN': 30, 20: 'INFO', 'ERROR': 40, 'DEBUG': 10, 30: 'WARNING', 'INFO': 20, 'WARNING': 30, 40: 'ERROR', 50: 'CRITICAL', 'CRITICAL': 50, 'NOTSET': 0}

We are defining additional log levels here, which we are injecting in the _levelNames (hidden) dictionary.

I guess we'll need to figure out what the equivalent approach is in Python 3?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want this https://docs.python.org/3/library/logging.html#logging.addLevelName and with the print you gave me above, I think all I need is that (the name and the level) for each of the new levels. Let me test it out.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3 has levelToName as well:

import logging

In [2]: logging._levelToName
Out[2]: 
{0: 'NOTSET',
 10: 'DEBUG',
 20: 'INFO',
 30: 'WARNING',
 40: 'ERROR',
 50: 'CRITICAL'}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In [1]: import logging

In [2]: logging._levelToName
Out[2]: 
{0: 'NOTSET',
 10: 'DEBUG',
 20: 'INFO',
 30: 'WARNING',
 40: 'ERROR',
 50: 'CRITICAL'}

In [3]: logging.addLevelName(logging.CRITICAL,'PINKYANDTHEBRAIN')

In [4]: logging._levelToName
Out[4]: 
{0: 'NOTSET',
 10: 'DEBUG',
 20: 'INFO',
 30: 'WARNING',
 40: 'ERROR',
 50: 'PINKYANDTHEBRAIN'}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to replace it, which isn't what we want. I'm going to look into adding a custom level.

@boegel
Copy link
Member

boegel commented May 9, 2018

@vsoch tests failing on our Jenkins CI server:

======================================================================
FAIL: test_optcomplete (test.generaloption.GeneralOptionTest)
Test optcomplete support
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/generaloption.py", line 713, in test_optcomplete
    self.assertEqual(ec, 0, msg="simple_option.py test script ran success")
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: simple_option.py test script ran success: 1 != 0:
DIFF:
- 1

======================================================================
FAIL: test_qa_list_of_answers (test.run.TestRun)
Test qa with list of answers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 194, in test_qa_list_of_answers
    self.assertEqual(ec, 0)
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: 2 != 0:
DIFF:
- 2

======================================================================
FAIL: test_qa_noqa (test.run.TestRun)
Test noqa
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 180, in test_qa_noqa
    self.assertEqual(ec, RUNRUN_QA_MAX_MISS_EXITCODE)
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: 2 != 124:
DIFF:
- 2

======================================================================
FAIL: test_qa_regex (test.run.TestRun)
Test regex based q and a (works only for qa_reg)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 171, in test_qa_regex
    self.assertEqual(ec, 0)
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: 2 != 0:
DIFF:
- 2

======================================================================
FAIL: test_qa_simple (test.run.TestRun)
Simple testing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 157, in test_qa_simple
    self.assertEqual(ec, 0)
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: 2 != 0:
DIFF:
- 2

======================================================================
FAIL: test_simple (test.run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 71, in test_simple
    self.assertEqual(ec, 0)
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: 2 != 0:
DIFF:
- 2

======================================================================
FAIL: test_simple_asyncloop (test.run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 76, in test_simple_asyncloop
    self.assertEqual(ec, 0)
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: 2 != 0:
DIFF:
- 2

======================================================================
FAIL: test_timeout (test.run.TestRun)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 86, in test_timeout
    self.assertEqual(ec, RUNRUN_TIMEOUT_EXITCODE, msg='longsleep stopped due to timeout')
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/testing.py", line 80, in assertEqual
    raise AssertionError("%s:\nDIFF%s:\n%s" % (msg, limit, ''.join(diff[:self.ASSERT_MAX_DIFF])))
AssertionError: longsleep stopped due to timeout: 2 != 123:
DIFF:
- 2

======================================================================
FAIL: test_import_packages (vsc.install.commontest.CommonTest)
Try to import each namespace
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/commontest.py", line 169, in test_import_packages
    msg='check_header of %s' % fn)
AssertionError: True is not false : check_header of lib/vsc/__init__.py

======================================================================
FAIL: test_importscripts (vsc.install.commontest.CommonTest)
Try to import each python script as a module
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/commontest.py", line 186, in test_importscripts
    msg='check_header of %s' % scr)
AssertionError: True is not false : check_header of bin/logdaemon.py

======================================================================
FAIL: test_prospector (vsc.install.commontest.CommonTest)
Run prospector.run.main, but apply white/blacklists to the results
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/commontest.py", line 239, in test_prospector
    self.assertFalse(failures, "prospector failures: %s" % pprint.pformat(failures))
AssertionError: [{'source': 'pylint', 'message': "Parameters differ from overridden 'print_help' method", 'code': 'arguments-differ', 'location': {'function': 'ExtOptionParser.print_help', 'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/generaloption.py', 'line': 686, 'character': 4, 'module': 'vsc.utils.generaloption'}}, {'source': 'pylint', 'message': "Unused variable 'tb'", 'code': 'unused-variable', 'location': {'function': 'logToFile', 'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/fancylogger.py', 'line': 589, 'character': 25, 'module': 'vsc.utils.fancylogger'}}, {'source': 'pylint', 'message': 'No exception type(s) specified', 'code': 'bare-except', 'location': {'function': None, 'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/run.py', 'line': 68, 'character': 0, 'module': 'vsc.utils.run'}}, {'source': 'pylint', 'message': "Redefining built-in 'basestring'", 'code': 'redefined-builtin', 'location': {'function': None, 'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/run.py', 'line': 69, 'character': 4, 'module': 'vsc.utils.run'}}, {'source': 'pylint', 'message': "Parameters differ from overridden '__getitem__' method", 'code': 'arguments-differ', 'location': {'function': 'FrozenDictKnownKeys.__getitem__', 'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/missing.py', 'line': 261, 'character': 4, 'module': 'vsc.utils.missing'}}] is not false : prospector failures: [{'code': 'arguments-differ',
  'location': {'character': 4,
               'function': 'ExtOptionParser.print_help',
               'line': 686,
               'module': 'vsc.utils.generaloption',
               'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/generaloption.py'},
  'message': "Parameters differ from overridden 'print_help' method",
  'source': 'pylint'},
 {'code': 'unused-variable',
  'location': {'character': 25,
               'function': 'logToFile',
               'line': 589,
               'module': 'vsc.utils.fancylogger',
               'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/fancylogger.py'},
  'message': "Unused variable 'tb'",
  'source': 'pylint'},
 {'code': 'bare-except',
  'location': {'character': 0,
               'function': None,
               'line': 68,
               'module': 'vsc.utils.run',
               'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/run.py'},
  'message': 'No exception type(s) specified',
  'source': 'pylint'},
 {'code': 'redefined-builtin',
  'location': {'character': 4,
               'function': None,
               'line': 69,
               'module': 'vsc.utils.run',
               'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/run.py'},
  'message': "Redefining built-in 'basestring'",
  'source': 'pylint'},
 {'code': 'arguments-differ',
  'location': {'character': 4,
               'function': 'FrozenDictKnownKeys.__getitem__',
               'line': 261,
               'module': 'vsc.utils.missing',
               'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/missing.py'},
  'message': "Parameters differ from overridden '__getitem__' method",
  'source': 'pylint'}]

----------------------------------------------------------------------
Ran 94 tests in 37.953s

FAILED (failures=11, skipped=1)
Test failed: <unittest.runner.TextTestResult run=94 errors=0 failures=11>
error: Test failed: <unittest.runner.TextTestResult run=94 errors=0 failures=11>

@vsoch
Copy link
Author

vsoch commented May 9, 2018

how can I reproduce these locally?

@boegel
Copy link
Member

boegel commented May 9, 2018

It's a bit strange you're not seeing these fail with python setup.py test... Several of them have probably little to do with your changes though, and will be fixed when #257 gets merged.

So maybe you should rebase your branch on top of #257?

@vsoch
Copy link
Author

vsoch commented May 9, 2018

That's a good idea @boegel - I'll wait for #257 and then rebase and then give this another shot!

@stdweird
Copy link
Member

stdweird commented May 9, 2018

@vsoch i merged #257 rebase and do not forget to bump the version in setup.py

@vsoch
Copy link
Author

vsoch commented May 9, 2018

okay I was able to rebase and get it working in python2, now I'm hitting another level of errors (for Python 3) so will work on this a bit and update the PR after I make the changes! Stay tuned!

@vsoch
Copy link
Author

vsoch commented May 10, 2018

heyo! Just a heads up there are more tweaks that need to be done for Python3 (I'm finding as I test easybuild) I'll commit and push in chunks, so expect more updates to this PR. I'll change the name to reflect this.

@vsoch vsoch changed the title update python 3.0 for vsc-base [WIP] update python 3.0 for vsc-base May 10, 2018
@stdweird
Copy link
Member

@vsoch thanks for al the patches, but how are you doing this migration? just trial and error?

we had the idea to add 2 tests to vsc-install: a pylint py3k test and something with python-modernize, and fix most code with python-modernize. (we have around 50 python repos based on vsc-install to port 😉 )

we haven't started this work because this is not a priority by far (i guess rhel7 will have py2 support for the rest of its lifetime, and i'm quite certain rhel8 will ship some py2 version whenever it comes out)

i would be very nice to know if the tools at https://portingguide.readthedocs.io/en/latest/tools.html can help you out with the current fixes (in particular python-modernize); that would be very valuable feedback for us.

@vsoch
Copy link
Author

vsoch commented May 10, 2018

hey @stdweird ! I'm aware of these helper tools, but to be honest I'm uncomfortable with applying some black box script to an entire code base. I want to step through each test / function and see the error, and then look up and decide what is the simplest solution to fix it. For these repos, given the dependency, this means sometimes stepping back and doing another fix to one of the vsc modules (while updating python3 for easybuild, for example).

It's ok that it hasn't been a priority! That's one of the ways I can help :) I think minimally there are a lot of users that would like to use something like easybuild and really want/need python3. Without that compatibility, you lose many off the bat. And you know, what happens when python 4 comes out? We have to keep up!

@boegel
Copy link
Member

boegel commented May 10, 2018

@vsoch The last chunk of changes, are those issues you are hitting when trying to run EasyBuild (tests) on top of Python 3?

If that are issues that aren't covered by the vsc-base tests, that's probably something we should take care of too (I'm not implying here you should do it, let me be clear)...

@boegel
Copy link
Member

boegel commented May 10, 2018

Current failing tests:

======================================================================
ERROR: test_frozendictknownkeys (test.missing.TestMissing)
Tests for FrozenDictKnownKeys.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/missing.py", line 206, in test_frozendictknownkeys
    (FrozenDictKnownKeys(), {}), # no arguments => empty dictionary
  File "lib/vsc/utils/missing.py", line 262, in __init__
    super(FrozenDictKnownKeys, self).__init__(tmpdict)
TypeError: must be type, not classobj

======================================================================
ERROR: test_qa_list_of_answers (test.run.TestRun)
Test qa with list of answers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 209, in test_qa_list_of_answers
    ec, output = run_qas([sys.executable, SCRIPT_QA, 'ask_number', '4'], qa=qa_dict)
  File "lib/vsc/utils/run.py", line 114, in run
    return r._run()
  File "lib/vsc/utils/run.py", line 219, in _run
    self._wait_for_process()
  File "lib/vsc/utils/run.py", line 524, in _wait_for_process
    self._loop_process_output(output)
  File "lib/vsc/utils/run.py", line 866, in _loop_process_output
    self._process_module.send_all(self._process, answer)
  File "lib/vsc/utils/asyncprocess.py", line 190, in send_all
    sent = p.send(data)
  File "lib/vsc/utils/asyncprocess.py", line 111, in send
    with open(self.stdin.fileno(), 'w') as filey:
TypeError: coercing to Unicode: need string or buffer, int found

======================================================================
ERROR: test_qa_noqa (test.run.TestRun)
Test noqa
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 200, in test_qa_noqa
    ec, output = run_qas([sys.executable, SCRIPT_QA, 'waitforit'], qa=qa_dict, no_qa=no_qa)
  File "lib/vsc/utils/run.py", line 114, in run
    return r._run()
  File "lib/vsc/utils/run.py", line 219, in _run
    self._wait_for_process()
  File "lib/vsc/utils/run.py", line 524, in _wait_for_process
    self._loop_process_output(output)
  File "lib/vsc/utils/run.py", line 866, in _loop_process_output
    self._process_module.send_all(self._process, answer)
  File "lib/vsc/utils/asyncprocess.py", line 190, in send_all
    sent = p.send(data)
  File "lib/vsc/utils/asyncprocess.py", line 111, in send
    with open(self.stdin.fileno(), 'w') as filey:
TypeError: coercing to Unicode: need string or buffer, int found

======================================================================
ERROR: test_qa_regex (test.run.TestRun)
Test regex based q and a (works only for qa_reg)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 186, in test_qa_regex
    ec, output = run_qas([sys.executable, SCRIPT_QA, 'whattime'], qa_reg=qa_dict)
  File "lib/vsc/utils/run.py", line 114, in run
    return r._run()
  File "lib/vsc/utils/run.py", line 219, in _run
    self._wait_for_process()
  File "lib/vsc/utils/run.py", line 524, in _wait_for_process
    self._loop_process_output(output)
  File "lib/vsc/utils/run.py", line 866, in _loop_process_output
    self._process_module.send_all(self._process, answer)
  File "lib/vsc/utils/asyncprocess.py", line 190, in send_all
    sent = p.send(data)
  File "lib/vsc/utils/asyncprocess.py", line 111, in send
    with open(self.stdin.fileno(), 'w') as filey:
TypeError: coercing to Unicode: need string or buffer, int found

======================================================================
ERROR: test_qa_simple (test.run.TestRun)
Simple testing
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/run.py", line 178, in test_qa_simple
    ec, output = run_qas([sys.executable, SCRIPT_QA, 'simple'], qa=qa_dict)
  File "lib/vsc/utils/run.py", line 114, in run
    return r._run()
  File "lib/vsc/utils/run.py", line 219, in _run
    self._wait_for_process()
  File "lib/vsc/utils/run.py", line 524, in _wait_for_process
    self._loop_process_output(output)
  File "lib/vsc/utils/run.py", line 866, in _loop_process_output
    self._process_module.send_all(self._process, answer)
  File "lib/vsc/utils/asyncprocess.py", line 190, in send_all
    sent = p.send(data)
  File "lib/vsc/utils/asyncprocess.py", line 111, in send
    with open(self.stdin.fileno(), 'w') as filey:
TypeError: coercing to Unicode: need string or buffer, int found

======================================================================
ERROR: runTest (test.asyncprocess.AsyncProcessTest)
try echoing some text and see if it comes back out
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/test/asyncprocess.py", line 58, in runTest
    p.send_all(self.shell, "echo hello\n")
  File "lib/vsc/utils/asyncprocess.py", line 190, in send_all
    sent = p.send(data)
  File "lib/vsc/utils/asyncprocess.py", line 111, in send
    with open(self.stdin.fileno(), 'w') as filey:
TypeError: coercing to Unicode: need string or buffer, int found

======================================================================
FAIL: test_prospector (vsc.install.commontest.CommonTest)
Run prospector.run.main, but apply white/blacklists to the results
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/.local/lib/python2.7/site-packages/vsc_install-0.10.32-py2.7.egg/vsc/install/commontest.py", line 239, in test_prospector
    self.assertFalse(failures, "prospector failures: %s" % pprint.pformat(failures))
AssertionError: [{'source': 'pylint', 'message': "Unused variable 'filey'", 'code': 'unused-variable', 'location': {'function': 'Popen.send', 'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/asyncprocess.py', 'line': 111, 'character': 51, 'module': 'vsc.utils.asyncprocess'}}] is not false : prospector failures: [{'code': 'unused-variable',
  'location': {'character': 51,
               'function': 'Popen.send',
               'line': 111,
               'module': 'vsc.utils.asyncprocess',
               'path': u'/var/lib/jenkins/jobs/hpc ugent github.com/jobs/vsc-base/branches/PR-258/workspace/lib/vsc/utils/asyncprocess.py'},
  'message': "Unused variable 'filey'",
  'source': 'pylint'}]

----------------------------------------------------------------------
Ran 96 tests in 59.356s

FAILED (failures=1, errors=6, skipped=1)
Test failed: <unittest.runner.TextTestResult run=96 errors=6 failures=1>
error: Test failed: <unittest.runner.TextTestResult run=96 errors=6 failures=1>

@vsoch
Copy link
Author

vsoch commented May 10, 2018

yep, but if the fixes are done with vep, then they won't be issues. But you are correct if a user has installed an older version of vep (or two versions, as I had at one point) you will see the bugs pop up.

@vsoch
Copy link
Author

vsoch commented May 10, 2018

Thanks, on these new issues!

@vsoch
Copy link
Author

vsoch commented May 11, 2018

hey @boegel I'm at a loss here - the tests start running and just hang, and it almost has to be the functions that are reimplementing subprocess. Is that really necessary? A lot of this functionality could be improved simply by using core python modules that do these basic things very well.

@boegel
Copy link
Member

boegel commented May 12, 2018

@vsoch Which tests/functions are hanging for you? Are you referring to the functions provided by vsc.utils.run?

@boegel
Copy link
Member

boegel commented May 12, 2018

Tests now fail with

pkg_resources.DistributionNotFound: The 'vsc-install>=0.11.0' distribution was not found and is required by the application

which means this is blocked by hpcugent/vsc-install#83...

@boegel boegel mentioned this pull request May 12, 2018
@JensTimmerman
Copy link
Contributor

JensTimmerman commented May 14, 2018

@vsoch we wrote a lot of this code to have nice subprocessing, logging and option parsing in python 2.4.
So yes, with newer additions to python in 2.5 and 2.6 a lot of this code could actually be made a lot simpler by using code in the standard python libraries. But we have to be careful not to break any backwards compatibility, or spend a lot more time on porting our 50 (lots of non public) other repositories that use vsc-install and vsc-base code to python3.

@vsoch
Copy link
Author

vsoch commented May 18, 2018

oups scratch the last comment, you already did! :)

@vsoch
Copy link
Author

vsoch commented May 25, 2018

okay tests are running! Now we can see (in this running version) when we hit the run.py test with simply.py how it is essentially an infinite loop:

PYTHONPATH=lib/ python3 setup.py test
INFO: This is (based on) vsc.install.shared_setup 0.11.00
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
WARN: cleanup lib/vsc_base.egg-info
INFO: initial packages list: dict_keys(['vsc', 'vsc.utils'])
INFO: generated list: dict_keys(['vsc', 'vsc.utils'])
INFO: generated packages list: dict_keys(['vsc', 'vsc.utils'])
INFO: makesetupcfg set to True, (re)creating setup.cfg
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: setting license LGPLv2+
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: Removing None download_url
INFO: get_name_url returns {'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: using long_description Common tools used within our organization. Originally created by the HPC team of Ghent University (http://ugent.be/hpc).
INFO: generated list: ['bin/logdaemon.py', 'bin/optcomplete.bash', 'bin/startlogdaemon.sh']
INFO: generated scripts list: ['bin/logdaemon.py', 'bin/optcomplete.bash', 'bin/startlogdaemon.sh']
INFO: adding prospector to tests_require
{'license': 'LGPLv2+', 'maintainer': 'Stijn De Weirdt;Jens Timmerman;Andy Georges;Kenneth Hoste', 'maintainer_email': 'stijn.deweirdt@ugent.be, jens.timmerman@ugent.be, andy.georges@ugent.be, kenneth.hoste@ugent.be', 'package_dir': {'': 'lib'}, 'packages': dict_keys(['vsc', 'vsc.utils']), 'install_requires': ['vsc-install >= 0.11.00'], 'extras_require': {'coloredlogs': ['coloredlogs<6.0', 'humanfriendly']}, 'url': 'https://github.com/hpcugent/vsc-base', 'author_email': 'stijn.deweirdt@ugent.be, jens.timmerman@ugent.be, andy.georges@ugent.be, kenneth.hoste@ugent.be', 'setup_requires': ['vsc-install >= 0.11.00'], 'scripts': ['bin/logdaemon.py', 'bin/optcomplete.bash', 'bin/startlogdaemon.sh'], 'description': 'Common tools used within our organization. Originally created by the HPC team of Ghent University (http://ugent.be/hpc).', 'command_packages': ['vsc.install.shared_setup', 'shared_setup_dist_only', 'setuptools.command', 'distutils.command'], 'name': 'vsc-base', 'long_description': "# vsc-base\n\n### Build Status\n\n- Python 2.6 : [![Build Status](https://jenkins1.ugent.be/job/vsc-base-python26/badge/icon)](https://jenkins1.ugent.be/job/vsc-base-python26/)\n- Python 2.7 : [![Build Status](https://jenkins1.ugent.be/job/vsc-base-python27/badge/icon)](https://jenkins1.ugent.be/job/vsc-base-python27/)\n\n# Description\n\nCommon tools used within our organization.\nOriginally created by the HPC team of Ghent University (http://ugent.be/hpc).\n\n# Documentation\nhttps://jenkins1.ugent.be/job/vsc-base-python26/Documentation/\n\n# Namespaces and tools\n\n## lib/utils\npython utilities to be used as libraries\n\n- __fancylogger__: an extention of the default python logger designed to be easy to use and have a\ncouple of `fancy` features.\n - custom specifiers for mpi loggin (the mpirank) with autodetection of mpi\n - custom specifier for always showing the calling function's name\n - rotating file handler\n - a default formatter.\n - logging to an UDP server (logdaemon.py f.ex.)\n - easily setting loglevel\n- __daemon.py__ : Daemon class written by Sander Marechal (http://www.jejik.com) to start a python script as a daemon.\n- __missing.py__: Small functions and tools that are commonly used but not\n  available in the Python (2.x) API.\n- ~~__cache.py__ : File cache to store pickled data identified by a key accompanied by a timestamp.~~ (moved to [vsc-utils](https://github.com/hpcugent/vsc-utils))\n- __generaloption.py__ : A general option parser for python. It will fetch options (in this order) from config files, from environment variables and from the command line and parse them in a way compatible with the default python optionparser. Thus allowing a very flexible way to configure your scripts.\nIt also adds a few other useful extras.\n- __affinity.py__ : Linux cpu affinity.\n - Based on `sched.h` and `bits/sched.h`,\n - see man pages for `sched_getaffinity` and `sched_setaffinity`\n - also provides a `cpuset` class to convert between human readable cpusets and the bit version Linux priority\n - Based on sys/resources.h and bits/resources.h see man pages for `getpriority` and `setpriority`\n- __asyncprocess.py__ : Module to allow Asynchronous subprocess use on Windows and Posix platforms\n - Based on a [python recipe](http://code.activestate.com/recipes/440554/) by Josiah Carlson\n - added STDOUT handle and recv_some\n- __daemon.py__ : [A generic daemon class by Sander Marechal](http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)\n- __dateandtime.py__ : A module with various convenience functions and classes to deal with date, time and timezone.\n- __nagios.py__ : This module provides functionality to cache and report results of script executions that can readily be\ninterpreted by nagios/icinga.\n- __run.py__ : Python module to execute a command, can make use of asyncprocess, answer questions based on a dictionary\n - supports a whole lot of ways to input, process and output the command. (filehandles, PIPE, pty, stdout, logging...)\n- __mail.py__ : Wrapper around the standard Python mail library.\n - Send a plain text message\n - Send an HTML message, with a plain text alternative\n\n## bin\nA collection of python scripts, these are examples of how you could use fancylogger to log to a daemon, but should not be used directly.\n- __logdaemon.py__: A daemon that listens on a port for udp packets and logs them to file, works toghether with fancylogger.\n- __startlogdaemon.py__ : Script that will start the logdaemon for  you and set environment variables for fancylogger.\n\n# License\nvsc-base is made available under the GNU Library General Public License (LGPL) version 2 or any later version.\n\n# Acknowledgements\nvsc-base was created with support of [Ghent University](http://www.ugent.be/en),\nthe [Flemish Supercomputer Centre (VSC)](https://vscentrum.be/nl/en),\nthe [Flemish Research Foundation (FWO)](http://www.fwo.be/en),\nand [the Department of Economy, Science and Innovation (EWI)](http://www.ewi-vlaanderen.be/en).\n\n", 'author': 'Stijn De Weirdt;Jens Timmerman;Andy Georges;Kenneth Hoste', 'dependency_links': ['git+ssh://git@github.ugent.be/hpcugent/vsc-install.git#egg=vsc-install-0.11.00', 'git+ssh://git@github.com/hpcugent/vsc-install.git#egg=vsc-install-0.11.00', 'git+https://github.com/hpcugent/vsc-install.git#egg=vsc-install-0.11.00', 'git+ssh://git@github.ugent.be/hpcugent/vsc-install.git#egg=vsc-install-0.11.00', 'git+ssh://git@github.com/hpcugent/vsc-install.git#egg=vsc-install-0.11.00', 'git+https://github.com/hpcugent/vsc-install.git#egg=vsc-install-0.11.00'], 'tests_require': ['prospector', 'coloredlogs<6.0', 'humanfriendly', 'prospector >= 0.12.1', 'pylint-django == 0.9.1'], 'download_url': '', 'namespace_packages': ['vsc'], 'test_suite': 'test', 'cmdclass': {'install_scripts': <class 'vsc.install.shared_setup.vsc_setup.vsc_install_scripts'>, 'egg_info': <class 'vsc.install.shared_setup.vsc_setup.vsc_egg_info'>, 'sdist': <class 'vsc.install.shared_setup.vsc_setup.vsc_sdist'>, 'vsc_release': <class 'vsc.install.shared_setup.vsc_setup.vsc_release'>, 'bdist_rpm': <class 'vsc.install.shared_setup.vsc_setup.vsc_bdist_rpm'>, 'test': <class 'vsc.install.shared_setup.vsc_setup.VscTestCommand'>}, 'classifiers': ['License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)'], 'version': '2.6.0'}
INFO: running test
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: test_loader set to vsc.install.shared_setup:vsc_setup.VscScanningLoader
INFO: Searching for pylint-django==0.9.1
INFO: Best match: pylint-django 0.9.1
INFO: Processing pylint_django-0.9.1-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pylint_django-0.9.1-py3.5.egg
INFO: Searching for prospector>=0.12.1
INFO: Best match: prospector 0.12.7
INFO: Processing prospector-0.12.7-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/prospector-0.12.7-py3.5.egg
INFO: Searching for humanfriendly
INFO: Best match: humanfriendly 4.12.1
INFO: Processing humanfriendly-4.12.1-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/humanfriendly-4.12.1-py3.5.egg
INFO: Searching for coloredlogs<6.0
INFO: Best match: coloredlogs 5.2
INFO: Processing coloredlogs-5.2-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/coloredlogs-5.2-py3.5.egg
INFO: Searching for pylint>=1.8.2
INFO: Best match: pylint 1.9.1
INFO: Processing pylint-1.9.1-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pylint-1.9.1-py3.5.egg
INFO: Searching for pylint-plugin-utils>=0.2.1
INFO: Best match: pylint-plugin-utils 0.2.6
INFO: Processing pylint_plugin_utils-0.2.6-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pylint_plugin_utils-0.2.6-py3.5.egg
INFO: Searching for pydocstyle>=2.0.0
INFO: Best match: pydocstyle 2.1.1
INFO: Processing pydocstyle-2.1.1-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pydocstyle-2.1.1-py3.5.egg
INFO: Searching for pep8-naming>=0.3.3
INFO: Best match: pep8-naming 0.7.0
INFO: Processing pep8_naming-0.7.0-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pep8_naming-0.7.0-py3.5.egg
INFO: Searching for pycodestyle==2.0.0
INFO: Best match: pycodestyle 2.0.0
INFO: Processing pycodestyle-2.0.0-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pycodestyle-2.0.0-py3.5.egg
INFO: Searching for mccabe>=0.5.0
INFO: Best match: mccabe 0.6.1
INFO: Processing mccabe-0.6.1-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/mccabe-0.6.1-py3.5.egg
INFO: Searching for dodgy>=0.1.9
INFO: Best match: dodgy 0.1.9
INFO: Processing dodgy-0.1.9-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/dodgy-0.1.9-py3.5.egg
INFO: Searching for setoptconf>=0.2.0
INFO: Best match: setoptconf 0.2.0
INFO: Processing setoptconf-0.2.0-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/setoptconf-0.2.0-py3.5.egg
INFO: Searching for requirements-detector>=0.4.1
INFO: Best match: requirements-detector 0.5.2
INFO: Processing requirements_detector-0.5.2-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/requirements_detector-0.5.2-py3.5.egg
INFO: Searching for pylint-common>=0.2.5
INFO: Best match: pylint-common 0.2.5
INFO: Processing pylint_common-0.2.5-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pylint_common-0.2.5-py3.5.egg
INFO: Searching for pylint-flask>=0.3
INFO: Best match: pylint-flask 0.5
INFO: Processing pylint_flask-0.5-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pylint_flask-0.5-py3.5.egg
INFO: Searching for pylint-celery>=0.3
INFO: Best match: pylint-celery 0.3
INFO: Processing pylint_celery-0.3-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pylint_celery-0.3-py3.5.egg
INFO: Searching for isort>=4.2.5
INFO: Best match: isort 4.3.4
INFO: Processing isort-4.3.4-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/isort-4.3.4-py3.5.egg
INFO: Searching for astroid<2.0,>=1.6
INFO: Best match: astroid 1.6.4
INFO: Processing astroid-1.6.4-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/astroid-1.6.4-py3.5.egg
INFO: Searching for flake8-polyfill<2,>=1.0.2
INFO: Best match: flake8-polyfill 1.0.2
INFO: Processing flake8_polyfill-1.0.2-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/flake8_polyfill-1.0.2-py3.5.egg
INFO: Searching for flake8
INFO: Best match: flake8 3.5.0
INFO: Processing flake8-3.5.0-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/flake8-3.5.0-py3.5.egg
INFO: Searching for pyflakes<1.7.0,>=1.5.0
INFO: Best match: pyflakes 1.6.0
INFO: Processing pyflakes-1.6.0-py3.5.egg
INFO: 
Using /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.eggs/pyflakes-1.6.0-py3.5.egg
INFO: running egg_info
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: creating lib/vsc_base.egg-info
INFO: writing namespace_packages to lib/vsc_base.egg-info/namespace_packages.txt
INFO: writing requirements to lib/vsc_base.egg-info/requires.txt
INFO: writing lib/vsc_base.egg-info/PKG-INFO
INFO: writing top-level names to lib/vsc_base.egg-info/top_level.txt
INFO: writing dependency_links to lib/vsc_base.egg-info/dependency_links.txt
INFO: writing manifest file 'lib/vsc_base.egg-info/SOURCES.txt'
INFO: reading manifest file 'lib/vsc_base.egg-info/SOURCES.txt'
INFO: reading manifest template 'MANIFEST.in'
WARN: warning: no files found matching 'vsc' under directory 'lib'
WARN: warning: no previously-included files matching '__pycache__' found anywhere in distribution
INFO: writing manifest file 'lib/vsc_base.egg-info/SOURCES.txt'
INFO: looking for extra dist files
INFO: running build_ext
test_import_modules (vsc.install.commontest.CommonTest)
Try to import each module ... INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
/home/vanessa/anaconda3/lib/python3.5/site-packages/vsc_install-0.11.0-py3.5.egg/vsc/install/shared_setup.py:437: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/lib/vsc/__init__.py' mode='r' encoding='UTF-8'>
  init = open(os.path.join(root, '__init__.py')).read()
/home/vanessa/anaconda3/lib/python3.5/site-packages/vsc_install-0.11.0-py3.5.egg/vsc/install/shared_setup.py:395: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.gitignore' mode='r' encoding='UTF-8'>
  all_patterns = [l for l in [l.strip() for l in open(gitignore).readlines()] if l and not l.startswith('#')]
/home/vanessa/anaconda3/lib/python3.5/site-packages/vsc_install-0.11.0-py3.5.egg/vsc/install/shared_setup.py:437: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/lib/vsc/utils/__init__.py' mode='r' encoding='UTF-8'>
  init = open(os.path.join(root, '__init__.py')).read()
INFO: generated list: dict_keys(['vsc.utils.docs', 'vsc.utils.generaloption', 'vsc.utils.dateandtime', 'vsc.utils.daemon', 'vsc.utils.mail', 'vsc.utils.wrapper', 'vsc.utils.missing', 'vsc.utils.asyncprocess', 'vsc.utils.optcomplete', 'vsc.utils.rest', 'vsc.utils.affinity', 'vsc.utils.exceptions', 'vsc.utils.run', 'vsc.utils.fancylogger', 'vsc.utils.testing', 'vsc.utils.run-old', 'vsc.utils.frozendict', 'vsc.utils.patterns', 'vsc.utils.runv2'])
INFO: generated modules list: dict_keys(['vsc.utils.docs', 'vsc.utils.generaloption', 'vsc.utils.dateandtime', 'vsc.utils.daemon', 'vsc.utils.mail', 'vsc.utils.wrapper', 'vsc.utils.missing', 'vsc.utils.asyncprocess', 'vsc.utils.optcomplete', 'vsc.utils.rest', 'vsc.utils.affinity', 'vsc.utils.exceptions', 'vsc.utils.run', 'vsc.utils.fancylogger', 'vsc.utils.testing', 'vsc.utils.run-old', 'vsc.utils.frozendict', 'vsc.utils.patterns', 'vsc.utils.runv2'])
ok
test_import_packages (vsc.install.commontest.CommonTest)
Try to import each namespace ... INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: initial packages list: dict_keys(['vsc', 'vsc.utils'])
INFO: generated list: dict_keys(['vsc', 'vsc.utils'])
INFO: generated packages list: dict_keys(['vsc', 'vsc.utils'])
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
/home/vanessa/anaconda3/lib/python3.5/site-packages/vsc_install-0.11.0-py3.5.egg/vsc/install/shared_setup.py:312: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config' mode='r' encoding='UTF-8'>
  txt = open(filename).read()
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: Header is an external compatible license. Leaving the header as-is.
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: Header is an external compatible license. Leaving the header as-is.
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
INFO: Header is an external compatible license. Leaving the header as-is.
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
ERROR: No begin/endyear found, using this year as begin (and end)
INFO: Diff header vs gen_header
+ #
+ # Copyright 2018-2018 Ghent University
+ #
+ # This file is part of vsc-base,
+ # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
+ # with support of Ghent University (http://ugent.be/hpc),
+ # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
+ # the Flemish Research Foundation (FWO) (http://www.fwo.be/en)
+ # and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en).
+ #
+ # https://github.com/hpcugent/vsc-base
+ #
+ # vsc-base is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU Library General Public License as
+ # published by the Free Software Foundation, either version 2 of
+ # the License, or (at your option) any later version.
+ #
+ # vsc-base is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ # GNU Library General Public License for more details.
+ #
+ # You should have received a copy of the GNU Library General Public License
+ # along with vsc-base. If not, see <http://www.gnu.org/licenses/>.

FAIL
test_importscripts (vsc.install.commontest.CommonTest)
Try to import each python script as a module ... INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: generated list: ['bin/logdaemon.py', 'bin/optcomplete.bash', 'bin/startlogdaemon.sh']
INFO: generated scripts list: ['bin/logdaemon.py', 'bin/optcomplete.bash', 'bin/startlogdaemon.sh']
INFO: get_header for script
INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: found match url git@github.com:hpcugent/vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: found match name vsc-base in /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/.git/config
INFO: reg found: ('github.com', 'hpcugent/vsc-base')
INFO: get_name_url returns {'download_url': 'https://github.com/hpcugent/vsc-base/archive/ALL_VERSIONS.tar.gz', 'url': 'https://github.com/hpcugent/vsc-base', 'name': 'vsc-base'}
INFO: found license /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/LICENSE with md5sum 5f30f0716dfdd0d91eb439ebec522ec2
INFO: Found license name LGPLv2+ and classifier License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
ok
test_prospector (vsc.install.commontest.CommonTest)
Run prospector.run.main, but apply white/blacklists to the results ... INFO: run_tests from base dir /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base (using executable /home/vanessa/Documents/Dropbox/Code/Python/easybuild/vsc-base/setup.py)
INFO: No protector tests are ran, install prospector manually first
ok
test_wrapper (test.wrapper.TestWrapper)
Use the tests provided by the stackoverflow page ... ok
test_env_to_boolean_false (test.fancylogger.EnvToBooleanTest) ... ok
test_env_to_boolean_true (test.fancylogger.EnvToBooleanTest) ... ok
test_env_to_boolean_undef_with_default (test.fancylogger.EnvToBooleanTest) ... ok
test_env_to_boolean_undef_without_default (test.fancylogger.EnvToBooleanTest) ... ok
test_logtofile (test.fancylogger.FancyLoggerLogToFileTest)
Test to see if logtofile doesn't fail when logging to a non existing file /directory ... ok
test_classname_in_log (test.fancylogger.FancyLoggerTest)
Do a log and check if the classname is correctly in it ... ERROR
test_deprecated (test.fancylogger.FancyLoggerTest)
Test deprecated log function. ... ERROR
test_fail (test.fancylogger.FancyLoggerTest)
Test fail log method. ... ERROR
test_fancylogger_as_rootlogger_logging (test.fancylogger.FancyLoggerTest) ... ERROR
test_fancyrecord (test.fancylogger.FancyLoggerTest) ... ERROR
test_getDetailsLogLevels (test.fancylogger.FancyLoggerTest) ... ERROR
test_getlevelint (test.fancylogger.FancyLoggerTest)
Test the getLevelInt ... ERROR
test_normal_warning_logging (test.fancylogger.FancyLoggerTest) ... ERROR
test_parentinfo (test.fancylogger.FancyLoggerTest)
Test the collection of parentinfo ... ERROR
test_raiseException (test.fancylogger.FancyLoggerTest)
Test raiseException log method. ... ERROR
test_stream_stdout_stderr (test.fancylogger.FancyLoggerTest) ... ERROR
ERROR
test_uft8_decoding (test.fancylogger.FancyLoggerTest)
Test UTF8 decoding. ... ERROR
test_colorize_always (test.fancylogger.ScreenLogFormatterFactoryTest) ... ok
test_colorize_auto_nontty (test.fancylogger.ScreenLogFormatterFactoryTest) ... ok
test_colorize_auto_tty (test.fancylogger.ScreenLogFormatterFactoryTest) ... FAIL
test_colorize_never (test.fancylogger.ScreenLogFormatterFactoryTest) ... ok
test_fixed_topological_sort (test.missing.TestMissing) ... ok
test_frozendictknownkeys (test.missing.TestMissing)
Tests for FrozenDictKnownKeys. ... FAIL
test_get_class_for (test.missing.TestMissing)
Test get_class_for. ... ok
test_get_subclasses (test.missing.TestMissing)
Test get_subclasses functions. ... ERROR
test_nub_length (test.missing.TestMissing) ... ok
test_nub_membership (test.missing.TestMissing) ... ok
test_nub_order (test.missing.TestMissing) ... ok
test_random_topological_sort (test.missing.TestMissing) ... ERROR
test_tryorfail_no_sleep (test.missing.TestMissing)
test for a retry that succeeds. ... ERROR
test_all_completer (test.optcomplete.OptcompleteTest)
Test the AllCompleter class ... ok
test_base_completer (test.optcomplete.OptcompleteTest)
Test the base Completer class ... ERROR
test_dir_completer (test.optcomplete.OptcompleteTest)
Test DirCompleter ... ok
test_extract_word (test.optcomplete.OptcompleteTest)
Test the extract_word function ... ok
test_file_completer (test.optcomplete.OptcompleteTest)
Test FileCompleter ... ERROR
test_gen_cmdline (test.optcomplete.OptcompleteTest)
Test generation of commndline ... ok
test_known_hosts_completer (test.optcomplete.OptcompleteTest)
Test KnownHostsCompleter ... ok
test_list_completer (test.optcomplete.OptcompleteTest)
Test ListCompleter class ... ERROR
test_none_completer (test.optcomplete.OptcompleteTest)
Test NoneCompleter class ... ERROR
test_regex_completer (test.optcomplete.OptcompleteTest)
Test RegexCompleter ... ERROR
test_configfiles (test.generaloption.GeneralOptionTest)
Test configfiles (base section for empty prefix from auto_section_name) ... ERROR
test_dest_with_dash (test.generaloption.GeneralOptionTest)
Test the renaming of long opts to dest ... ERROR
test_enable_disable (test.generaloption.GeneralOptionTest)
Test the enable/disable prefix ... ERROR
test_error_env_options (test.generaloption.GeneralOptionTest)
Test log error on unknown environment option ... ERROR
test_ext_add (test.generaloption.GeneralOptionTest)
Test add and add_first action ... ERROR
test_ext_add_multi (test.generaloption.GeneralOptionTest)
Test behaviour when 'add' options are used multiple times. ... ERROR
test_ext_date_datetime (test.generaloption.GeneralOptionTest)
Test date and datetime action ... ERROR
test_generate_cmdline (test.generaloption.GeneralOptionTest)
Test the creation of cmd_line args to match options ... ERROR
test_get_by_prefix (test.generaloption.GeneralOptionTest)
Test dict by prefix ... ERROR
test_get_options_by_property (test.generaloption.GeneralOptionTest)
Test get_options_by_property and firends like get_options_by_prefix ... ERROR
test_help (test.generaloption.GeneralOptionTest)
Generate (long) help message ... ERROR
test_help_confighelp (test.generaloption.GeneralOptionTest)
Generate long help message ... ERROR
test_help_long (test.generaloption.GeneralOptionTest)
Generate long help message ... ERROR
test_help_outputformats (test.generaloption.GeneralOptionTest)
Generate (long) rst help message ... ERROR
test_help_short (test.generaloption.GeneralOptionTest)
Generate short help message ... ERROR
test_is_value_a_commandline_option (test.generaloption.GeneralOptionTest)
Test ExtOptionParser is_value_a_commandline_option method ... ERROR
test_loggers (test.generaloption.GeneralOptionTest)
Test getloggers ... ok
test_loglevel (test.generaloption.GeneralOptionTest)
Test the loglevel default setting ... ERROR
test_multiple_init (test.generaloption.GeneralOptionTest)
Test behaviour when creating multiple instances of same GO class ... ERROR
test_nosuchoption (test.generaloption.GeneralOptionTest)
Test catching of non-existing options. ... ERROR
test_optcomplete (test.generaloption.GeneralOptionTest)
Test optcomplete support ... ERROR
test_option_as_value (test.generaloption.GeneralOptionTest)
Test how valid options being used as values are handled. ... ERROR
test_quote (test.generaloption.GeneralOptionTest)
Test quote/unquote ... ok
test_set_columns (test.generaloption.GeneralOptionTest)
Test set_columns function. ... ok
test_store_or_None (test.generaloption.GeneralOptionTest)
Test store_or_None action ... ERROR
test_str_list_tuple (test.generaloption.GeneralOptionTest)
Test strlist / strtuple type ... ERROR
test_assertErrorRegex (test.testing.TestTesting)
Tests for assertErrorRegex method. ... ERROR
test_capture_stdout_stderr (test.testing.TestTesting)
Test capturing of stdout. ... ok
test_convert_exception_to_str (test.testing.TestTesting)
Tests for convert_exception_to_str method. ... ok
test_mock_logmethod (test.testing.TestTesting)
Test the mocked cache logger ... ERROR
test_date_parser (test.dateandtime.DateAndTimeTest)
Test the date_parser ... ok
test_datetime_parser (test.dateandtime.DateAndTimeTest)
Test the date_parser ... ok
test_fancymonth (test.dateandtime.DateAndTimeTest)
Test some of the FancyMonth functions ... ok
test_client (test.rest.RestClientTest)
Do a test api call ... ok
test_request_methods (test.rest.RestClientTest)
Test all request methods ... ok
runv2 (unittest.loader._FailedTest) ... ERROR
test_get_callers_logger (test.exceptions.ExceptionsTest)
Test get_callers_logger function. ... ok
test_loggedexception_callerlogger (test.exceptions.ExceptionsTest)
Test LoggedException custom exception class. ... ERROR
test_loggedexception_defaultlogger (test.exceptions.ExceptionsTest)
Test LoggedException custom exception class. ... ok
test_loggedexception_location (test.exceptions.ExceptionsTest)
Test inclusion of location information in log message for LoggedException. ... ok
test_loggedexception_specifiedlogger (test.exceptions.ExceptionsTest)
Test LoggedException custom exception class. ... ok
test_mk_rst_table (test.docs.DocsTest)
Test mk_rst_table function. ... ok
test_noshell_glob (test.run.TestRun) ... ERROR
test_qa_list_of_answers (test.run.TestRun)
Test qa with list of answers. ... FAIL
test_qa_noqa (test.run.TestRun)
Test noqa ... FAIL
test_qa_regex (test.run.TestRun)
Test regex based q and a (works only for qa_reg) ... FAIL
test_qa_simple (test.run.TestRun)
Simple testing ... FAIL
test_simple (test.run.TestRun) ... ERROR
test_simple_asyncloop (test.run.TestRun) ...

Testing this manually, it will print the output (so it runs) but the return code is never parsed / the loop not broken. I tried fixing / working on this a few hours yesterday (down to the level of wiping the entirety of run.py and starting fresh) and wasn't able to make progress, so I need help with here!

@stdweird
Copy link
Member

@vsoch py36 gives

/usr/lib64/python3.6/subprocess.py:766: ResourceWarning: subprocess 16434 is still running
  ResourceWarning, source=self)
/home/stdweird/git/stdweird/vsc-base/test/run.py:178: ResourceWarning: unclosed file <_io.BufferedWriter name=4>
  ec, output = run_qas([sys.executable, SCRIPT_QA, 'simple'], qa=qa_dict)
FAIL
test_simple (test.run.TestRun) ... 2018-05-25 18:59:42,164 WARNING    setup.Run       MainThread  using potentialy unsafe shell commands, use run.run or run.RunNoShell.run                          instead of run.run_simple or run.Run.run
/home/stdweird/git/stdweird/vsc-base/test/run.py:70: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  ec, output = run_simple([sys.executable, SCRIPT_SIMPLE, 'shortsleep'])
ERROR
test_simple_asyncloop (test.run.TestRun) ... 2018-05-25 18:59:42,324 WARNING    setup.RunAsyncLoop MainThread  using potentialy unsafe shell commands, use run.run or run.RunNoShell.run                          instead of run.run_simple or run.Run.run

you can test the other moduels usingthe -F and -f flags (run python3 setup.py test --help to see what they do)

@vsoch
Copy link
Author

vsoch commented May 25, 2018

Yes, that confirms what I've seen when testing - the process just keeps going! Unfortunately run.py is quite a hairball and I wasn't able to debug this. My solution would be a massive highlight and use of the delete key, which I don't think would be received with quite my same enthusiasm, heh.

@stdweird
Copy link
Member

@vsoch my remark was that with -F you can continue with the other tests.
what do you think is wrong with run? deleting is indeed not an option

@vsoch
Copy link
Author

vsoch commented May 27, 2018

okay, I deleted my entire anaconda python installation and this has resolved the dependency hell, back to hitting my face against the run.py wall I mean... testing!! :P #neversurrender!

@vsoch
Copy link
Author

vsoch commented May 28, 2018

Anyone care to help with this? I have no idea what these tests are trying to accomplish. To re-implement basic python utils like logging and dictionaries is... not good practice. So the bugs that result, they result from that. That's my main comment.

@JensTimmerman
Copy link
Contributor

@vsoch Some of this code indeed reimplements things that were added in python 2.5, 2.6 and 2.7 (like a default dict)
All of this is because we were supporting python2.4 up until last year.

I'm all in favour of replacing this code with code from the default python libraries but someone will have to do this work, and we just haven't gotten to it yet...

I'm concerned about breaking backwards compatibility, but we could deprecate A LOT of it this code that now can be done by default python.

I suggest we add deprecation warnings to the code that can most obviously be replaced by default python, and just not support it in the python3 version anymore.

@JensTimmerman
Copy link
Contributor

A lot of this is also adding things to default python that don't make sense later on, like logException
I'm all in favour of not using it anymore and deprecate it and not support it in python3

This will require a bit more cleanup in other places that use this when we switch that code to python3 compatibility, but the cleanup will involve switching this weird code to using built in python things, which is a good cleanup imho.

@vsoch
Copy link
Author

vsoch commented May 31, 2018

@JensTimmerman I strongly agree with this sentiment - it would be more work up front to greatly simplify the modules (and update the software that require them) and I believe this to be the right thing to do to ensure future success of the suite. However I think @boegel has some sort of plan in mind (that he will update here) and so I also respect that line of thinking. TLDR: I will wait for @boegel to comment, and either post his plan OR we can do something more along what you are suggesting.

@boegel
Copy link
Member

boegel commented May 31, 2018

I largely agree with Jens, there's no point in dragging along stuff that was added for compatibility with Python 2.4 (since vsc-base hasn't actually supported Python 2.4 in a while no), or to spend a lot of time porting stuff that's not actually used (although it's not trivial to be sure that's the case, we have a lot of scripts & other libraries that rely on vsc-base, including several private ones).

One step is the right direction is modernizing FrozenDict, cfr. #265, which makes it significantly easier to port frozendict.py to Python 3.x.

W.r.t. this PR: it has become a bit too unwieldy, I think we should use a step-wise approach towards supporting Python 3.x, e.g.:

  • first making sure all lib/vsc/utils/*.py modules import without problems in Python 3, by only doing import tests rather than actually running the test suite (I already have something fleshed out for that, PR coming up soon)
  • once that has been covered, gradually make sure all tests pass on top of Python 3, module by module (via python setup.py test -F 'foo|bar|baz'), starting with the modules used by other vsc.utils.* modules (e.g. missing & fancylogger)
  • keep PRs small & focused, so they can be reviewed & assessed easily, which will help significantly in getting them merged and actually making progress

Meanwhile, we should:

  • be very careful to maintain backward compatibility (or deprecate things properly we don't want to put effort in to port to Python 3), i.e. ensure tests always keep passing using both Python 2.6 & 2.7
  • check whether the existing tests actually cover the code being changed, and if not look into adding more tests to increase code coverage

The EasyBuild framework test suite can (also) be used as a smoke test to ensure no functionality is broken in Python 2.x, since it leverages quite a bit of the functionality provided by vsc-base (although certainly not everything).

@stdweird
Copy link
Member

i agree that we should tackle module per module; the only requirement here should be that py2 keeps working.
but i wouldn't put my hopes up too much that we have so much code that can be replaced.

EB is however not a good testcase, quite a lot of code in vsc-base is not used in EB (eg vsc.utils.run), and not unittested (enough).
the easiest way to proceed with testing is to make 2 scripts:

  1. one that clones and installs all our repos (public and private) (python setup.py install --user, no tests needed) [this might require some dependency resolution, but that's probably not hard to orden]
  2. a script that runs puython setup.py test on all these clones

make sure the script works with master first.
now when someone makes a PR in vsc-base to fix something, go to the vsc-base clone, pull the PR and install it; and then run the script to run all tests

getting the repos in order, and maybe some easy_install to install the extra test dependencies is probably the largest amount of work. testing with py27 in an el7 box is also more than enough. eb should at some point decide when to drop py26, but i guess el6 has a few more years ahead.

when this is done, i have no objections to merge stuff that includes heavy rewrites. if not, i'll probably review things in detail, and revert PRs that i don't like merged (like #265) without full testing. but i have little time, so waiting for my reviews will drag out this effort a lot.

@itkovian
Copy link
Member

itkovian commented Jun 1, 2018

@stdweird What is wrong with #265 ?

@stdweird
Copy link
Member

stdweird commented Jun 1, 2018

@itkovian who knows, we replaced code without unittests without any further test of code where it have been used. the code looks ok, but that's about it.
this is the whole point i was trying to make.

@boegel
Copy link
Member

boegel commented Jun 1, 2018

@stdweird The code changed in #265 is covered by the tests in vsc-base (FrozenDict is tested via FrozenDictKnownKeys). In fact, I even added a test to cover it better (using a use case from easybuild-framework that wasn't covered yet in the tests in vsc-base)...

W.r.t. testing other stuff that depends on vsc-base, sure, point taken, I'm looking into the proposed script.

@vsoch vsoch closed this Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants