heudiconv icon indicating copy to clipboard operation
heudiconv copied to clipboard

Needs some fixes for compatibility with 3.10

Open yarikoptic opened this issue 3 years ago • 3 comments

tried to add in https://github.com/nipy/heudiconv/pull/555 but it errorred out with https://app.travis-ci.com/github/nipy/heudiconv/jobs/565816419

many copies of

rootdir: /home/travis/build/nipy/heudiconv, inifile: pytest.ini
collected 1 item / 26 errors                                                   
==================================== ERRORS ====================================
____________ ERROR collecting heudiconv/external/tests/test_dlad.py ____________
<frozen importlib._bootstrap>:939: in _find_spec
    ???
E   AttributeError: 'AssertionRewritingHook' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
venv/lib/python3.10/site-packages/py/_path/local.py:704: in pyimport
    __import__(modname)
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1002: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:941: in _find_spec
    ???
<frozen importlib._bootstrap>:915: in _find_spec_legacy
    ???
venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:149: in find_module
    source_stat, co = _rewrite_test(self.config, fn_pypath)
venv/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:344: in _rewrite_test
    co = compile(tree, fn.strpath, "exec", dont_inherit=True)
E   TypeError: required field "lineno" missing from alias

@jwodder -- do you know what those are about? may be could provide a PR?

yarikoptic avatar Apr 04 '22 19:04 yarikoptic

@yarikoptic From the traceback, it looks like some sort of conflict between pytest and an improperly-implemented pytest assertion rewriting hook; does this package have any of the latter?

jwodder avatar Apr 04 '22 19:04 jwodder

I don't know what to look for but nothing I am aware of:

(git)lena:~/proj/heudiconv/heudiconv-master[enh-bids]git
$> git grep AssertionRewritingHook
(dev3) 1 16301 ->1 [1].....................................:Mon 04 Apr 2022 03:16:18 PM EDT:.
(git)lena:~/proj/heudiconv/heudiconv-master[enh-bids]git
$> git grep hook                  
heudiconv/main.py:def setup_exceptionhook():
heudiconv/main.py:    Overloads default sys.excepthook with our exceptionhook handler.
heudiconv/main.py:    If interactive, our exceptionhook handler will invoke pdb.post_mortem;
heudiconv/main.py:    def _pdb_excepthook(type, value, tb):
heudiconv/main.py:              "We cannot setup exception hook since not in interactive mode")
heudiconv/main.py:    sys.excepthook = _pdb_excepthook
heudiconv/main.py:        setup_exceptionhook()

yarikoptic avatar Apr 04 '22 19:04 yarikoptic

@yarikoptic Custom assertion rewriters are defined via pytest_assertrepr_compare, but that doesn't seem to be present in the repo either.

jwodder avatar Apr 04 '22 19:04 jwodder