scipy: BUG: Tests fail due to DeprecationWarning on imp

Describe your issue.

I’m setting up a SciPy dev environment on the development branch. python dev.py test fails. Numerous tests do not pass.

I could be doing something goofy but I’m trying to follow the docs as well as I can. I don’t know why a DeprecationWarning causes an error or why imp is involved.

Reproducing Code Example

python dev.py test

Error message

A representative sample:

_ ERROR collecting build-install/lib/python3.10/site-packages/scipy/sparse/csgr
aph/tests/test_matching.py _
../../../../venv/scipy3.10/lib/python3.10/site-packages/_pytest/runner.py:341: 
in from_call                                                             
    result: Optional[TResult] = func()
        cls        = <class '_pytest.runner.CallInfo'>
        duration   = 0.003461237996816635
        excinfo    = <ExceptionInfo DeprecationWarning("the imp module is depre
cated in favour of importlib and slated for removal in Python 3.12; see the mod
ule's documentation for alternative uses") tblen=38>
        func       = <function pytest_make_collect_report.<locals>.<lambda> at 
0x16bd5aa70>
        precise_start = 230735.183075331
        precise_stop = 230735.186536569
        reraise    = None
        result     = None
        start      = 1689736893.95786
        stop       = 1689736893.961324
        when       = 'collect'

Short form:
ERROR scipy/cluster/tests/test_disjoint_set.py - DeprecationWarning: the imp module is deprecated in favour of importlib an...

So many errors are triggered that I'm not sure that all of the errors have this form.

SciPy/NumPy/Python version and system information

import sys, numpy; print(numpy.__version__, sys.version_info)
1.22.4 sys.version_info(major=3, minor=10, micro=11, releaselevel='final', serial=0)

I'm running an Intel Mac, Python 3.10, installed from python.org, running in a venv. I installed dependencies using this gist:
https://gist.github.com/stefanv/0b052fa4014fa07e18e81fe544afc9f9

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 27 (27 by maintainers)

Most upvoted comments

I can’t make it this Friday but I’ve added the meetings to my calendar and will attend as soon as I’m able. Thanks!

Not sure if there’s something we can warn/error out on re: umfpack business (i.e., when I uninstall the SciPy from umfpack the problem still doesn’t go away, I need to uninstall scikit-umfpack proper, maybe there’s something we could detect there somehow, not sure).

that looks like it could be being caused by pytest itself.