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

TST, MAINT: adjustments for pytest 5.0 #10377

Merged
merged 3 commits into from
Jun 30, 2019
Merged

Conversation

tylerjereddy
Copy link
Contributor

Fixes #10376 ; may require some iteration since I can't reproduce locally.

  • prefer importlib over imp to avoid deprecation warnings
    since master branch no longer has a support burden for Python 2

  • pytest-faulthandler can be removed from infrastructure and
    docs because it has been merged into pytest core now

* prefer importlib over imp to avoid deprecation warnings
since master branch no longer has a support burden for Python 2

* pytest-faulthandler can be removed from infrastructure and
docs because it has been merged into pytest core now
@tylerjereddy tylerjereddy added maintenance Items related to regular maintenance tasks CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure labels Jun 30, 2019
setup.py Outdated Show resolved Hide resolved
@pv pv force-pushed the issue_10376 branch 2 times, most recently from e01158a to b6d67e1 Compare June 30, 2019 11:53
@pv
Copy link
Member

pv commented Jun 30, 2019

The deprecated import is in system Python's distutils:

==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/config/__init__.py:415: in _importconftest
    return self._conftestpath2mod[conftestpath]
E   KeyError: local('/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/scipy/conftest.py')
During handling of the above exception, another exception occurred:
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/config/__init__.py:421: in _importconftest
    mod = conftestpath.pyimport()
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/py/_path/local.py:668: in pyimport
    __import__(modname)
<frozen importlib._bootstrap>:971: in _find_and_load
    ???
<frozen importlib._bootstrap>:955: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:665: in _load_unlocked
    ???
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:149: in exec_module
    exec(co, module.__dict__)
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/scipy/conftest.py:8: in <module>
    from distutils.version import LooseVersion
/home/travis/virtualenv/python3.6.3/lib/python3.6/distutils/__init__.py:4: in <module>
    import imp
/home/travis/virtualenv/python3.6.3/lib/python3.6/imp.py:33: in <module>
    DeprecationWarning, stacklevel=2)
E   DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
During handling of the above exception, another exception occurred:
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/runner.py:220: in from_call
    result = func()
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/runner.py:247: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/main.py:507: in collect
    yield from self._collect(arg)
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/main.py:534: in _collect
    col = self._collectfile(pkginit, handle_dupes=False)
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/main.py:597: in _collectfile
    ihook = self.gethookproxy(path)
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/main.py:446: in gethookproxy
    my_conftestmodules = pm._getconftestmodules(fspath)
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/config/__init__.py:399: in _getconftestmodules
    mod = self._importconftest(conftestpath.realpath())
/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/config/__init__.py:438: in _importconftest
    raise ConftestImportFailure(conftestpath, sys.exc_info())
E   _pytest.config.ConftestImportFailure: (local('/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/scipy/conftest.py'), (<class 'DeprecationWarning'>, DeprecationWarning("the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses",), <traceback object at 0x7ff44a2fa588>))
=========================== short test summary info ============================
FAILED ../.. - _pytest.config.ConftestImportFailure: (local('/home/travis/vir...
!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 1 error in 0.29 seconds ============================

We'll just have add it to the ignores.

@pv pv force-pushed the issue_10376 branch 3 times, most recently from e2f305a to 5b54754 Compare June 30, 2019 12:40
@pv pv changed the title WIP, TST, MAINT: adjustments for pytest 5.0 TST, MAINT: adjustments for pytest 5.0 Jun 30, 2019
@pv pv merged commit a8544c2 into scipy:master Jun 30, 2019
@pv
Copy link
Member

pv commented Jun 30, 2019

The remaining failure with numpy dev version is #10379

@tylerjereddy tylerjereddy deleted the issue_10376 branch June 30, 2019 15:17
@pv pv added this to the 1.4.0 milestone Jul 2, 2019
@tylerjereddy tylerjereddy added the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Jul 21, 2019
@tylerjereddy
Copy link
Contributor Author

Pretty sure I'm going to need to backport this to the 1.3.x maintenance branch to resolve similar issues in CI observed there: #10496

@charris
Copy link
Member

charris commented Jul 21, 2019

Might want to upgrade Cython to 0.29.11 for Python 3.8. It's not here yet, but not that far off.

@tylerjereddy
Copy link
Contributor Author

@charris Do you mean just for the sdist build or also i.e., making additions to pyproject.toml?

@mdhaber Do you know which commit I can backport to resolve the html-scipyorg build failure described in this comment or yours?

@charris
Copy link
Member

charris commented Jul 21, 2019

@tylerjereddy For sdist now, but it should be stable enough that we can start thinking of testing against it, release schedule is here: https://www.python.org/dev/peps/pep-0569/. The python3.8-dev option is available on travis using xenial, which we should already be doing for 3.7. I should probably try this with NumPy also.

@charris
Copy link
Member

charris commented Jul 21, 2019

Put numpy/numpy#14076 up just to see what happens.

@charris
Copy link
Member

charris commented Jul 21, 2019

Looks OK except it is running nose tests which gives the 'imp' deprecation warning. We should maybe disable those tests for recent Python and quiet them for pytest.

@charris
Copy link
Member

charris commented Jul 22, 2019

The timedelta.total_seconds() has an integer conversion problem, I think it is on the python end of things.

@rgommers rgommers removed the backport-candidate This fix should be ported by a maintainer to previous SciPy versions. label Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure maintenance Items related to regular maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: Travis CI fails (with pytest 5.0 ?)
4 participants