Skip to content

Commit

Permalink
Add flask. (#946)
Browse files Browse the repository at this point in the history
- 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: [email protected]
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
```
  • Loading branch information
rosbo committed Jan 26, 2021
1 parent d0f869b commit 4e20d1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ RUN pip install flashtext && \
pip install pytorch-lightning && \
pip install datatable && \
pip install sympy && \
# flask is used by agents in the simulation competitions.
pip install flask && \
# pycrypto is used by competitions team.
pip install pycrypto && \
/tmp/clean-layer.sh
Expand Down
10 changes: 10 additions & 0 deletions tests/test_flask.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import unittest

from flask import Flask, request

class TestFlask(unittest.TestCase):
def test_request(self):
app = Flask(__name__)
with app.test_request_context('/foo', method='POST'):
assert request.path == '/foo'
assert request.method == 'POST'

0 comments on commit 4e20d1d

Please sign in to comment.