Add test for using py2 with pipfile
ADD
tests/pipfile/py2-with-server-and-kernel-req/Pipfile
+[[source]]
+url = "https://pypi.python.org/simple"
+verify_ssl = true
+name = "pypi"
+
+[packages]
+numpy = "*"
+
+[dev-packages]
+parse = "*"
+
+[requires]
+python_version = "2.7"

ADD
tests/pipfile/py2-with-server-and-kernel-req/Pipfile.lock
+{
+ "_meta": {
+ "hash": {
+ "sha256": "77f8627bb6f7914babc301ec0de3e35d7382677167cab27e1a00cc30b37f4e5f"
+ },
+ "pipfile-spec": 6,
+ "requires": {
+ "python_version": "2.7"
+ },
+ "sources": [
+ {
+ "name": "pypi",
+ "url": "https://pypi.python.org/simple",
+ "verify_ssl": true
+ }
+ ]
+ },
+ "default": {
+ "numpy": {
+ "hashes": [
+ "sha256:0778076e764e146d3078b17c24c4d89e0ecd4ac5401beff8e1c87879043a0633",
+ "sha256:141c7102f20abe6cf0d54c4ced8d565b86df4d3077ba2343b61a6db996cefec7",
+ "sha256:14270a1ee8917d11e7753fb54fc7ffd1934f4d529235beec0b275e2ccf00333b",
+ "sha256:27e11c7a8ec9d5838bc59f809bfa86efc8a4fd02e58960fa9c49d998e14332d5",
+ "sha256:2a04dda79606f3d2f760384c38ccd3d5b9bb79d4c8126b67aff5eb09a253763e",
+ "sha256:3c26010c1b51e1224a3ca6b8df807de6e95128b0908c7e34f190e7775455b0ca",
+ "sha256:52c40f1a4262c896420c6ea1c6fda62cf67070e3947e3307f5562bd783a90336",
+ "sha256:6e4f8d9e8aa79321657079b9ac03f3cf3fd067bf31c1cca4f56d49543f4356a5",
+ "sha256:7242be12a58fec245ee9734e625964b97cf7e3f2f7d016603f9e56660ce479c7",
+ "sha256:7dc253b542bfd4b4eb88d9dbae4ca079e7bf2e2afd819ee18891a43db66c60c7",
+ "sha256:94f5bd885f67bbb25c82d80184abbf7ce4f6c3c3a41fbaa4182f034bba803e69",
+ "sha256:a89e188daa119ffa0d03ce5123dee3f8ffd5115c896c2a9d4f0dbb3d8b95bfa3",
+ "sha256:ad3399da9b0ca36e2f24de72f67ab2854a62e623274607e37e0ce5f5d5fa9166",
+ "sha256:b0348be89275fd1d4c44ffa39530c41a21062f52299b1e3ee7d1c61f060044b8",
+ "sha256:b5554368e4ede1856121b0dfa35ce71768102e4aa55e526cb8de7f374ff78722",
+ "sha256:cbddc56b2502d3f87fda4f98d948eb5b11f36ff3902e17cb6cc44727f2200525",
+ "sha256:d79f18f41751725c56eceab2a886f021d70fd70a6188fd386e29a045945ffc10",
+ "sha256:dc2ca26a19ab32dc475dbad9dfe723d3a64c835f4c23f625c2b6566ca32b9f29",
+ "sha256:dd9bcd4f294eb0633bb33d1a74febdd2b9018b8b8ed325f861fffcd2c7660bb8",
+ "sha256:e8baab1bc7c9152715844f1faca6744f2416929de10d7639ed49555a85549f52",
+ "sha256:ec31fe12668af687b99acf1567399632a7c47b0e17cfb9ae47c098644ef36797",
+ "sha256:f12b4f7e2d8f9da3141564e6737d79016fe5336cc92de6814eba579744f65b0a",
+ "sha256:f58ac38d5ca045a377b3b377c84df8175ab992c970a53332fa8ac2373df44ff7"
+ ],
+ "index": "pypi",
+ "version": "==1.16.4"
+ }
+ },
+ "develop": {
+ "parse": {
+ "hashes": [
+ "sha256:1b68657434d371e5156048ca4a0c5aea5afc6ca59a2fea4dd1a575354f617142",
+ "sha256:7cc123e89f39b7374bd6fd1cbe4e1a6616a9ce328163fbe9caef474d6aba380c"
+ ],
+ "index": "pypi",
+ "version": "==1.12.0"
+ }
+ }
+}

ADD
tests/pipfile/py2-with-server-and-kernel-req/README.rst
+Python 2 - Pipfile and requirements3.txt
+----------------------------------------
+
+- We should get Python 2 setup for the Kernel
+ - with 'numpy' installed installed through Pipfile as listed in 'packages'
+ - with 'parse' installed installed through Pipfile as listed in 'dev-packages'
+- We should get Python 3 setup for the Notebook Server, with 'nbgitpuller' installed through requirements3.txt

ADD
tests/pipfile/py2-with-server-and-kernel-req/requirements3.txt
+# install this in the environment in which the notebook server
+# is running nbgitpuller does not work with Python 2
+nbgitpuller==0.6.1

ADD
tests/pipfile/py2-with-server-and-kernel-req/verify
+#!/usr/bin/env python2
+import os
+import sys
+
+
+# Verify - kernel's Python: use Python 2
+print(sys.version_info)
+assert sys.version_info[:2] == (2, 7)
+
+
+# Verify - notebook server's Python: 'numpy' isn't installed
+status_code = os.system("python3 -c 'import numpy'")
+if status_code == 0:
+ raise Exception(
+ "notebook server's Python: 'numpy' IS installed"
+ )
+
+# Verify - notebook server's Python: 'parse' isn't installed
+status_code = os.system("python3 -c 'import parse'")
+if status_code == 0:
+ raise Exception(
+ "notebook server's Python: 'parse' IS installed"
+ )
+
+# Verify - notebook server's Python: 'nbgitpuller' is installed
+status_code = os.system("python3 -c 'import nbgitpuller'")
+if not status_code == 0:
+ raise Exception(
+ "notebook server's Python: 'nbgitpuller' ISN'T installed"
+ )
+
+
+# Verify - kernel's Python: 'nbgitpuller' isn't installed
+try:
+ import nbgitpuller
+except ImportError:
+ pass
+else:
+ raise Exception(
+ "kernel's Python: 'nbgitpuller' IS installed"
+ )
+
+# Verify - kernel's Python: 'numpy' is installed
+try:
+ import numpy
+except ImportError:
+ raise Exception(
+ "kernel's Python: 'numpy' ISN'T installed --- We probably setup a virtual env through pipenv but failed to enter it."
+ )
+
+# Verify - kernel's Python: 'parse' is installed
+try:
+ import parse
+except ImportError:
+ raise Exception(
+ "kernel's Python: 'parse' ISN'T installed"
+ )

Add test for using py2 with pipfile