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-package] Python 3.8 jobs failing importing pyparsing: TypeError: 'type' object is not subscriptable #6680

Closed
jameslamb opened this issue Oct 14, 2024 · 0 comments · Fixed by #6679

Comments

@jameslamb
Copy link
Collaborator

Description

Python 3.8 CI jobs are failing at test-collection time with the following error:

E TypeError: 'type' object is not subscriptable

full trace (click me)
_________ ERROR collecting tests/python_package_test/test_utilities.py _________
tests/python_package_test/test_utilities.py:7: in <module>
    import lightgbm as lgb
../../../miniforge/envs/test-env/lib/python3.8/site-packages/lightgbm/__init__.py:11: in <module>
    from .basic import Booster, Dataset, Sequence, register_logger
../../../miniforge/envs/test-env/lib/python3.8/site-packages/lightgbm/basic.py:29: in <module>
    from .compat import (
../../../miniforge/envs/test-env/lib/python3.8/site-packages/lightgbm/compat.py:191: in <module>
    import matplotlib  # noqa: F401
../../../miniforge/envs/test-env/lib/python3.8/site-packages/matplotlib/__init__.py:129: in <module>
    from . import _api, _version, cbook, _docstring, rcsetup
../../../miniforge/envs/test-env/lib/python3.8/site-packages/matplotlib/rcsetup.py:28: in <module>
    from matplotlib._fontconfig_pattern import parse_fontconfig_pattern
../../../miniforge/envs/test-env/lib/python3.8/site-packages/matplotlib/_fontconfig_pattern.py:15: in <module>
    from pyparsing import (
../../../miniforge/envs/test-env/lib/python3.8/site-packages/pyparsing/__init__.py:129: in <module>
    from .util import *
../../../miniforge/envs/test-env/lib/python3.8/site-packages/pyparsing/util.py:14: in <module>
    class __config_flags:
../../../miniforge/envs/test-env/lib/python3.8/site-packages/pyparsing/util.py:17: in __config_flags
    _all_names: list[str] = []
E   TypeError: 'type' object is not subscriptable

Reproducible example

This is happening on master and multiple PRs, for example: https://github.com/microsoft/LightGBM/actions/runs/11319863184/job/31476544070?pr=6679

Environment info

N/A

Additional Comments

The stacktrace points to pyparsing, which recently did a 3.2.0 release

pyparsing-3.2.0            |     pyhd8ed1ab_0          90 KB  conda-forge

In those release notes (link), it says

Discontinued support for Python 3.6, 3.7, and 3.8

The package metadata was updated to python-requires >=3.9 in package metadata and source code there (code link), but not in the conda-forge recipe (code link).

Similar to these:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant