Skip to content

cattrs fails on pypy #253

Closed
Closed

Description

@ygl-rg
  • cattrs version: 22.1
  • Python version: 3.9.10 (Pypy 7.3.9)
  • Operating System: Windows 10

Description

cattrs fails to import.

raised error like this

TypeError: 'module' object is not iterable

in _compat.py, there is

  if "ExceptionGroup" not in __builtins__:
     from exceptiongroup import ExceptionGroup
  else:
    ExceptionGroup = ExceptionGroup

according to the pypy's doc https://doc.pypy.org/en/latest/cpython_differences.html

"the builtins name is always referencing the builtin module, never a dictionary as it sometimes is in CPython"

so "if "ExceptionGroup" not in builtins" is invalid on pypy

What I Did

  import cattrs

Activity

  1. Tinche commented on Apr 11, 2022

    @Tinche
    Member

    Ooph, need to figure out a fix for this then. Maybe even reenable PyPy tests; they were disabled because they were suuuper slow.

  2. ofiriluz commented on Apr 11, 2022

    @ofiriluz

    this also started affecting other packages i think
    see:
    aws/aws-cdk#19844

  3. Tinche commented on Apr 16, 2022

    @Tinche
    Member

    Fixed on main! Also reenabled the tests.

  4. mgedmin commented on Jul 3, 2022

    @mgedmin

    I suddenly started seeing this error in my daily GitHub action rebuilds. Presumably GHA upgraded their PyPI images recently, since I've never seen this error before?

    Do you have any plans to publish a PyPI release with the fix in the near future?

  5. Tinche commented on Jul 3, 2022

    @Tinche
    Member

    Yep, it's in my queue!

  6. lloesche commented on Jul 11, 2022

    @lloesche

    Ran into this issue today. A release version that works on PyPy would be very much appreciated.

  7. jpmckinney commented on Aug 18, 2022

    @jpmckinney

    I added 'cattrs!=22.1.0;platform_python_implementation=="PyPy"' to install_requires, which is kind of bananas, but it fixed CI for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions