Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Adding app shell and Makefile.
Browse files Browse the repository at this point in the history
I went to the **way-too-far** length of sorting dependencies in
a directed graph (thanks to `pipenv`).
  • Loading branch information
dhermes committed Oct 10, 2017
1 parent 2caa5de commit 33b50c7
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
PY27?=python2.7
PIP?=pip
DEV_APPSERVER?=$(shell which dev_appserver.py)
GCLOUD?=gcloud

help:
@echo 'Makefile for a google-cloud-python-on-gae '
@echo ' '
@echo 'Usage: '
@echo ' make language-app Run language app '
@echo ' make clean Clean generated files'
@echo ' '

language-app/lib: language-app/requirements.txt
rm -fr language-app/lib
cd language-app && \
$(PIP) install \
--target lib \
--requirement requirements.txt

language-app: language-app/lib language-app/app.yaml
$(GCLOUD) components update
cd language-app && \
$(PY27) $(DEV_APPSERVER) app.yaml

clean:
rm -fr \
language-app/lib

.PHONY: help language-app clean
3 changes: 3 additions & 0 deletions language-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
appengine_config.pyc
lib
main.pyc
7 changes: 7 additions & 0 deletions language-app/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
script: main.app
18 changes: 18 additions & 0 deletions language-app/appengine_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from google.appengine.ext import vendor


vendor.add('lib')
23 changes: 23 additions & 0 deletions language-app/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2017 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import flask


app = flask.Flask(__name__)


@app.route('/')
def hello():
return 'Hello World!'
47 changes: 47 additions & 0 deletions language-app/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# LEVEL 0:
pyasn1==0.3.7
setuptools==36.5.0
six==1.11.0

# LEVEL 1:
cachetools==2.0.1
# ALSO IN LEVEL 0: pyasn1==0.3.7
pyasn1-modules==0.1.5
rsa==3.4.2
# ALSO IN LEVEL 0: six==1.11.0
protobuf==3.4.0
# ALSO IN LEVEL 0: setuptools==36.5.0
certifi==2017.7.27.1
chardet==3.0.4
idna==2.6
urllib3==1.22
enum34==1.1.6
futures==3.1.1

# LEVEL 2:
MarkupSafe==1.0
google-auth==1.1.1
googleapis-common-protos==1.5.3
# ALSO IN LEVEL 1: protobuf==3.4.0
requests==2.18.4
# ALSO IN LEVEL 0: setuptools==36.5.0
# ALSO IN LEVEL 0: six==1.11.0
dill==0.2.7.1
future==0.16.0
grpcio==1.4.0
ply==3.8
# ALSO IN LEVEL 1: futures==3.1.1

# LEVEL 3:
click==6.7
itsdangerous==0.24
Jinja2==2.9.6
Werkzeug==0.12.2
google-cloud-core==0.27.1
google-gax==0.15.15
# ALSO in LEVEL 2: googleapis-common-protos==1.5.3
# ALSO in LEVEL 1: enum34==1.1.6

# LEVEL 4:
Flask==0.12.2
google-cloud-language==0.29.0

0 comments on commit 33b50c7

Please sign in to comment.