From 8986eba21e0b669daedec60f64cb6f3b8cee1d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Sun, 21 Nov 2021 15:01:17 -0400 Subject: [PATCH 01/13] Add input for passing other-options to poetry --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index 950d28c7..fc8ac8fa 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,9 @@ inputs: description: "Whether to install many packages at once or one by one. This can fix PyPI DNS resolution errors, but also slows down the installation" required: false default: "true" + other-options: + description: "Other options to pass directly to poetry. For example --force." + required: false runs: using: "composite" steps: From 65ccc7949cba8ab180feee9f9c47480a5ce21c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Sun, 21 Nov 2021 15:07:53 -0400 Subject: [PATCH 02/13] Pass other-options when version is not specified --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index fc8ac8fa..b7eafb33 100644 --- a/action.yml +++ b/action.yml @@ -46,7 +46,7 @@ runs: echo -e "\033[33mInstalling Poetry 👷\033[0m\n" if [ "${{ inputs.version }}" == "latest" ]; then - POETRY_HOME=$path python3 $installation_script --yes + POETRY_HOME=$path python3 $installation_script --yes ${{ inputs.other_options}} else POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} fi From 5516cf15559450798d665ae08c959f3db62ba1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Sun, 21 Nov 2021 15:09:42 -0400 Subject: [PATCH 03/13] Pass other-options when version is specified --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index b7eafb33..1b46b5a2 100644 --- a/action.yml +++ b/action.yml @@ -48,7 +48,7 @@ runs: if [ "${{ inputs.version }}" == "latest" ]; then POETRY_HOME=$path python3 $installation_script --yes ${{ inputs.other_options}} else - POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} + POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} ${{ inputs.other_options}} fi echo "$path/bin" >>$GITHUB_PATH From f2aeb328ddde962eed82f37896a68af6f09e9d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Sun, 21 Nov 2021 15:23:35 -0400 Subject: [PATCH 04/13] Update latest poetry version test to 1.1.11 Poetry released a new version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2c7b7c2..53a6f872 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -140,7 +140,7 @@ jobs: # feel free to update it - run: | source .github/scripts/assert.sh - assert_in "1.1.10" "$(poetry --version)" + assert_in "1.1.11" "$(poetry --version)" # Make sure scripts are not deleted. # If we deleted the scripts folder (or subfolders) by accident, From 2c3f1086587027d4f4af763e3ae0e214af107879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Sun, 21 Nov 2021 15:53:12 -0400 Subject: [PATCH 05/13] Add tests for additional-options input --- .github/workflows/test.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53a6f872..80e8f465 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -180,3 +180,29 @@ jobs: assert_in "true" "$(poetry config virtualenvs.in-project)" assert_in "/home/runner/.cache/virtualenvs" "$(poetry config virtualenvs.path)" assert_in "false" "$(poetry config installer.parallel)" + + test-additional-options-version-unspecified: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./ + # This test will need to change every time poetry releases a new version + # If you're submitting a PR and this fails because Poetry release a new version + # feel free to update it + with: + additional-options: --git https://github.com/python-poetry/poetry.git@master + - run: | + source .github/scripts/assert.sh + assert_in "1.1.11" "$(poetry --version)" + + test-additional-options-version-specified: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./ + with: + version: 1.1.7 + additional-options: --force + - run: | + source .github/scripts/assert.sh + assert_in "1.1.7" "$(poetry --version)" From d25a187fbebb0e4aec2bfe5bda24b0c808d8e30c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Tue, 23 Nov 2021 10:33:29 -0400 Subject: [PATCH 06/13] Make tests fail by checking version 1.1.9 is installed We will test installing from https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b35 which install version 1.1.9 and will cause the test to fail. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 80e8f465..f4ab6099 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -193,7 +193,7 @@ jobs: additional-options: --git https://github.com/python-poetry/poetry.git@master - run: | source .github/scripts/assert.sh - assert_in "1.1.11" "$(poetry --version)" + assert_in "1.1.9" "$(poetry --version)" test-additional-options-version-specified: runs-on: ubuntu-latest @@ -205,4 +205,4 @@ jobs: additional-options: --force - run: | source .github/scripts/assert.sh - assert_in "1.1.7" "$(poetry --version)" + assert_in "1.1.9" "$(poetry --version)" From 86067c64b42a3785699024d8178c2ed7ed3c031b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Tue, 23 Nov 2021 10:41:18 -0400 Subject: [PATCH 07/13] Install poetry v1.1.9 using additional options --git --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4ab6099..d33b88b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -190,7 +190,7 @@ jobs: # If you're submitting a PR and this fails because Poetry release a new version # feel free to update it with: - additional-options: --git https://github.com/python-poetry/poetry.git@master + additional-options: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | source .github/scripts/assert.sh assert_in "1.1.9" "$(poetry --version)" @@ -202,7 +202,7 @@ jobs: - uses: ./ with: version: 1.1.7 - additional-options: --force + additional-options: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | source .github/scripts/assert.sh assert_in "1.1.9" "$(poetry --version)" From e2359b361bd351e0ed06c03e34147faa790d189e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti=20P=C3=A9rez?= Date: Tue, 23 Nov 2021 11:07:53 -0400 Subject: [PATCH 08/13] Change names to installation-arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggestions from code review Co-authored-by: Sondre Lillebø Gundersen --- action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 1b46b5a2..5cd89a21 100644 --- a/action.yml +++ b/action.yml @@ -25,8 +25,8 @@ inputs: description: "Whether to install many packages at once or one by one. This can fix PyPI DNS resolution errors, but also slows down the installation" required: false default: "true" - other-options: - description: "Other options to pass directly to poetry. For example --force." + installation-arguments: + description: "Arguments passed directly to the Poetry installation script. For example --force." required: false runs: using: "composite" @@ -46,9 +46,9 @@ runs: echo -e "\033[33mInstalling Poetry 👷\033[0m\n" if [ "${{ inputs.version }}" == "latest" ]; then - POETRY_HOME=$path python3 $installation_script --yes ${{ inputs.other_options}} + POETRY_HOME=$path python3 $installation_script --yes ${{ inputs.installation-arguments}} else - POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} ${{ inputs.other_options}} + POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} ${{ inputs.installation-arguments}} fi echo "$path/bin" >>$GITHUB_PATH From 1c6fbb9213c3d9c84d28f1b31419179d848416b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti=20P=C3=A9rez?= Date: Tue, 23 Nov 2021 11:10:30 -0400 Subject: [PATCH 09/13] Fix whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggestions from code review Co-authored-by: Sondre Lillebø Gundersen --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d33b88b0..87c8a3af 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -193,7 +193,7 @@ jobs: additional-options: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | source .github/scripts/assert.sh - assert_in "1.1.9" "$(poetry --version)" + assert_in "1.1.9" "$(poetry --version)" test-additional-options-version-specified: runs-on: ubuntu-latest @@ -205,4 +205,4 @@ jobs: additional-options: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | source .github/scripts/assert.sh - assert_in "1.1.9" "$(poetry --version)" + assert_in "1.1.9" "$(poetry --version)" From dded20352b4fbaae29680c7277fd6c2df4ce17d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Tue, 23 Nov 2021 11:22:48 -0400 Subject: [PATCH 10/13] Refactor additional-options to installation-arguments --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87c8a3af..59603651 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -181,7 +181,7 @@ jobs: assert_in "/home/runner/.cache/virtualenvs" "$(poetry config virtualenvs.path)" assert_in "false" "$(poetry config installer.parallel)" - test-additional-options-version-unspecified: + test-installation-arguments-version-unspecified: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -190,19 +190,19 @@ jobs: # If you're submitting a PR and this fails because Poetry release a new version # feel free to update it with: - additional-options: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d + installation-arguments: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | source .github/scripts/assert.sh assert_in "1.1.9" "$(poetry --version)" - test-additional-options-version-specified: + test-installation-arguments-version-specified: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ./ with: version: 1.1.7 - additional-options: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d + installation-arguments: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | source .github/scripts/assert.sh assert_in "1.1.9" "$(poetry --version)" From 0b34f7d2788f883ad213f72f902d1e4c49b09703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Tue, 23 Nov 2021 11:24:35 -0400 Subject: [PATCH 11/13] Clean outdated comments --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59603651..8053994e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -186,9 +186,6 @@ jobs: steps: - uses: actions/checkout@v2 - uses: ./ - # This test will need to change every time poetry releases a new version - # If you're submitting a PR and this fails because Poetry release a new version - # feel free to update it with: installation-arguments: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d - run: | From c2fd82c7ccbe7c1ce8b0e68ffe4bb8dd7cfcee4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20E=2E=20Bermonti-P=C3=A9rez?= Date: Tue, 23 Nov 2021 13:07:10 -0400 Subject: [PATCH 12/13] Add documentation for installation-arguments --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 65737330..8b20f5af 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,8 @@ If all you need is default Poetry, simply add this to your workflow: ```yaml - name: Install Poetry uses: snok/install-poetry@v1 + with: + installation-arguments: --force ``` If you want to set Poetry config settings, or install a specific version, you can specify inputs: @@ -29,6 +31,7 @@ If you want to set Poetry config settings, or install a specific version, you ca virtualenvs-in-project: false virtualenvs-path: ~/my-custom-path installer-parallel: true + installation-arguments: --force ``` The action is fully tested for MacOS and Ubuntu runners, on Poetry versions >= 1.1.0. @@ -47,6 +50,16 @@ virtualenvs-path: {cache-dir}/virtualenvs installer-parallel: true ``` +You can specify installation arguments directly to the poetry installer using the installation-arguments in the following +way. + +```yaml +- name: Install and configure Poetry + uses: snok/install-poetry@v1 + with: + installation-arguments: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d +``` + If you want to make further config changes - e.g., to change one of the `experimental` Poetry config settings, or just to make changes to the Poetry config *after* invoking the action - you can do so in a subsequent step, like this: From 4e3c87635575f42738fb6c40aa4231fb82c2de10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Lilleb=C3=B8=20Gundersen?= Date: Tue, 23 Nov 2021 22:19:46 +0100 Subject: [PATCH 13/13] Update readme --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8b20f5af..381ae5c2 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,6 @@ If all you need is default Poetry, simply add this to your workflow: ```yaml - name: Install Poetry uses: snok/install-poetry@v1 - with: - installation-arguments: --force ``` If you want to set Poetry config settings, or install a specific version, you can specify inputs: @@ -31,12 +29,11 @@ If you want to set Poetry config settings, or install a specific version, you ca virtualenvs-in-project: false virtualenvs-path: ~/my-custom-path installer-parallel: true - installation-arguments: --force ``` -The action is fully tested for MacOS and Ubuntu runners, on Poetry versions >= 1.1.0. +If you need to pass extra arguments to the installer script, you can specify these with `installation-arguments`. -If you're using this with Windows, see the [Running on Windows](#windows) section. +The action is fully tested for MacOS and Ubuntu runners, on Poetry versions >= 1.1.0. If you're using this with Windows, see the [Running on Windows](#windows) section. ## Defaults @@ -51,7 +48,7 @@ installer-parallel: true ``` You can specify installation arguments directly to the poetry installer using the installation-arguments in the following -way. +way: ```yaml - name: Install and configure Poetry @@ -76,7 +73,7 @@ This section contains a collection of workflow examples to try and help - Demonstrate how to implement caching for performance improvements - Clarify the implications of different settings -Some of the examples are a bit long, so here are some links +Some examples are a bit long, so here are some links - [Testing](#testing) - [Testing (using an OS matrix)](#testing-using-a-matrix)