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

Ignoring broken plugins #1204

Closed
isidentical opened this issue Nov 13, 2021 · 2 comments · Fixed by #1228
Closed

Ignoring broken plugins #1204

isidentical opened this issue Nov 13, 2021 · 2 comments · Fixed by #1228
Assignees
Labels
enhancement New feature or enhancement new Needs triage. Comments are welcome!
Milestone

Comments

@isidentical
Copy link
Contributor

Seems like there are a couple of broken plugins out there, and when any of them are installed in the system it completely blocks the usage of http/https commands. An example scenario;

$ pip install httpie
$ pip install httpie-aws-auth
$ http
Traceback (most recent call last):
  File "/usr/local/bin/http", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/httpie/__main__.py", line 9, in main
    exit_status = main()
  File "/usr/local/lib/python3.9/site-packages/httpie/core.py", line 35, in main
    plugin_manager.load_installed_plugins()
  File "/usr/local/lib/python3.9/site-packages/httpie/plugins/manager.py", line 35, in load_installed_plugins
    plugin = entry_point.load()
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2456, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/local/lib/python3.9/site-packages/httpie_aws_auth.py", line 8, in <module>
    from httpie import ExitStatus
ImportError: cannot import name 'ExitStatus' from 'httpie' (/usr/local/lib/python3.9/site-packages/httpie/__init__.py)

A straightforward solution for this is ignoring these errors, and throwing a warning to user (Warning: Failed to load 'httpie-aws-auth' plugin, see '/tmp/xxx.txt' for more logs). This way, even if the plugins fail they will continue to use the remaining possibilities of the httpie.

@isidentical isidentical added enhancement New feature or enhancement new Needs triage. Comments are welcome! labels Nov 13, 2021
@PerfectlyInternal
Copy link

PerfectlyInternal commented Nov 19, 2021

This seems pretty handy addition, and fairly simple to implement at that. I can start working on this now, if there aren't any other changes to be made. Are there any known broken plugins to test this with?

@isidentical
Copy link
Contributor Author

, if there aren't any other changes to be made.

Unfortunately, there is. For not creating any conflicts, we need #1200 first (not directly relevant, but touches the same places this requires). After that, it should be very simple to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement new Needs triage. Comments are welcome!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants