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

httpie in alpine:3.14 missing dependencies #1092

Closed
blka opened this issue Jun 17, 2021 · 4 comments
Closed

httpie in alpine:3.14 missing dependencies #1092

blka opened this issue Jun 17, 2021 · 4 comments
Labels
blocked by upstream The issue is in a dependency. We are waiting for the upstream library to lay the groundwork. bug Something isn't working new Needs triage. Comments are welcome! packaging

Comments

@blka
Copy link

blka commented Jun 17, 2021

Checklist

  • [* ] I've searched for similar issues.
  • [ *] I'm using the the latest version of HTTPie.

What are the steps to reproduce the problem?

  1. docker run -ti alpine:3.14 sh
  2. apk add httpie
  3. http

What is the expected result?

usage: http [--json] [--form] [--compress] [--pretty {all,colors,format,none}] [--style STYLE] [--print WHAT] [--headers] [--body] [--verbose] [--all] [--history-print WHAT] [--stream] [--output FILE] [--download] [--continue]
            [--session SESSION_NAME_OR_PATH | --session-read-only SESSION_NAME_OR_PATH] [--auth USER[:PASS]] [--auth-type {basic,digest}] [--ignore-netrc] [--offline] [--proxy PROTOCOL:PROXY_URL] [--follow] [--max-redirects MAX_REDIRECTS] [--max-headers MAX_HEADERS]
            [--timeout SECONDS] [--check-status] [--path-as-is] [--verify VERIFY] [--ssl {ssl2.3,tls1,tls1.1,tls1.2}] [--cert CERT] [--cert-key CERT_KEY] [--ignore-stdin] [--help] [--version] [--traceback] [--default-scheme DEFAULT_SCHEME] [--debug]
            [METHOD] URL [REQUEST_ITEM [REQUEST_ITEM ...]]
http: error: the following arguments are required: URL

What happens instead?

Traceback (most recent call last):
  File "/usr/bin/http", line 33, in <module>
    sys.exit(load_entry_point('httpie==2.4.0', 'console_scripts', 'http')())
  File "/usr/lib/python3.9/site-packages/httpie/__main__.py", line 10, in main
    from .core import main
  File "/usr/lib/python3.9/site-packages/httpie/core.py", line 13, in <module>
    from httpie.client import collect_messages
  File "/usr/lib/python3.9/site-packages/httpie/client.py", line 15, in <module>
    from httpie.plugins.registry import plugin_manager
  File "/usr/lib/python3.9/site-packages/httpie/plugins/registry.py", line 1, in <module>
    from httpie.plugins.manager import PluginManager
  File "/usr/lib/python3.9/site-packages/httpie/plugins/manager.py", line 5, in <module>
    from pkg_resources import iter_entry_points
ModuleNotFoundError: No module named 'pkg_resources'

Debug output

Please re-run the command with --debug, then copy the entire command & output and paste both below:

Traceback (most recent call last):
  File "/usr/bin/http", line 33, in <module>
    sys.exit(load_entry_point('httpie==2.4.0', 'console_scripts', 'http')())
  File "/usr/lib/python3.9/site-packages/httpie/__main__.py", line 10, in main
    from .core import main
  File "/usr/lib/python3.9/site-packages/httpie/core.py", line 13, in <module>
    from httpie.client import collect_messages
  File "/usr/lib/python3.9/site-packages/httpie/client.py", line 15, in <module>
    from httpie.plugins.registry import plugin_manager
  File "/usr/lib/python3.9/site-packages/httpie/plugins/registry.py", line 1, in <module>
    from httpie.plugins.manager import PluginManager
  File "/usr/lib/python3.9/site-packages/httpie/plugins/manager.py", line 5, in <module>
    from pkg_resources import iter_entry_points
ModuleNotFoundError: No module named 'pkg_resources'

Provide any additional information, screenshots, or code examples below:

@blka blka added bug Something isn't working new Needs triage. Comments are welcome! labels Jun 17, 2021
@BoboTiG
Copy link
Contributor

BoboTiG commented Jun 18, 2021

Hello @blka,

Thanks for the report.

