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

Review dependencies of the python package #2298

Closed
1 of 2 tasks
Rafiot opened this issue Sep 16, 2024 · 8 comments · Fixed by #2304
Closed
1 of 2 tasks

Review dependencies of the python package #2298

Rafiot opened this issue Sep 16, 2024 · 8 comments · Fixed by #2304
Labels
dependency Dependency management python

Comments

@Rafiot
Copy link
Contributor

Rafiot commented Sep 16, 2024

Describe the feature

Remove the direct dependency to google-api-python-client, as it's implied in the readme.

Use Case

Pull less dependencies.

Proposed Solution

That's the dependency tree, and as far as I can tell, the only actual dependency the valkey module requires from google-api-python-client is protobuf.

$ (git::main) poetry show -t valkey-glide
valkey-glide 1.0.1
├── async-timeout >=4.0.2
├── google-api-python-client 2.85.0
│   ├── google-api-core >=1.31.5,<2.0.dev0 || >2.3.0,<3.0.0dev 
│   │   ├── google-auth >=2.14.1,<3.0.dev0 
│   │   │   ├── cachetools >=2.0.0,<6.0 
│   │   │   ├── pyasn1-modules >=0.2.1 
│   │   │   │   └── pyasn1 >=0.4.6,<0.7.0 
│   │   │   └── rsa >=3.1.4,<5 
│   │   │       └── pyasn1 >=0.1.3 (circular dependency aborted here)
│   │   ├── googleapis-common-protos >=1.56.2,<2.0.dev0 
│   │   │   └── protobuf >=3.20.2,<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,<6.0.0.dev0 
│   │   ├── proto-plus >=1.22.3,<2.0.0dev 
│   │   │   └── protobuf >=3.19.0,<6.0.0dev (circular dependency aborted here)
│   │   ├── 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,<6.0.0.dev0 (circular dependency aborted here)
│   │   └── requests >=2.18.0,<3.0.0.dev0 
│   │       ├── certifi >=2017.4.17 
│   │       ├── charset-normalizer >=2,<4 
│   │       ├── idna >=2.5,<4 
│   │       └── urllib3 >=1.21.1,<3 
│   ├── google-auth >=1.19.0,<3.0.0dev (circular dependency aborted here)
│   ├── google-auth-httplib2 >=0.1.0 
│   │   ├── google-auth * (circular dependency aborted here)
│   │   └── httplib2 >=0.19.0 
│   │       └── pyparsing >=2.4.2,<3.0.0 || >3.0.0,<3.0.1 || >3.0.1,<3.0.2 || >3.0.2,<3.0.3 || >3.0.3,<4 
│   ├── httplib2 >=0.15.0,<1dev (circular dependency aborted here)
│   └── uritemplate >=3.0.1,<5 
└── typing-extensions >=4.8.0

Is that correct?

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Client version used

latest

Environment details (OS name and version, etc.)

Ubuntu 24.04

@avifenesh
Copy link
Collaborator

Hi @Rafiot, thanks for opening the issue!
Package size is indeed very important, I see that you mark that you can implement it.
Do you want to take it from here? Breaks are need to be tested, of course.

@Rafiot
Copy link
Contributor Author

Rafiot commented Sep 16, 2024

I can have a look, but I wanted to make sure first that nobody with a better understanding of the package than me (I discovered it a few hours ago) didn't already look at it and/or knows there is a good reason to depend on google-api-python-client.

@avifenesh
Copy link
Collaborator

@Rafiot First really appreciate your reach out! I see you are contributing to ValKey-py, did you discover it while working on the library?
I think the best ones to answer are @barshaul or @shohamazon, let's see what they have to say.
But I hardly see a reason we need google auth or httplib.
In V-py there's anything else from this package you're using? Maybe I miss something.

@Rafiot
Copy link
Contributor Author

Rafiot commented Sep 16, 2024

You're very welcome, I'm always happy to contribute to projects I use.

What I really want is a python library for valkey with proper typing, valkey-py or valkey-glide will do in my case. I started to work on valkey-py because it's the one I kinda know and porting my code to it will be straightforward. But the type hints needs a lot of work to be of any use. I'm going to circle back to it this week.

Then, there is valkey-glide. It looks great, the type hints are excellent, but it can only be used asynchronously, and quite a few methods have different names so porting existing code bases will be more difficult (especially if they are sync). And the massive dependencies.
I gave it a shot there, and mypy is pleased: ail-project/LacusCore#123

@avifenesh
Copy link
Collaborator

avifenesh commented Sep 16, 2024

@Rafiot We fought a lot for mypy, so It better be happy :)
Completely understand the hustle of porting a code base (and make it work async), I would say it completely worth it, but I'm a bit biased :p
We would be happy to give help with the refactor and will be available for questions and help any time if you'll end up going with Glide.
And if you think you can give a hand with the dependencies size
(which I believe many users would love it), we will welcome you in happily (or any feature you miss and want to ask for or contribute).

If you want to chat directly, you can find us in ValKey discord (it doesn't look very good at the moment, but I'm working on it :) ) or in ValKey slack.

And whether you end up using Glide or not, we would really appreciate it if you can open an issue with your pains evaluating it (what size of dependencies is too big for you for example, or which APIs are too different)

@matrey
Copy link

matrey commented Oct 8, 2024

Hello
When can we expect this to impact pip install valkey-glide?
The most recent version 1.1.0 doesn't seem to ship this change

@ikolomi
Copy link
Collaborator

ikolomi commented Oct 8, 2024

@matrey This PR was pushed to the main branch AFTER the release-1.1 branch was created, and so did not make it as a 1.1 content. It will be included in the upcoming 1.2 in November.
In case this is a show stopper for you, we can consider releasing a 1.1 patch version

@matrey
Copy link

matrey commented Oct 9, 2024

Oh I see, thanks for the clarification.
The topic matters to me but I already made myself a modified wheel, so it's not blocking me in evaluating valkey-glide
I'd be fine waiting for 1.2 in November

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Dependency management python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants