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

CI: Python 3.11 tests are failing because a dependency is using the deprecated 'sre_constants' module. #16726

Closed
WarrenWeckesser opened this issue Jul 28, 2022 · 2 comments · Fixed by #16739
Labels
CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure
Milestone

Comments

@WarrenWeckesser
Copy link
Member

WarrenWeckesser commented Jul 28, 2022

In recent pull requests, and for the most recent commit to the main development branch, the Python 3.11 tests are failing because some dependency is importing the deprecated Python module sre_constants:

============================= test session starts ==============================
platform linux -- Python 3.11.0b5, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/runner/work/scipy/scipy, configfile: pytest.ini
plugins: timeout-2.1.0, forked-1.4.0, xdist-2.5.0
timeout: 60.0s
timeout method: signal
timeout func_only: False
collected 51360 items / 1 error / 12113 deselected / 39247 selected

==================================== ERRORS ====================================
_ ERROR collecting build/testenv/lib/python3.11/site-packages/scipy/_build_utils/tests/test_scipy_version.py _
/opt/hostedtoolcache/Python/3.11.0-beta.5/x64/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)

<snip>

        wkref      = <class 'weakref.ReferenceType'>
/opt/hostedtoolcache/Python/3.11.0-beta.5/x64/lib/python3.11/sre_constants.py:2: in <module>
    warnings.warn(f"module {__name__!r} is deprecated",
E   DeprecationWarning: module 'sre_constants' is deprecated
        __builtins__ = <builtins>
        __cached__ = '/opt/hostedtoolcache/Python/3.11.0-beta.5/x64/lib/python3.11/__pycache__/sre_constants.cpython-311.pyc'
        __doc__    = None
        __file__   = '/opt/hostedtoolcache/Python/3.11.0-beta.5/x64/lib/python3.11/sre_constants.py'
        __loader__ = <_frozen_importlib_external.SourceFileLoader object at 0x7f25ec586890>
        __name__   = 'sre_constants'
        __package__ = ''
        __spec__   = ModuleSpec(name='sre_constants', loader=<_frozen_importlib_external.SourceFileLoader object at 0x7f25ec586890>, origin='/opt/hostedtoolcache/Python/3.11.0-beta.5/x64/lib/python3.11/sre_constants.py')
        warnings   = <module 'warnings' from '/opt/hostedtoolcache/Python/3.11.0-beta.5/x64/lib/python3.11/warnings.py'>
=========================== short test summary info ============================
ERROR ../testenv/lib/python3.11/site-packages/scipy/_build_utils/tests/test_scipy_version.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
===================== 12113 deselected, 1 error in 14.81s ======================
Error: Process completed with exit code 1.
@WarrenWeckesser WarrenWeckesser added the CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure label Jul 28, 2022
@WarrenWeckesser
Copy link
Member Author

WarrenWeckesser commented Jul 28, 2022

The problem might be in setuptools. When NumPy is installed, setuptools 59.8.0 is also installed:

...
  Created wheel for numpy: filename=numpy-1.24.0.dev0+573.g6e1557900-cp311-cp311-linux_x86_64.whl size=23096321 sha256=98a4bb2969082d927fd233cf3396d2b8aaca046f6b595b64f878b2dd74c32597
  Stored in directory: /tmp/pip-ephem-wheel-cache-b0au3z0w/wheels/bd/6b/e5/925e60986da27b602ad506d248e2a2888880fc1786c8e9ee3d
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.24.0.dev0+573.g6e1557900
Collecting setuptools<60.0
  Downloading setuptools-59.8.0-py3-none-any.whl (952 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 952.8/952.8 kB 40.6 MB/s eta 0:00:00
...

setuptools issue 3274 is a report of the deprecation problem, and it refers to version 60.9.3, so version 59.8.0 still bundles a version of pyparsing that imports sre_constants.

The setuptools issue was fixed in pypa/setuptools#3276 (release note), which is part of version 62.3.0.

@rgommers
Copy link
Member

These _bootstrap._gcd_import tracebacks are always clear as mud - I thought it may be the import re in test_scipy_version.py.

Either way, let me try to fix it by moving the job away from setuptools.

rgommers added a commit to rgommers/scipy that referenced this issue Jul 29, 2022
This job tests the dev versions of:
- Python
- NumPy
- Pythran
- Meson

Closes scipygh-16726

[skip azp]
rgommers added a commit to rgommers/scipy that referenced this issue Jul 29, 2022
This job tests the dev versions of:
- Python
- NumPy
- Pythran
- Meson

Closes scipygh-16726

[skip azp]
WarrenWeckesser pushed a commit that referenced this issue Jul 29, 2022
This job tests the dev versions of:
- Python
- NumPy
- Pythran
- Meson

Closes gh-16726

[skip azp]
@tupui tupui added this to the 1.10.0 milestone Jul 29, 2022
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants