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

Incompatible OmnivoreQL (v0.3.4): unexpected keyword argument 'cursor' #4

Open
mgaitan opened this issue Jul 13, 2024 · 1 comment
Open

Comments

@mgaitan
Copy link

mgaitan commented Jul 13, 2024

After Installed on python3.12 via uv and setting the token manually (see #3 ) I got this error.

tin@morocha:~/lab$ uv tool install omnivorex
warning: `uv tool install` is experimental and may change without warning.
Resolved 27 packages in 1.74s
Prepared 7 packages in 767ms
Installed 27 packages in 13ms
 + anyio==4.4.0
 + backoff==2.2.1
 + certifi==2024.7.4
 + charset-normalizer==3.3.2
 + gql==3.5.0
 + graphql-core==3.2.3
 + idna==3.7
 + importlib-metadata==8.0.0
 + linkify-it-py==2.0.3
 + markdown-it-py==3.0.0
 + mdit-py-plugins==0.4.1
 + mdurl==0.1.2
 + multidict==6.0.5
 + omnivoreql==0.3.4
 + omnivorex==0.0.15
 + pygments==2.18.0
 + python-dotenv==1.0.1
 + requests==2.32.3
 + requests-toolbelt==1.0.0
 + rich==13.7.1
 + sniffio==1.3.1
 + textual==0.29.0
 + typing-extensions==4.12.2
 + uc-micro-py==1.0.3
 + urllib3==2.2.2
 + yarl==1.9.4
 + zipp==3.19.2
Installed 1 executable: omnivorex
tin@morocha:$ omnivorex 
╭──────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────────────────────────────────╮
│ /home/tin/.local/share/uv/tools/omnivorex/lib/python3.12/site-packages/omnivorex/omnivorex.py:95 in on_mount                                                                               │
│                                                                                                                                                                                            │
│    92 │   │   if not utils.is_logged_in():                                                     ╭────────────────────────── locals ───────────────────────────╮                             │
│    93 │   │   │   self.action_settings()                                                       │ self = OmnivoreX(title='OmnivoreX', classes={'-dark-mode'}) │                             │
│    94 │   │   else:                                                                            ╰─────────────────────────────────────────────────────────────╯                             │
│ ❱  95 │   │   │   self.action_refresh()                                                                                                                                                    │
│    96 │                                                                                                                                                                                    │
│    97 │   def on_button_pressed(self, event: Button.Pressed) -> None:                                                                                                                      │
│    98 │   │   if event.button.id == "load_more":                                                                                                                                           │
│                                                                                                                                                                                            │
│ /home/tin/.local/share/uv/tools/omnivorex/lib/python3.12/site-packages/omnivorex/omnivorex.py:111 in action_refresh                                                                        │
│                                                                                                                                                                                            │
│   108 │   def action_refresh(self) -> None:                                                    ╭────────────────────────── locals ───────────────────────────╮                             │
│   109 │   │   self.query_one("#list_view").clear()                                             │ self = OmnivoreX(title='OmnivoreX', classes={'-dark-mode'}) │                             │
│   110 │   │   self.MARKDOWN_VIEWER.document.update(self.WelcomePageMDContent)                  ╰─────────────────────────────────────────────────────────────╯                             │
│ ❱ 111 │   │   articles = utils.get_articles(limit=self.DEFAULT_LIMIT)                                                                                                                      │
│   112 │   │   self.populate_listview(articles)                                                                                                                                             │
│   113 │                                                                                                                                                                                    │
│   114 │   def action_archive(self) -> None:                                                                                                                                                │
│                                                                                                                                                                                            │
│ /home/tin/.local/share/uv/tools/omnivorex/lib/python3.12/site-packages/omnivorex/utils.py:44 in get_articles                                                                               │
│                                                                                                                                                                                            │
│   41                                                                                          ╭────── locals ───────╮                                                                      │
│   42                                                                                          │ cursor = 0          │                                                                      │
│   43 def get_articles(limit: int, cursor: int = 0, query="in:inbox"):                         │  limit = 42         │                                                                      │
│ ❱ 44 │   return get_client().get_articles(cursor=str(cursor), limit=limit, query=query)[      │  query = 'in:inbox' │                                                                      │
│   45 │   │   "search"                                                                         ╰─────────────────────╯                                                                      │
│   46 │   ]["edges"]                                                                                                                                                                        │
│   47                                                                                                                                                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: OmnivoreQL.get_articles() got an unexpected keyword argument 'cursor'

Dowgrading the lib did work

(omnivorex) tin@morocha:~/lab$ uv pip install "omnivoreql<0.3.4"
Resolved 15 packages in 1.62s
Prepared 1 package in 249ms
Uninstalled 1 package in 1ms
Installed 1 package in 1ms
 - omnivoreql==0.3.4
 + omnivoreql==0.3.3
@mgaitan
Copy link
Author

mgaitan commented Jul 13, 2024

in 0.3.3 while reading an article and clicking "A" to archive it , it also crashes

│ /home/tin/.local/share/uv/tools/omnivorex/lib/python3.12/site-packages/omnivorex/omnivorex.py:117 in action_archive                                                                        │
│                                                                                                                                                                                            │
│   114 │   def action_archive(self) -> None:                                                                                                                                                │
│   115 │   │   if self.OPENED_ARTICLE is not None:                                                                                                                                          │
│   116 │   │   │   article = self.OPENED_ARTICLE.details                                                                                                                                    │
│ ❱ 117 │   │   │   utils.archive_article(                                                                                                                                                   │
│   118 │   │   │   │   article["node"]["id"], not article["node"]["isArchived"]                                                                                                             │
│   119 │   │   │   )                                                                                                                                                                        │
│   120 │   │   │   article["node"]["isArchived"] = not article["node"]["isArchived"]                                                                                                        │
│                                                                                                                                                                                            │
│ ╭──────────────────────────────────────────── locals ────────────────────────────────────────────╮                                                                                         │
│ │ article = {                                                                                    │                                                                                         │
│ │           │   'cursor': '42',                                                                  │                                                                                         │
│ │           │   'node': {                                                                        │                                                                                         │
│ │           │   │   'id': 'd7d06da0-4095-11ef-be1a-ff641b2bcda1',                                │                                                                                         │
│ │           │   │   'title': 'Junio terminó con la tendencia a la baja',                         │                                                                                         │
│ │           │   │   'slug': 'junio-termino-con-la-tendencia-a-la-baja-190a8da045d',              │                                                                                         │
│ │           │   │   'url': 'https://omnivore.app/no_url?q=16aacc9e-6ef0-4439-b5c1-de5bb3c10059', │                                                                                         │
│ │           │   │   'pageType': 'UNKNOWN',                                                       │                                                                                         │
│ │           │   │   'contentReader': 'WEB',                                                      │                                                                                         │
│ │           │   │   'createdAt': '2024-07-12T21:29:38.000Z',                                     │                                                                                         │
│ │           │   │   'isArchived': False,                                                         │                                                                                         │
│ │           │   │   'readingProgressPercent': 0,                                                 │                                                                                         │
│ │           │   │   'readingProgressTopPercent': 0,                                              │                                                                                         │
│ │           │   │   ... +21                                                                      │                                                                                         │
│ │           │   }                                                                                │                                                                                         │
│ │           }                                                                                    │                                                                                         │
│ │    self = OmnivoreX(title='OmnivoreX', classes={'-dark-mode'})                                 │                                                                                         │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                                         │
│                                                                                                                                                                                            │
│ /home/tin/.local/share/uv/tools/omnivorex/lib/python3.12/site-packages/omnivorex/utils.py:67 in archive_article                                                                            │
│                                                                                                                                                                                            │
│   64                                                                                          ╭────────────────────── locals ───────────────────────╮                                      │
│   65                                                                                          │ article_id = 'd7d06da0-4095-11ef-be1a-ff641b2bcda1' │                                      │
│   66 def archive_article(article_id: str, toArchive: bool = True) -> None:                    │  toArchive = True                                   │                                      │
│ ❱ 67 │   get_client().archive_article(article_id=article_id, toArchive=toArchive)             ╰─────────────────────────────────────────────────────╯                                      │
│   68                                                                                                                                                                                       │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: OmnivoreQL.archive_article() got an unexpected keyword argument 'toArchive'

You should add a harder constraint on the compatible versions

"omnivoreql>=0.2.1",

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

No branches or pull requests

1 participant