3

I want to use firebase-admin on GAE. So I installed firebase-admin following method.

https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27

appengine_config.py

from google.appengine.ext import vendor

# Add any libraries install in the "lib" folder.
vendor.add('lib')

requirements.txt

firebase-admin

and install it.

pip install -t lib -r requirements.txt

Then I checked in the "lib" folder, six is existed. And six version is 1.11.0.

But I've already use built-in six.

app.yaml

libraries:
- name: six
  version: latest

Built-in six version is "1.9.0".

Does these difference have any effect on the process of GAE? If there is any effect, How to solve this?

stack_user
  • 563
  • 2
  • 14
  • The supported version for [six](https://cloud.google.com/appengine/docs/standard/python/tools/built-in-libraries-27) in GAE is 1.9.0. What if you change the six version in [firebase-admin-python](https://github.com/firebase/firebase-admin-python/blob/master/setup.py#L45) to 1.9.0? If you receive any error message related to the six version share them. – Yurci Sep 10 '18 at 13:08
  • pipdeptree says "firebase-admin require -> - google-api-core require -> - six [required: >=1.10.0, installed: 1.11.0]".I can't know there is any effect if 1.9.0 is installed.But It does not match dependency. – stack_user Sep 12 '18 at 05:00

2 Answers2

2

The firebase-admin package requires six>=1.6.1, so manually copying in version 1.11.0 to your app won't cause problems with that library.

However, you should ensure that the code in your app that you originally added the six dependency for will work with this later version, as copied-in libraries will take precedence over any built-in libraries (thus specifying it in app.yaml is unnecessary as well).

It's worth mentioning that copied-in libraries count towards file quotas, because the library is uploaded to App Engine along with your application code. If you're concerned about hitting this quota, you can use this this technique to only install the dependencies that aren't already built-in, which will cut down on the overall file size.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82
  • thx! I understand firebase- admin can work on six>=1.6.1. But, Does other appengine module works fine when six=1.11.0? such as nbd/gql or something appengine module. – stack_user Sep 03 '18 at 04:02
1

If there's a different version of a library in the lib directory and in the app.yaml, the one in the lib directory is the one which will be available to your app. So, effectively, your app will be using six 1.11.0. You can verify that by logging six.__version__ and see what version you get.

To avoid confusions, I would probably delete the six library entry in app.yaml.

rilla
  • 782
  • 6
  • 18