juftin / browsr

šŸ—‚ļø a pleasant file explorer in your terminal supporting all filesystems
http://juftin.com/browsr/
MIT License
225 stars 13 forks source link

šŸ› Do not import requests if not available #11

Closed martinhoyer closed 1 year ago

martinhoyer commented 1 year ago

The app currently does not work when installed without any optional dependencies. This is caused by requests module always being imported even though it is optional.

pipx install browsr

browsr .
Traceback (most recent call last):
  File "/home/mhoyer/.local/bin/browsr", line 5, in <module>
    from browsr.__main__ import browsr
  File "/home/mhoyer/.local/pipx/venvs/browsr/lib64/python3.11/site-packages/browsr/__init__.py", line 5, in <module>
    from .browsr import Browsr
  File "/home/mhoyer/.local/pipx/venvs/browsr/lib64/python3.11/site-packages/browsr/browsr.py", line 30, in <module>
    from browsr._base import (
  File "/home/mhoyer/.local/pipx/venvs/browsr/lib64/python3.11/site-packages/browsr/_base.py", line 28, in <module>
    from browsr._utils import FileInfo, handle_github_url
  File "/home/mhoyer/.local/pipx/venvs/browsr/lib64/python3.11/site-packages/browsr/_utils.py", line 12, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
juftin commented 1 year ago

Oh good catch! Thanks for the contribution

juftin commented 1 year ago

:tada: This PR is included in version 1.10.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: