Skip to content

Installing tink Python library with pip requires Bazel #36

@romanini-ciandt

Description

@romanini-ciandt

Describe the bug:

The bug I'll describe has been reported before in an archived tink repo, it was closed and it is not solved yet.

In summary, pip install tink doesn't work if you don't have Bazel installed in your environment, but I don't see Bazel listed as a requirement in Tink PYPI page. The only requirement described in that page is: Requires: Python >=3.8

(venv) [root@workspace]# pip install tink --no-cache
Collecting tink
  Downloading tink-1.10.0.tar.gz (211 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 211.4/211.4 kB 7.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      running egg_info
      writing tink.egg-info/PKG-INFO
      writing dependency_links to tink.egg-info/dependency_links.txt
      writing requirements to tink.egg-info/requires.txt
      writing top-level names to tink.egg-info/top_level.txt
      error: Could not find bazel executable. Please install bazel to compile the Tink Python package.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

What was the expected behavior?

I would expect a successful Tink installation, like the following test in cloud shell (which contains bazel):

leonardo_romanini@cloudshell:~$ pip3 install tink
Defaulting to user installation because normal site-packages is not writeable
Collecting tink
  Downloading tink-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.8 kB)
Requirement already satisfied: absl-py>=1.3.0 in /usr/local/lib/python3.10/dist-packages (from tink) (2.1.0)
Requirement already satisfied: protobuf!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0.dev0,>=3.20.2 in /usr/local/lib/python3.10/dist-packages (from tink) (4.25.3)
Downloading tink-1.10.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 23.8 MB/s eta 0:00:00
Installing collected packages: tink

How can we reproduce the bug?

I'm trying to use Tink in Google's Cloud Foundation Toolkit image

docker run -it gcr.io/cloud-foundation-cicd/cft/developer-tools:1 /bin/bash
python -m venv ./venv
source venv/bin/activate
pip install tink==1.10.0

Can you tell us more about your development environment?

Python 3.12.3
pip 24.0
Alpine Linux v3.20

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions