AuHau / toggl-cli

A simple command-line interface for toggl.com

Home Page:https://toggl.uhlir.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Version 2.2.0 broken: AttributeError: partially initialized module 'toggl.utils' has no attribute 'SubCommandsGroup' (most likely due to a circular import)

MatthiasLohr opened this issue · comments

Hi,

just tried to use togglCli 2.2.0 and got the following error from just importing it in a single file project:

Traceback (most recent call last):
  File "./toggl-csv-export.py", line 6, in <module>
    from toggl import api, utils
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/api/__init__.py", line 1, in <module>
    from toggl.api.models import Client, Workspace, Project, User, WorkspaceUser, ProjectUser, TimeEntry, Task, Tag
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/api/models.py", line 11, in <module>
    from toggl.api import base, fields
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/api/base.py", line 9, in <module>
    from toggl import utils, exceptions
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/utils/__init__.py", line 1, in <module>
    from toggl.utils.others import toggl, SubCommandsGroup
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/utils/others.py", line 9, in <module>
    from toggl.utils.config import Config
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/utils/config.py", line 12, in <module>
    from toggl.utils import metas, bootstrap, migrations
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/utils/bootstrap.py", line 11, in <module>
    from toggl.cli.themes import themes
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/cli/__init__.py", line 1, in <module>
    from toggl.cli.commands import entrypoint
  File "/home/mlohr/Projects/MatthiasLohr/toggl-tools/venv/lib/python3.8/site-packages/toggl/cli/commands.py", line 49, in <module>
    @click.group(cls=utils.SubCommandsGroup)
AttributeError: partially initialized module 'toggl.utils' has no attribute 'SubCommandsGroup' (most likely due to a circular import)

Additionally, it seems that version 2.1.0 is not installable anymore.. why?

Best regards
Matthias

Oh damn 😅 Thanks for reporting, I will investigate in the afternoon.

Hmmmm 2.1.0 should be normally available. What is the issue?

$ pip install togglCli==2.1.0
ERROR: Could not find a version that satisfies the requirement togglCli==2.1.0 (from versions: 0.2.2, 1.0.0, 2.0.0.0b1, 2.0.0.0b2, 2.0.0.0b3, 2.2.0)
ERROR: No matching distribution found for togglCli==2.1.0

Looks like it has been deleted.

That is because you must probably are trying to install it on Python 3.8, which 2.1.0 still does not support it

@AuHau Any update on this? Getting the same on the latest commit.

Sorry guys, I am currently pressed for delivery in work, so can't give you any update. I will try to have a look this week, but can't promise anything.

commented

Hi,

Have you had any time to look at this?
2.2.0 is not working at all as an api wrapper. It fails as soon as you import utils.

Python 3.7.8 (default, Jul  1 2020, 15:39:07) 
[GCC 9.3.1 20200408 (Red Hat 9.3.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from toggl import api, utils
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/api/__init__.py", line 1, in <module>
    from toggl.api.models import Client, Workspace, Project, User, WorkspaceUser, ProjectUser, TimeEntry, Task, Tag
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/api/models.py", line 11, in <module>
    from toggl.api import base, fields
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/api/base.py", line 9, in <module>
    from toggl import utils, exceptions
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/utils/__init__.py", line 1, in <module>
    from toggl.utils.others import toggl, SubCommandsGroup
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/utils/others.py", line 9, in <module>
    from toggl.utils.config import Config
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/utils/config.py", line 12, in <module>
    from toggl.utils import metas, bootstrap, migrations
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/utils/bootstrap.py", line 11, in <module>
    from toggl.cli.themes import themes
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/cli/__init__.py", line 1, in <module>
    from toggl.cli.commands import entrypoint
  File "/home/olen/.local/lib/python3.7/site-packages/toggl/cli/commands.py", line 50, in <module>
    @click.group(cls=utils.SubCommandsGroup)
AttributeError: module 'toggl.utils' has no attribute 'SubCommandsGroup'


Sorry guys, still haven't got around to it. I have free next weekend so I will try to squeeze a fix there.

Sorry guys it took so long, but should be fixed with the new v2.2.1 release :-) Let me know if there is some problem!