kapicorp/kapitan

bug: poetry cannot install gojsonnet

MatteoVoges opened this issue · 2 comments

Describe the bug/feature
I can't install gojsonnet using poetry.

To Reproduce
Steps to reproduce the behavior:

  1. I made a fresh virtual env and cloned kapitan with its submodule reclass.
  2. poetry install --all-extras
  3. PoetryException

Expected behavior
Poetry should resolve and install all dependencies including gojsonnet.

Screenshots
If applicable, add screenshots to help explain your problem/idea.

If it's a bug (please complete the following information):

  • python --version: 3.10
  • pip3 --version: 22.0.2
  • poetry --version: 1.3.2
  • Are you using pyenv or virtualenv? using venv

Additional context

See full error
Note: In this example I already run `poetry install` and after that `poetry install --all-extras`
matteo@asset-XXX:~/scrap/kapitan$ poetry install --all-extras
Installing dependencies from lock file

Package operations: 3 installs, 0 updates, 0 removals

  • Installing websocket-client (1.5.1)
  • Installing docker (5.0.3)
  • Installing gojsonnet (0.17.0): Failed

  CalledProcessError

  Command '['/home/matteo/scrap_env/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/matteo/scrap_env', '--no-deps', '/home/matteo/.cache/pypoetry/artifacts/7e/fe/02/c9b2f8114987401e79b7514ef0e85454e6bb970e7a1b9164cd7bfba133/gojsonnet-0.17.0.tar.gz']' returned non-zero exit status 1.

  at /usr/lib/python3.10/subprocess.py:524 in run
       520│             # We don't call process.wait() as .__exit__ does that for us.
       521│             raise
       522│         retcode = process.poll()
       523│         if check and retcode:
    →  524│             raise CalledProcessError(retcode, process.args,
       525│                                      output=stdout, stderr=stderr)
       526│     return CompletedProcess(process.args, retcode, stdout, stderr)
       527│ 
       528│ 

The following error occurred when trying to handle this error:


  EnvCommandError

  Command ['/home/matteo/scrap_env/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/home/matteo/scrap_env', '--no-deps', '/home/matteo/.cache/pypoetry/artifacts/7e/fe/02/c9b2f8114987401e79b7514ef0e85454e6bb970e7a1b9164cd7bfba133/gojsonnet-0.17.0.tar.gz'] errored with the following return code 1, and output: 
  Processing /home/matteo/.cache/pypoetry/artifacts/7e/fe/02/c9b2f8114987401e79b7514ef0e85454e6bb970e7a1b9164cd7bfba133/gojsonnet-0.17.0.tar.gz
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
  Building wheels for collected packages: gojsonnet
    Building wheel for gojsonnet (pyproject.toml): started
    Building wheel for gojsonnet (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error
    
    × Building wheel for gojsonnet (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [4 lines of output]
        running bdist_wheel
        running build
        running build_ext
        error: [Errno 2] No such file or directory: 'go'
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for gojsonnet
  Failed to build gojsonnet
  ERROR: Could not build wheels for gojsonnet, which is required to install pyproject.toml-based projects
  

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/utils/env.py:1540 in _run
      1536│                 output = subprocess.check_output(
      1537│                     command, stderr=subprocess.STDOUT, env=env, **kwargs
      1538│                 )
      1539│         except CalledProcessError as e:
    → 1540│             raise EnvCommandError(e, input=input_)
      1541│ 
      1542│         return decode(output)
      1543│ 
      1544│     def execute(self, bin: str, *args: str, **kwargs: Any) -> int:

The following error occurred when trying to handle this error:


  PoetryException

  Failed to install /home/matteo/.cache/pypoetry/artifacts/7e/fe/02/c9b2f8114987401e79b7514ef0e85454e6bb970e7a1b9164cd7bfba133/gojsonnet-0.17.0.tar.gz

  at ~/.local/share/pypoetry/venv/lib/python3.10/site-packages/poetry/utils/pip.py:58 in pip_install
       54│ 
       55│     try:
       56│         return environment.run_pip(*args)
       57│     except EnvCommandError as e:
    →  58│         raise PoetryException(f"Failed to install {path.as_posix()}") from e
       59│ 

Hello !

From the error message

    × Building wheel for gojsonnet (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [4 lines of output]
        running bdist_wheel
        running build
        running build_ext
        error: [Errno 2] No such file or directory: 'go' < there
        [end of output]

I'd say you don't have golang installed or in your path, which is required to compile gojsonnet.

You're right, thank you. Somehow I completely missed that.