Repository: quantumlib/Cirq

Issue:
check.sh fails on clean master
Just merged master and ran check.sh and it is failing due to tensorflow

```
(cirq) [dabacon:cirq:~/git/cirq]$./continuous-integration/check.sh 
run: ('virtualenv', '--quiet', '-p', '/usr/bin/python3.5', '/tmp/test-cirq-kp5mfrah/.test_virtualenv')
run: ('/tmp/test-cirq-kp5mfrah/.test_virtualenv/bin/pip', 'install', '--quiet', '-r', '/tmp/test-cirq-kp5mfrah/requirements.txt')
run: ('/tmp/test-cirq-kp5mfrah/.test_virtualenv/bin/pip', 'install', '--quiet', '-r', '/tmp/test-cirq-kp5mfrah/dev_tools/conf/pip-list-dev-tools.txt')

Running pylint
Finished pylint


Running typecheck
Finished typecheck


Running pytest

==================================== ERRORS ====================================
_______ ERROR collecting cirq/contrib/tpu/circuit_to_tensorflow_test.py ________
ImportError while importing test module '/tmp/test-cirq-kp5mfrah/cirq/contrib/tpu/circuit_to_tensorflow_test.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
cirq/contrib/tpu/__init__.py:75: in <module>
    from cirq.contrib.tpu.circuit_to_tensorflow import (
cirq/contrib/tpu/circuit_to_tensorflow.py:20: in <module>
    import tensorflow as tf
E   ImportError: No module named 'tensorflow'

----------- coverage: platform linux, python 3.5.3-final-0 -----------
Coverage annotated source written next to source

!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!
1 error in 34.82 seconds
Finished pytest
```


Discussion:
I think the fix is to add `tensorflow` to `dev_tools/conf/apt-list-dev-tools.txt`, or alternatively to modify the test script to `pip install -r cirq/contrib/contrib-requirements.txt`
Should try to keep in line with travis, so I guess second fix is correct one?
I agree

Resolving patch:
diff --git a/dev_tools/env_tools.py b/dev_tools/env_tools.py
--- a/dev_tools/env_tools.py
+++ b/dev_tools/env_tools.py
@@ -117,13 +117,18 @@ def prepare_temporary_test_environment(
     base_path = cast(str, env.destination_directory)
     env_path = os.path.join(base_path, env_name)
     req_path = os.path.join(base_path, 'requirements.txt')
-    req_path_2 = os.path.join(base_path,
-                              'dev_tools',
-                              'conf',
-                              'pip-list-dev-tools.txt')
+    dev_req_path = os.path.join(base_path,
+                                'dev_tools',
+                                'conf',
+                                'pip-list-dev-tools.txt')
+    contrib_req_path = os.path.join(base_path,
+                                    'cirq',
+                                    'contrib',
+                                    'contrib-requirements.txt')
+    rev_paths = [req_path, dev_req_path, contrib_req_path]
     create_virtual_env(venv_path=env_path,
                        python_path=python_path,
-                       requirements_paths=[req_path, req_path_2],
+                       requirements_paths=rev_paths,
                        verbose=verbose)
 
     return PreparedEnv(github_repo=env.repository,
@@ -171,10 +176,16 @@ def derive_temporary_python2_environment(
     env_path = os.path.join(destination_directory, env_name)
     # (These files are output by dev_tools/python2.7-generate.sh.)
     req_path = os.path.join(destination_directory, 'requirements.txt')
-    req_path_2 = os.path.join(destination_directory, 'pip-list-test-tools.txt')
+    dev_req_path = os.path.join(destination_directory,
+                                'pip-list-test-tools.txt')
+    contrib_req_path = os.path.join(destination_directory,
+                                    'cirq',
+                                    'contrib',
+                                    'contrib-requirements.txt')
+    req_paths = [req_path, dev_req_path, contrib_req_path]
     create_virtual_env(venv_path=env_path,
                        python_path=python_path,
-                       requirements_paths=[req_path, req_path_2],
+                       requirements_paths=req_paths,
                        verbose=verbose)
 
     return PreparedEnv(github_repo=python3_environment.repository,


Test patch: