Skip to content

attrdict is still used in one place. #125

@chahak13

Description

@chahak13

Describe the bug
attrdict hasn't been under development since quite a while now. agavepy/util.py has an implementation of AttrDict too. I think that should be used in agavepy/settings/__init__.py instead of from attrdict import AttrDict. That should remove the attrdict dependency and also allow compatibility with newer releases of python (>3.6).

To Reproduce
Install agavepy in any version of python >3.6 (I tried with 3.10) and try running import agavepy

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/chahak/Documents/agavepy/agavepy/__init__.py", line 1, in <module>
    from .agave import Agave
  File "/home/chahak/Documents/agavepy/agavepy/agave.py", line 17, in <module>
    from agavepy import settings
  File "/home/chahak/Documents/agavepy/agavepy/settings/__init__.py", line 14, in <module>
    from attrdict import AttrDict  # noqa
  File "/home/chahak/.local/share/virtualenvs/agavepy-GvSzWhBC/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
    from attrdict.mapping import AttrMap
  File "/home/chahak/.local/share/virtualenvs/agavepy-GvSzWhBC/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

I tried a simple fix by changing that line to from ..util import AttrDict and it seemed to work fine.

Desktop (please complete the following information):

  • OS: ArchLinux

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