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

getting tokens by docker not working #72

Closed
4 tasks done
bartek75 opened this issue Mar 6, 2023 · 3 comments
Closed
4 tasks done

getting tokens by docker not working #72

bartek75 opened this issue Mar 6, 2023 · 3 comments

Comments

@bartek75
Copy link

bartek75 commented Mar 6, 2023

System Health details

not relevant to HA

Checklist

  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues..

Describe the issue

when running
docker build https://github.com/Chouffy/home_assistant_tgtg.git#main --tag "homeassistant_tgtg_tokens:latest"
on ubuntu 20
it fails with

_Collecting ruamel.yaml==0.15.72
  Downloading ruamel.yaml-0.15.72.tar.gz (309 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 309.9/309.9 KB 5.0 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 211, in <module>
          pkg_data = _package_data(__file__.replace('setup.py', '__init__.py'))
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 184, in _package_data
          data = literal_eval("".join(lines))
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 156, in literal_eval
          return _convert(node_or_string)
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 95, in _convert
          if isinstance(node, Str):
      NameError: name 'Str' is not defined
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c python -m pip install -r requirements.txt' returned a non-zero code: 1_

Reproduction steps

  1. docker build https://github.com/Chouffy/home_assistant_tgtg.git#main --tag "homeassistant_tgtg_tokens:latest"

Debug logs

Collecting ruamel.yaml==0.15.72
  Downloading ruamel.yaml-0.15.72.tar.gz (309 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 309.9/309.9 KB 5.0 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [12 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 211, in <module>
          pkg_data = _package_data(__file__.replace('setup.py', '__init__.py'))
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 184, in _package_data
          data = literal_eval("".join(lines))
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 156, in literal_eval
          return _convert(node_or_string)
        File "/tmp/pip-install-jw9mfj8a/ruamel-yaml_1fa05d8779c546a68d69b4b677d28004/setup.py", line 95, in _convert
          if isinstance(node, Str):
      NameError: name 'Str' is not defined
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
WARNING: You are using pip version 22.0.4; however, version 23.0.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
The command '/bin/sh -c python -m pip install -r requirements.txt' returned a non-zero code: 1

Diagnostics dump

No response

@DasPflanze
Copy link

Hi,
for me it took way to long to even build the container so I cancelled it and ran it that way:

docker run -it python:3.9 /bin/bash

Inside that container:
python -m pip install --upgrade pip

then get the skript with:
wget https://raw.githubusercontent.com/Chouffy/home_assistant_tgtg/main/tgtg_get_tokens.py

and now run it:
python tgtg_get_tokens.py

@maxxer
Copy link

maxxer commented Apr 5, 2023

Thanks @DasPflanze, but I think your steps are missing the script requirements. I got it working with:

python -m pip install --upgrade pip
wget https://raw.githubusercontent.com/Chouffy/home_assistant_tgtg/main/requirements.txt
pip install -r requirements.txt
wget https://raw.githubusercontent.com/Chouffy/home_assistant_tgtg/main/tgtg_get_tokens.py
python tgtg_get_tokens.py

@DasPflanze
Copy link

@maxxer you are right, I missed that. Now I wondered why my way was that much quicker and realized, that while I used python:3.9 the Dockerfile used in the manual is running 3.8. Running the Dockerfile with 3.8 took so long, that I canceled it. Changing the Dockerfile to
FROM python:3.9-slim
solved that problem and is now as fast as one would expect.

@tjorim tjorim closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2023
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

4 participants