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

AttributeError: module 'gast' has no attribute 'MatchStar', when gast < 0.5.4 installed #108

Closed
tommilligan opened this issue Jul 1, 2024 · 0 comments · Fixed by #113
Closed

Comments

@tommilligan
Copy link

tommilligan commented Jul 1, 2024

Found during a source build of an old version of scipy, which uses beniget transitively during the build process. Installed packages were:

======== Resolution Result ========
Stable pins:
              python None
               numpy 1.23.2
              cython 0.29.37
            pybind11 2.10.4
             pythran 0.12.2
        meson-python 0.16.0
               wheel 0.37.1
             beniget 0.4.2.post1
                gast 0.5.3
               meson 1.4.1
           packaging 24.1
                 ply 3.11
  pyproject-metadata 0.8.0

The traceback seen is:

  File "/tmp/pdm-build-env-hi55zv05-shared/lib/python3.11/site-packages/beniget/beniget.py", line 112, in name
    elif isinstance(self.node, (ast.MatchStar, ast.MatchAs)):
                                ^^^^^^^^^^^^^
AttributeError: module 'gast' has no attribute 'MatchStar'

gast looks to have added support for MatchStar in 0.5.4: serge-sans-paille/gast@0.5.3...0.5.4#diff-44b67094998a7df1e5ce843b5a2faa44950f5896ac9e07ab99d09e2b24c90143R328

However, beniget still only requires gast>0.5.0:

gast >= 0.5.0

I think that either requirements.txt should be bumped to indicate a higher version of gast is required, or documentation should be added that a certain level of gast is required for newer python features like the match statement.

I worked around my specific case by upgrading other packages that were causing gast 0.5.3 to be installed, so we no longer hit this case.

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

Successfully merging a pull request may close this issue.

1 participant