0

I have a custom namespace package with additional data files that are included via the package_data argument of setuptools.setup. When I install this custom package for my Google Cloud Function, the data files are not included.

I tried installing the custom package as I normally would, e.g., locally. The data files were present when I installed locally.

I expected Google Cloud Function's pip binary to have the same behavior as the standard pip binary.

  • What the error logs showing. Can you share with the requirement.txt file and the directory structure. Also have you checked with this [Documentation](https://imran-mdkhan197.medium.com/cloud-functions-python-using-local-or-custom-packages-66873832b28c) – Sandeep Vokkareni Apr 05 '23 at 08:53
  • Was the documentation above helpful? – Sandeep Vokkareni Apr 05 '23 at 12:48
  • The error is `FileNotFoundError` because it attempts to load a data file that's not present. That article you shared is not for [namespace packages](https://packaging.python.org/en/latest/guides/packaging-namespace-packages/). My suspicion is that Google has a custom build of `pip` that ignore the `package_data` argument of `setuptools.setup`. – markrogersjr Apr 05 '23 at 18:26
  • Have you checked with this [Documentation](https://cloud.google.com/functions/docs/writing/specifying-dependencies-python#python37) and the [Stackoverflow Link](https://stackoverflow.com/questions/7522250). – Sandeep Vokkareni Apr 06 '23 at 13:10

0 Answers0