Skip to content

Commit 4e20d1d

Browse files
authored
Add flask. (#946)
- Also added tests to prevent regression. flask was removed from the base image we use: ``` rosbo@rosbo:~$ docker run -it --rm gcr.io/deeplearning-platform-release/base-cpu:m46 pip show flask Name: Flask Version: 1.1.2 Summary: A simple framework for building complex web applications. Home-page: https://palletsprojects.com/p/flask/ Author: Armin Ronacher Author-email: armin.ronacher@active-4.com License: BSD-3-Clause Location: /opt/conda/lib/python3.7/site-packages Requires: Werkzeug, itsdangerous, click, Jinja2 Required-by: rosbo@rosbo:~$ docker run -it --rm gcr.io/deeplearning-platform-release/base-cpu:m61 pip show flask WARNING: Package(s) not found: flask ```
1 parent d0f869b commit 4e20d1d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,8 @@ RUN pip install flashtext && \
413413
pip install pytorch-lightning && \
414414
pip install datatable && \
415415
pip install sympy && \
416+
# flask is used by agents in the simulation competitions.
417+
pip install flask && \
416418
# pycrypto is used by competitions team.
417419
pip install pycrypto && \
418420
/tmp/clean-layer.sh

tests/test_flask.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import unittest
2+
3+
from flask import Flask, request
4+
5+
class TestFlask(unittest.TestCase):
6+
def test_request(self):
7+
app = Flask(__name__)
8+
with app.test_request_context('/foo', method='POST'):
9+
assert request.path == '/foo'
10+
assert request.method == 'POST'

0 commit comments

Comments
 (0)