diff --git a/bin/compile b/bin/compile index a092a28..2d7c661 100755 --- a/bin/compile +++ b/bin/compile @@ -49,9 +49,9 @@ export VENDOR_URL # These variables are used to specify which versions of Python to install by default, # as well as prompt the user to upgrade if they are using an un–supported version. # Note: When 3.7 lands, I recommend switching to LATEST_36 and LATEST_37. -DEFAULT_PYTHON_VERSION="python-3.6.6" -LATEST_36="python-3.6.6" -LATEST_37="python-3.7.0" +DEFAULT_PYTHON_VERSION="python-3.6.7" +LATEST_36="python-3.6.7" +LATEST_37="python-3.7.1" LATEST_35="python-3.5.6" LATEST_34="python-3.4.9" LATEST_27="python-2.7.15" diff --git a/bin/steps/pipenv-python-version b/bin/steps/pipenv-python-version index c8ee06d..dcdf3c2 100755 --- a/bin/steps/pipenv-python-version +++ b/bin/steps/pipenv-python-version @@ -19,7 +19,7 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then if [[ "$PYTHON" == "null" ]]; then PYTHON=$(jq -r '._meta.requires.python_version' "$BUILD_DIR/Pipfile.lock") if [ "$PYTHON" = 2.7 ]; then - echo "$LATEST_2" > "$BUILD_DIR/runtime.txt" + echo "$LATEST_27" > "$BUILD_DIR/runtime.txt" fi if [ "$PYTHON" = 3.6 ]; then echo "$LATEST_36" > "$BUILD_DIR/runtime.txt" @@ -33,4 +33,3 @@ if [[ -f $BUILD_DIR/Pipfile ]]; then fi fi fi - diff --git a/spec/hatchet/python_spec.rb b/spec/hatchet/python_spec.rb index 5ae95ed..39c0026 100644 --- a/spec/hatchet/python_spec.rb +++ b/spec/hatchet/python_spec.rb @@ -4,7 +4,7 @@ describe "Python!!!!!!!!!!!" do it "🐍" do Hatchet::Runner.new('python-getting-started', stack: DEFAULT_STACK).deploy do |app| expect(app.output).to match(/Installing pip/) - expect(app.run('python -V')).to match(/3.6.6/) + expect(app.run('python -V')).to match(/3.6.7/) end end end diff --git a/test/fixtures/pipenv-version/Pipfile b/test/fixtures/pipenv-version/Pipfile index cd4e813..91ec253 100644 --- a/test/fixtures/pipenv-version/Pipfile +++ b/test/fixtures/pipenv-version/Pipfile @@ -6,4 +6,4 @@ verify_ssl = true requests = "*" [requires] -python_version = "3.6" \ No newline at end of file +python_version = "3.6" diff --git a/test/fixtures/pipenv-version2/Pipfile b/test/fixtures/pipenv-version2/Pipfile new file mode 100644 index 0000000..3026dd1 --- /dev/null +++ b/test/fixtures/pipenv-version2/Pipfile @@ -0,0 +1,11 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] + +[dev-packages] + +[requires] +python_version = "2.7" diff --git a/test/fixtures/pipenv-version2/Pipfile.lock b/test/fixtures/pipenv-version2/Pipfile.lock new file mode 100644 index 0000000..637b90f --- /dev/null +++ b/test/fixtures/pipenv-version2/Pipfile.lock @@ -0,0 +1,20 @@ +{ + "_meta": { + "hash": { + "sha256": "ae4bdd7d4157baab65ae9d0e8389a6011e6b640995372c45ec81fa5d1ddfae9f" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "2.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": {} +} diff --git a/test/fixtures/python2_fail/requirements.txt b/test/fixtures/python2_fail/requirements.txt new file mode 100644 index 0000000..663bd1f --- /dev/null +++ b/test/fixtures/python2_fail/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file diff --git a/test/fixtures/python2_fail/runtime.txt b/test/fixtures/python2_fail/runtime.txt new file mode 100644 index 0000000..d42956d --- /dev/null +++ b/test/fixtures/python2_fail/runtime.txt @@ -0,0 +1 @@ +python-2.7.16 diff --git a/test/fixtures/python3_6_7/requirements.txt b/test/fixtures/python3_4_fail/requirements.txt similarity index 100% rename from test/fixtures/python3_6_7/requirements.txt rename to test/fixtures/python3_4_fail/requirements.txt diff --git a/test/fixtures/python3_4_fail/runtime.txt b/test/fixtures/python3_4_fail/runtime.txt new file mode 100644 index 0000000..3b5c63e --- /dev/null +++ b/test/fixtures/python3_4_fail/runtime.txt @@ -0,0 +1 @@ +python-3.4.10 diff --git a/test/fixtures/python3_7_1/requirements.txt b/test/fixtures/python3_5_fail/requirements.txt similarity index 100% rename from test/fixtures/python3_7_1/requirements.txt rename to test/fixtures/python3_5_fail/requirements.txt diff --git a/test/fixtures/python3_5_fail/runtime.txt b/test/fixtures/python3_5_fail/runtime.txt new file mode 100644 index 0000000..df4118a --- /dev/null +++ b/test/fixtures/python3_5_fail/runtime.txt @@ -0,0 +1 @@ +python-3.5.7 diff --git a/test/fixtures/python3_6/runtime.txt b/test/fixtures/python3_6/runtime.txt index 1935e97..34b35b7 100644 --- a/test/fixtures/python3_6/runtime.txt +++ b/test/fixtures/python3_6/runtime.txt @@ -1 +1 @@ -python-3.6.6 +python-3.6.7 diff --git a/test/fixtures/python3_6_7/runtime.txt b/test/fixtures/python3_6_7/runtime.txt deleted file mode 100644 index 34b35b7..0000000 --- a/test/fixtures/python3_6_7/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.6.7 diff --git a/test/fixtures/python3_6_fail/requirements.txt b/test/fixtures/python3_6_fail/requirements.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/test/fixtures/python3_6_fail/requirements.txt @@ -0,0 +1 @@ +flask diff --git a/test/fixtures/python3_6_fail/runtime.txt b/test/fixtures/python3_6_fail/runtime.txt new file mode 100644 index 0000000..9fbd3bf --- /dev/null +++ b/test/fixtures/python3_6_fail/runtime.txt @@ -0,0 +1 @@ +python-3.6.8 diff --git a/test/fixtures/python3_7/runtime.txt b/test/fixtures/python3_7/runtime.txt index 881a2db..4255f73 100644 --- a/test/fixtures/python3_7/runtime.txt +++ b/test/fixtures/python3_7/runtime.txt @@ -1 +1 @@ -python-3.7.0 +python-3.7.1 diff --git a/test/fixtures/python3_7_1/runtime.txt b/test/fixtures/python3_7_1/runtime.txt deleted file mode 100644 index 4255f73..0000000 --- a/test/fixtures/python3_7_1/runtime.txt +++ /dev/null @@ -1 +0,0 @@ -python-3.7.1 diff --git a/test/fixtures/python3_7_fail/requirements.txt b/test/fixtures/python3_7_fail/requirements.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/test/fixtures/python3_7_fail/requirements.txt @@ -0,0 +1 @@ +flask diff --git a/test/fixtures/python3_7_fail/runtime.txt b/test/fixtures/python3_7_fail/runtime.txt new file mode 100644 index 0000000..a01373a --- /dev/null +++ b/test/fixtures/python3_7_fail/runtime.txt @@ -0,0 +1 @@ +python-3.7.2 diff --git a/test/fixtures/python3_7_warn/requirements.txt b/test/fixtures/python3_7_warn/requirements.txt new file mode 100644 index 0000000..663bd1f --- /dev/null +++ b/test/fixtures/python3_7_warn/requirements.txt @@ -0,0 +1 @@ +requests \ No newline at end of file diff --git a/test/fixtures/python3_7_warn/runtime.txt b/test/fixtures/python3_7_warn/runtime.txt new file mode 100644 index 0000000..881a2db --- /dev/null +++ b/test/fixtures/python3_7_warn/runtime.txt @@ -0,0 +1 @@ +python-3.7.0 diff --git a/test/fixtures/pythonDefault/requirements.txt b/test/fixtures/pythonDefault/requirements.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/test/fixtures/pythonDefault/requirements.txt @@ -0,0 +1 @@ +flask diff --git a/test/run b/test/run index 67d97c8..ae200a1 100755 --- a/test/run +++ b/test/run @@ -19,10 +19,15 @@ testPipenvLock() { testPipenvVersion() { compile "pipenv-version" - assertCaptured "3.6.6" + assertCaptured "3.6.7" assertCapturedSuccess } +testPipenvVersion2() { + compile "pipenv-version2" + assertCaptured "2.7.15" + assertCapturedSuccess +} testPipenvFullVersion() { compile "pipenv-full-version" assertCaptured "3.6.3" @@ -87,6 +92,18 @@ testPylibmc() { assertCapturedSuccess } +testPythonDefault() { + compile "pythonDefault" + assertCaptured "python-3.6.7" + assertCapturedSuccess +} + +testPython2() { + compile "python2" + assertCaptured "python-2.7.15" + assertCapturedSuccess +} + testPython2_warn() { compile "python2_warn" if [[ $STACK = "heroku-18" ]]; then @@ -98,31 +115,41 @@ testPython2_warn() { fi } -testPython2() { - compile "python2" - assertCaptured "python-2.7.15" - assertCapturedSuccess +testPython2_fail() { + compile "python2_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_4() { + compile "python3_4" + assertCaptured "python-3.4.9" + assertCapturedSuccess } -# This fail testPython3_4_warn() { compile "python3_4_warn" if [[ $STACK = "cedar-14" ]]; then assertCaptured "python-3.4.0" + assertCaptured "security update!" assertCapturedSuccess else assertCapturedError fi } -# This fail -testPython3_4() { - compile "python3_4" - assertCaptured "python-3.4.9" - assertCapturedError +testPython3_4_fail() { + compile "python3_4_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_5() { + compile "python3_5" + assertCaptured "python-3.5.6" + assertCapturedSuccess } -# This fail testPython3_5_warn() { compile "python3_5_warn" if [[ $STACK = "cedar-14" ]]; then @@ -134,14 +161,18 @@ testPython3_5_warn() { fi } -# This will fail -testPython3_5() { - compile "python3_5" - assertCaptured "python-3.5.6" - assertCapturedError +testPython3_5_fail() { + compile "python3_5_fail" + assertCaptured "Aborting" + assertCapturedError +} + +testPython3_6() { + compile "python3_6" + assertCaptured "python-3.6.7" + assertCapturedSuccess } -# This will warn testPython3_6_warn() { compile "python3_6_warn" assertCaptured "python-3.6.5" @@ -149,17 +180,10 @@ testPython3_6_warn() { assertCapturedSuccess } -testPython3_6() { - compile "python3_6" - assertCaptured "python-3.6.6" - assertCapturedSuccess -} - -# This will fail -testPython3_6_7() { - compile "python3_6_7" - assertCaptured "python-3.6.7" - assertCapturedError +testPython3_6_fail() { + compile "python3_6_fail" + assertCaptured "Aborting" + assertCapturedError } testPython3_7() { @@ -167,15 +191,25 @@ testPython3_7() { if [[ $STACK = "cedar-14" ]]; then assertCapturedError else - assertCaptured "python-3.7.0" + assertCaptured "python-3.7.1" assertCapturedSuccess fi } -# This will fail -testPython3_7_1() { - compile "python3_7_1" - assertCaptured "python-3.7.1" +testPython3_7_warn() { + compile "python3_7_warn" + if [[ $STACK = "cedar-14" ]]; then + assertCapturedError + else + assertCaptured "python-3.7.0" + assertCaptured "security update!" + assertCapturedSuccess + fi +} + +testPython3_7_fail() { + compile "python3_7_fail" + assertCaptured "Aborting" assertCapturedError }