diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2c7b7c2..8053994e 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, @@ -180,3 +180,26 @@ 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-installation-arguments-version-unspecified: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./ + with: + 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-installation-arguments-version-specified: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: ./ + with: + version: 1.1.7 + installation-arguments: --git https://github.com/python-poetry/poetry.git@69bd6820e320f84900103fdf867e24b355d6aa5d + - run: | + source .github/scripts/assert.sh + assert_in "1.1.9" "$(poetry --version)" diff --git a/README.md b/README.md index 65737330..381ae5c2 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ If you want to set Poetry config settings, or install a specific version, you ca installer-parallel: true ``` -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 @@ -47,6 +47,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: @@ -63,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) diff --git a/action.yml b/action.yml index 950d28c7..5cd89a21 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" + installation-arguments: + description: "Arguments passed directly to the Poetry installation script. For example --force." + required: false runs: using: "composite" steps: @@ -43,9 +46,9 @@ 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.installation-arguments}} else - POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} + POETRY_HOME=$path python3 $installation_script --yes --version=${{ inputs.version }} ${{ inputs.installation-arguments}} fi echo "$path/bin" >>$GITHUB_PATH