It might be an issue on the Alpine side when the package is created. I'll dig into that on my side.
In the meantime, maybe could you use https://github.com/alpine-docker/httpie instead?

@BoboTiG
Copy link
Contributor

BoboTiG commented Jun 18, 2021

I think I identified the root cause: https://git.alpinelinux.org/aports/tree/community/httpie/APKBUILD#n11 does not list py3-setuptools. I'll check if it can be fixed ASAP, else we will have to wait for the next HTTPie release.

@BoboTiG
Copy link
Contributor

BoboTiG commented Jun 21, 2021

I confirm that installing py3-setuptools fixes the issue:

$ docker run -it alpine:3.14
/ # apk add httpie
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/22) Installing libbz2 (1.0.8-r1)
(2/22) Installing expat (2.4.1-r0)
(3/22) Installing libffi (3.3-r2)
(4/22) Installing gdbm (1.19-r0)
(5/22) Installing xz-libs (5.2.5-r0)
(6/22) Installing libgcc (10.3.1_git20210424-r2)
(7/22) Installing libstdc++ (10.3.1_git20210424-r2)
(8/22) Installing mpdecimal (2.5.1-r1)
(9/22) Installing ncurses-terminfo-base (6.2_p20210612-r0)
(10/22) Installing ncurses-libs (6.2_p20210612-r0)
(11/22) Installing readline (8.1.0-r0)
(12/22) Installing sqlite-libs (3.35.5-r0)
(13/22) Installing python3 (3.9.5-r1)
(14/22) Installing py3-chardet (4.0.0-r2)
(15/22) Installing py3-idna (3.2-r0)
(16/22) Installing py3-urllib3 (1.26.5-r0)
(17/22) Installing py3-certifi (2020.12.5-r1)
(18/22) Installing py3-requests (2.25.1-r4)
(19/22) Installing py3-pygments (2.9.0-r0)
(20/22) Installing py3-requests-toolbelt (0.9.1-r2)
(21/22) Installing py3-pysocks (1.7.1-r2)
(22/22) Installing httpie (2.4.0-r2)
Executing busybox-1.33.1-r2.trigger
OK: 68 MiB in 36 packages

/ # http --version
Traceback (most recent call last):
  File "/usr/bin/http", line 33, in <module>
    sys.exit(load_entry_point('httpie==2.4.0', 'console_scripts', 'http')())
  File "/usr/lib/python3.9/site-packages/httpie/__main__.py", line 10, in main
    from .core import main
  File "/usr/lib/python3.9/site-packages/httpie/core.py", line 13, in <module>
    from httpie.client import collect_messages
  File "/usr/lib/python3.9/site-packages/httpie/client.py", line 15, in <module>
    from httpie.plugins.registry import plugin_manager
  File "/usr/lib/python3.9/site-packages/httpie/plugins/registry.py", line 1, in <module>
    from httpie.plugins.manager import PluginManager
  File "/usr/lib/python3.9/site-packages/httpie/plugins/manager.py", line 5, in <module>
    from pkg_resources import iter_entry_points
ModuleNotFoundError: No module named 'pkg_resources'

/ # apk add py3-setuptools
(1/6) Installing py3-ordered-set (4.0.2-r1)
(2/6) Installing py3-appdirs (1.4.4-r2)
(3/6) Installing py3-parsing (2.4.7-r2)
(4/6) Installing py3-six (1.15.0-r1)
(5/6) Installing py3-packaging (20.9-r1)
(6/6) Installing py3-setuptools (52.0.0-r3)
OK: 72 MiB in 42 packages

/ # http --version
2.4.0

@BoboTiG BoboTiG added the blocked by upstream The issue is in a dependency. We are waiting for the upstream library to lay the groundwork. label Jun 21, 2021
@BoboTiG
Copy link
Contributor

BoboTiG commented Sep 8, 2021

The version 2.5.0 fixes the issue. It is already available on the egde Alpine repository, it will be propagated to others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked by upstream The issue is in a dependency. We are waiting for the upstream library to lay the groundwork. bug Something isn't working new Needs triage. Comments are welcome! packaging
Projects
None yet
Development

No branches or pull requests

2 participants