Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Cannot install it with googleapis-common-protos and other related libs in python #695

Closed
ankit-sapkota opened this issue May 31, 2023 · 7 comments
Assignees
Labels

Comments

@ankit-sapkota
Copy link

When trying to install it with googleapis-common-protos the following issue seems to be present.

Tink requires protobuf version 3.20.1 but it is not supported by the googleapis-common-protos and hence dependency resolving fails.

  • Language: Python
  • Version: 3.7
  • Environment: (Ubuntu )

I am using poetry to manage deps

@qTipTip
Copy link

qTipTip commented Jun 2, 2023

Hey! First of all, thanks for developing Tink!

I am having the same issue:

Because no versions of tink match >1.7.0,<2.0.0
 and tink (1.7.0) depends on protobuf (3.20.1), tink (>=1.7.0,<2.0.0) requires protobuf (3.20.1).
And because google-cloud-secret-manager (2.16.1) depends on protobuf (>=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.0 || >4.21.0,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0dev)
 and no versions of google-cloud-secret-manager match >2.16.1,<3.0.0, tink (>=1.7.0,<2.0.0) is incompatible with google-cloud-secret-manager (>=2.16.1,<3.0.0).
So, because ... depends on both google-cloud-secret-manager (^2.16.1) and tink (^1.7.0), version solving failed.

@morambro morambro added the bug label Jun 5, 2023
@tholenst
Copy link
Contributor

tholenst commented Jun 5, 2023

It would be good if we followed https://packaging.python.org/en/latest/discussions/install-requires-vs-requirements/#install-requires :

"It is not considered best practice to use install_requires to pin dependencies to specific versions, or to specify sub-dependencies (i.e. dependencies of your dependencies). This is overly-restrictive, and prevents the user from gaining the benefit of dependency upgrades."

@tholenst tholenst added the p2 label Jun 5, 2023
@morambro morambro self-assigned this Jun 6, 2023
copybara-service bot pushed a commit to tink-crypto/tink-py that referenced this issue Jun 6, 2023
 - Use less restrictive constraints for tink-py deps (tink-crypto/tink#695) and examples
 - Remove `constraints.in`
 - Upgrade dependencies in `requirements.txt` and `examples/requirements.txt`
 - Use `--require-hashes` when installing `examples/requirements.txt`

PiperOrigin-RevId: 538165507
Change-Id: I89a312de5db96f8694b151d53beec2461528c90e
morambro added a commit that referenced this issue Jun 7, 2023
 - Use less restrictive constraints for tink-py deps (#695) and examples
 - Remove `constraints.in`
 - Upgrade dependencies in `requirements.txt` and `examples/requirements.txt`
 - Use `--require-hashes` when installing `examples/requirements.txt`

PiperOrigin-RevId: 538165507
@dega2
Copy link

dega2 commented Jun 15, 2023

I was running into the same issue and was happy that this seems to be fixed already. But after building Tink with the new sources from Git it's only solving the dependency issue during the pip installation. But when using Tink it's raising an error and requesting to downgrade:
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

@morambro
Copy link
Contributor

@dega2 thanks for testing this. Could you please provide some more details on your setup? E.g., which version of googleapis-common-protos are you using? What version of protoc did you use to build Tink's Python pb files? Note that setup.py uses the protoc that is available on the system (see here and a usage example here here).

@dega2
Copy link

dega2 commented Jun 22, 2023

@morambro thank you for your reply.
I have setup a fresh Ubuntu 20.04, Python 3.10 and the coresponding Pip.
I used the Ubuntu APT package protobuf-compiler. I checked the version with: protoc --version output: libprotoc 23.0
I followed the Bazel installation procedure from the Bazel Git.
The tink package was build with: pip wheel .

@morambro
Copy link
Contributor

morambro commented Jun 22, 2023

I think the issue is the version of protoc; note that Tink Python at HEAD requires >=4.21.9. You may try with a more recent version (e.g., see here).

copybara-service bot pushed a commit to tink-crypto/tink-py that referenced this issue Aug 18, 2023
…ersions

See GHSA-8gq9-2x98-w8hf

tink-crypto/tink#695

PiperOrigin-RevId: 558051203
Change-Id: I86399716b62f254f5a756f6f6cb83d0a262a0927
@morambro
Copy link
Contributor

morambro commented Aug 28, 2023

1.8.0 is out (notes, pypi), which includes a fix for this issue.

morambro added a commit that referenced this issue Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants