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

App Engine Flex Python Cloud: Privately packaged dependencies alternative #244

Open
samuhepp opened this issue Sep 1, 2020 · 0 comments

Comments

@samuhepp
Copy link

samuhepp commented Sep 1, 2020

Hello,

I want to make use of privately packaged projects for the Python 3 Flex environment. The recommended approach:

To use private dependencies:

  1. Run pip install -t lib my_module to copy dependencies into a local folder named lib.
  2. Add an empty __init__.py file to the lib directory to make it a module.
  3. Import the module in your app. For example:
import lib.my_module

I'm not particularly a massive fan of this approach and I would have thought this would have short comings with inter-package relationships?

I would prefer to have a packaged dependency (in the form of a *.tar.gz or *.whl) copied to a dist directory perhaps, and then referenced within requirements.txt like so:

numpy
pandas
dist/local_package-0.0.1.tar.gz

Unfortunately this approach doesn't seem possible as the requirements.txt is installed before the rest of the contents is uploaded so this local package doesn't exist at the time of installation. Is there any particular reason why the entire app cannot be uploaded before the installation?

My personal opinion is that this would be cleaner than the recommended approach.

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

No branches or pull requests

1 participant