From f7ab0cb86ca6a73b6b6d90c38822148396e22f70 Mon Sep 17 00:00:00 2001 From: Felix Hoffmann Date: Thu, 9 Nov 2023 11:18:28 +0000 Subject: [PATCH 1/2] feat(compile): install poetry export plugin explicitly --- bin/compile | 4 ++++ test/fixtures/compile-exact_version_specifier.stdout.txt | 2 ++ test/fixtures/compile-export_dev.stdout.txt | 2 ++ test/fixtures/compile-export_params-0.stdout.txt | 2 ++ test/fixtures/compile-export_params-1.stdout.txt | 2 ++ test/fixtures/compile-force_poetry_version.stdout.txt | 2 ++ test/fixtures/compile-force_python_version.stdout.txt | 2 ++ test/fixtures/compile-invalid_python_version.stdout.txt | 2 ++ test/fixtures/compile-no_vars_success.stdout.txt | 2 ++ test/fixtures/compile-poetry_version_comment.stdout.txt | 2 ++ test/fixtures/compile-skip_runtime_error.stdout.txt | 2 ++ test/fixtures/compile-skip_runtime_success.stdout.txt | 2 ++ test/fixtures/compile-trailing_space.stdout.txt | 2 ++ 13 files changed, 28 insertions(+) diff --git a/bin/compile b/bin/compile index 3667289..a32cb43 100755 --- a/bin/compile +++ b/bin/compile @@ -58,6 +58,10 @@ if [ "${POETRY_VERSION:0:3}" = "1.2" ] ; then poetry config virtualenvs.create false | indent fi +# Plugin is needs to be installed explicitly in future versions of Poetry +log "Install poetry-plugin-export" +poetry self add poetry-plugin-export | indent + REQUIREMENTS_FILE="requirements.txt" log "Export $REQUIREMENTS_FILE from Poetry" diff --git a/test/fixtures/compile-exact_version_specifier.stdout.txt b/test/fixtures/compile-exact_version_specifier.stdout.txt index 29ef818..65c4b1f 100644 --- a/test/fixtures/compile-exact_version_specifier.stdout.txt +++ b/test/fixtures/compile-exact_version_specifier.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-export_dev.stdout.txt b/test/fixtures/compile-export_dev.stdout.txt index 94febff..06ffb09 100644 --- a/test/fixtures/compile-export_dev.stdout.txt +++ b/test/fixtures/compile-export_dev.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry -----> Enable exporting dev requirements to requirements.txt >>> mocked poetry call <<< diff --git a/test/fixtures/compile-export_params-0.stdout.txt b/test/fixtures/compile-export_params-0.stdout.txt index 6f4f5aa..b1a0ec1 100644 --- a/test/fixtures/compile-export_params-0.stdout.txt +++ b/test/fixtures/compile-export_params-0.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry -----> Using POETRY_EXPORT_PARAMS to set export params ( --with test ) for requirements.txt >>> mocked poetry call <<< diff --git a/test/fixtures/compile-export_params-1.stdout.txt b/test/fixtures/compile-export_params-1.stdout.txt index 84956de..7ccc260 100644 --- a/test/fixtures/compile-export_params-1.stdout.txt +++ b/test/fixtures/compile-export_params-1.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry -----> Using POETRY_EXPORT_PARAMS to set export params ( --with test ) for requirements.txt -----> Enable exporting dev requirements to requirements.txt diff --git a/test/fixtures/compile-force_poetry_version.stdout.txt b/test/fixtures/compile-force_poetry_version.stdout.txt index eae6723..8dfcc88 100644 --- a/test/fixtures/compile-force_poetry_version.stdout.txt +++ b/test/fixtures/compile-force_poetry_version.stdout.txt @@ -6,6 +6,8 @@ -----> Force usage of active Python and disable creation of virtualenvs >>> mocked poetry call <<< >>> mocked poetry call <<< +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-force_python_version.stdout.txt b/test/fixtures/compile-force_python_version.stdout.txt index 7768eb3..486ab92 100644 --- a/test/fixtures/compile-force_python_version.stdout.txt +++ b/test/fixtures/compile-force_python_version.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-invalid_python_version.stdout.txt b/test/fixtures/compile-invalid_python_version.stdout.txt index 925dab8..e449ec8 100644 --- a/test/fixtures/compile-invalid_python_version.stdout.txt +++ b/test/fixtures/compile-invalid_python_version.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-no_vars_success.stdout.txt b/test/fixtures/compile-no_vars_success.stdout.txt index 29ef818..65c4b1f 100644 --- a/test/fixtures/compile-no_vars_success.stdout.txt +++ b/test/fixtures/compile-no_vars_success.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-poetry_version_comment.stdout.txt b/test/fixtures/compile-poetry_version_comment.stdout.txt index 753de16..5778a2d 100644 --- a/test/fixtures/compile-poetry_version_comment.stdout.txt +++ b/test/fixtures/compile-poetry_version_comment.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-skip_runtime_error.stdout.txt b/test/fixtures/compile-skip_runtime_error.stdout.txt index f15a6e5..c2ccfc8 100644 --- a/test/fixtures/compile-skip_runtime_error.stdout.txt +++ b/test/fixtures/compile-skip_runtime_error.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-skip_runtime_success.stdout.txt b/test/fixtures/compile-skip_runtime_success.stdout.txt index 02ab9f0..be34793 100644 --- a/test/fixtures/compile-skip_runtime_success.stdout.txt +++ b/test/fixtures/compile-skip_runtime_success.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file diff --git a/test/fixtures/compile-trailing_space.stdout.txt b/test/fixtures/compile-trailing_space.stdout.txt index 29ef818..65c4b1f 100644 --- a/test/fixtures/compile-trailing_space.stdout.txt +++ b/test/fixtures/compile-trailing_space.stdout.txt @@ -3,6 +3,8 @@ -----> Install Poetry >>> mocked curl call <<< -----> Add Poetry to the PATH +-----> Install poetry-plugin-export + >>> mocked poetry call <<< -----> Export requirements.txt from Poetry >>> mocked poetry call <<< -----> Export Python version from Poetry to Heroku runtime.txt file From c35627c77fd1a182cc806dc81b2e37030358961c Mon Sep 17 00:00:00 2001 From: mm-matthias <43849132+mm-matthias@users.noreply.github.com> Date: Tue, 14 Nov 2023 16:12:57 +0100 Subject: [PATCH 2/2] fix(compile): fix compatibility with older versions of poetry (#67) --- bin/compile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/compile b/bin/compile index a32cb43..565b16a 100755 --- a/bin/compile +++ b/bin/compile @@ -58,9 +58,9 @@ if [ "${POETRY_VERSION:0:3}" = "1.2" ] ; then poetry config virtualenvs.create false | indent fi -# Plugin is needs to be installed explicitly in future versions of Poetry +# Plugin needs to be installed explicitly in future versions of Poetry log "Install poetry-plugin-export" -poetry self add poetry-plugin-export | indent +poetry self add 'poetry-plugin-export@*' | indent REQUIREMENTS_FILE="requirements.txt"