mborsetti / webchanges

webchanges anonymously checks web content (including images) and commands for changes, delivering instant notifications and AI-powered summaries to your favorite platform.
https://pypi.org/project/webchanges/
Other
37 stars 6 forks source link

[BUG] `requests` is not installed by default but unconditionally imported #65

Closed yubiuser closed 11 months ago

yubiuser commented 11 months ago

Since 3.16 requests is not installed by default (e.g. removed from requirements.txt) and replaced by httpx. One import however is executed unconditionally:

https://github.com/mborsetti/webchanges/blob/6f56ed259530f7ce336e1c492d43059a326c2cd1/webchanges/util.py#L25

This can lead to errors

/data/webchanges # webchanges --help
Traceback (most recent call last):
  File "webchanges.py", line 1, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "webchanges/cli.py", line 25, in <module>
  File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
  File "webchanges/util.py", line 25, in <module>
mborsetti commented 11 months ago

Apologies and thank you so very much for reporting it. Unfortunately, testing loads both libraries and therefore it didn't catch it.

Quick fix in 3.17.1 and will become conditional in the next release.