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

The firebase-admin package contributes 151.7 MB of dependencies #803

Open
tibbe opened this issue Aug 16, 2024 · 7 comments
Open

The firebase-admin package contributes 151.7 MB of dependencies #803

tibbe opened this issue Aug 16, 2024 · 7 comments
Assignees

Comments

@tibbe
Copy link

tibbe commented Aug 16, 2024

[REQUIRED] Step 2: Describe your environment

  • Operating System version: macOS 14.6.1 (23G93)
  • Firebase SDK version: 5.4.0
  • Firebase Product: messaging
  • Python version: 3.11.8
  • Pip version: Poetry (version 1.8.3)

[REQUIRED] Step 3: Describe the problem

We recently performed an audit of our dependencies and firebase-admin is by far larger than anything else, clocking in at around 151.7 MB, including its transitive dependencies, according to the measuring approach we used (see below).

All we want is the Cloud Messaging part but I guess we're getting the kitchen sink and the house as well. ;)

Steps to reproduce:

Install just firebase-admin in a fresh virtualenv and look at the size of installed artefacts. We used the python-package-size tool to measure this but it can be done manually.

Relevant Code:

N/A

@VishalGawade1
Copy link

Hello @lahirumaramba,
This issue looks interesting. Can I work on it?
I can check which ones are essential for core vs. optional features and try to explore any options to make feature-specific dependencies.
I'm hoping it will make it more efficient. Let me know if you’re open to this approach! :)

@lahirumaramba
Copy link
Member

Hey @VishalGawade1 we always appreciate contributions to the code base! Feel free to take a stab at it if you would like to contribute to the repo. You can find the guidelines on https://github.com/firebase/firebase-admin-python/blob/master/CONTRIBUTING.md

@lahirumaramba
Copy link
Member

cc: @jonathanedey

@VishalGawade1
Copy link

Thanks a ton! Let me see if I can do anything :)

@VishalGawade1
Copy link

VishalGawade1 commented Oct 26, 2024

Hello @lahirumaramba ,

My plan is to make some of the larger dependencies optional using "extras_require" in setup.py. Specifically, I’d move dependencies like google-cloud-firestore and google-cloud-storage to optional extras. This way, users can install just what they need (e.g., pip install firebase-admin[firestore]), which should cut down the default install size quite a bit.

The change would include:

Making Firestore and Storage optional dependencies
Handling optional imports in the code with error messages
Updating the docs to show users how to install specific features
Does this sound like a good approach? Let me know if I’m clear to go ahead or if you have something else in mind!

@jonathanedey
Copy link
Contributor

Hi @VishalGawade1,
This seems reasonable to me, but I have a question that could affect the scope of this change. How would this affect existing install scripts? I'm assuming this change would break existing install scripts that rely on these optional imports. If so this would require us to get internal approvals going before this work could do forward.

@jonathanedey jonathanedey self-assigned this Nov 8, 2024
@VishalGawade1
Copy link

Hi @jonathanedey
This change shouldn't impact existing installs that don’t rely on optional features. "pip install firebase-admin" would still include the core functionality, so existing scripts wouldn’t break. Only users who need features like Firestore or Storage would need to install those extras specifically (e.g., pip install firebase-admin[firestore]).

I’ll also update the docs to make this clear. Let me know if this works!

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

No branches or pull requests

4 participants