mandarons / icloudpy

iCloud web service interface library in Python
Other
195 stars 20 forks source link

[BUG] Cannot import on python 3.10 #4

Closed c01o closed 1 year ago

c01o commented 2 years ago

Describe the bug Import failed due to very old version of keyring specified in requirements.txt. What disrupts upgrading it?

To Reproduce

Expected behavior Correctly imported.

Logs

ImportError                               Traceback (most recent call last)
/workspaces/iCloud_drive_uploader/test.ipynb Cell 3' in <cell line: 2>()
      [1] import sys
----> [2] from icloudpy import ICloudPyService
      [3] api = ICloudPyService(os.getenv('icu'), os.getenv('icp'))
      [4] if api.requires_2fa:

File ~/.local/lib/python3.10/site-packages/icloudpy/__init__.py:3, in <module>
      1 """The iCloudPy library."""
      2 import logging
----> 3 from icloudpy.base import ICloudPyService
      5 logging.getLogger(__name__).addHandler(logging.NullHandler())

File ~/.local/lib/python3.10/site-packages/icloudpy/base.py:20, in <module>
     12 import getpass
     14 from icloudpy.exceptions import (
     15     ICloudPyFailedLoginException,
     16     ICloudPyAPIResponseException,
     17     ICloudPy2SARequiredException,
     18     ICloudPyServiceNotActivatedException,
     19 )
---> 20 from icloudpy.services import (
     21     FindMyiPhoneServiceManager,
     22     CalendarService,
     23     UbiquityService,
     24     ContactsService,
     25     RemindersService,
     26     PhotosService,
     27     AccountService,
     28     DriveService,
     29 )
     30 from icloudpy.utils import get_password_from_keyring
     33 LOGGER = logging.getLogger(__name__)

File ~/.local/lib/python3.10/site-packages/icloudpy/services/__init__.py:8, in <module>
      6 from icloudpy.services.reminders import RemindersService
      7 from icloudpy.services.photos import PhotosService
----> 8 from icloudpy.services.account import AccountService
      9 from icloudpy.services.drive import DriveService

File ~/.local/lib/python3.10/site-packages/icloudpy/services/account.py:6, in <module>
      3 from six import PY2, python_2_unicode_compatible
      4 from collections import OrderedDict
----> 6 from icloudpy.utils import underscore_to_camelcase
      9 class AccountService(object):
     10     """The 'Account' iCloud service."""

File ~/.local/lib/python3.10/site-packages/icloudpy/utils.py:3, in <module>
      1 """Utils."""
      2 import getpass
----> 3 import keyring
      4 from sys import stdout
      6 from .exceptions import ICloudPyNoStoredPasswordAvailableException

File ~/.local/lib/python3.10/site-packages/keyring/__init__.py:6, in <module>
      3 import logging
      4 logger = logging.getLogger('keyring')
----> 6 from .core import (set_keyring, get_keyring, set_password, get_password,
      7                   delete_password)
      8 from .getpassbackend import get_password as get_pass_get_password
     10 try:

File ~/.local/lib/python3.10/site-packages/keyring/core.py:14, in <module>
     11 from .py33compat import max
     13 from . import logger
---> 14 from . import backend
     15 from .util import platform_ as platform
     16 from .util import once

File ~/.local/lib/python3.10/site-packages/keyring/backend.py:18, in <module>
     16 from . import errors, util
     17 from . import backends
---> 18 from .util import properties
     19 from .py27compat import add_metaclass, filter
     22 log = logging.getLogger(__name__)

File ~/.local/lib/python3.10/site-packages/keyring/util/properties.py:1, in <module>
----> 1 from collections import Callable
      3 class ClassProperty(property):
      4     """
      5     An implementation of a property callable on a class. Used to decorate a
      6     classmethod but to then treat it like a property.
   (...)
     19     False
     20     """

ImportError: cannot import name 'Callable' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)