From 31c2daa52e8e2a9dfd2d6c82644daf125abc7ece Mon Sep 17 00:00:00 2001 From: Jelena Dokic Date: Fri, 2 Feb 2024 17:38:30 +0100 Subject: [PATCH] Add options --- README.md | 13 +++++++++---- action.yml | 6 +++--- entrypoint.sh | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0007efd..d91eb5a 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,14 @@ The Password to log in into a repository where the package will be uploaded if u By default, poetry's build command outputs two formats: **wheel** and **sdist**. If you intend to use only one of them, you may specify that with the `build_format` parameter. -### `ignore_dev_requirements` +### `poetry_install_options` -This will instruct poetry **not** to install any developer requirements. this may lead to an overall quicker experience. +Adds possibility to pass options to "poetry install" command. Examples: + - `--without dev` + - `--only-root` + - `--sync` + +Check the full list [here](https://python-poetry.org/docs/cli/#options-2). ### `allow_poetry_pre_release` @@ -72,7 +77,7 @@ The following will build and publish the python package to the PyPI using the la pypi_token: ${{ secrets.PYPI_TOKEN }} ``` -Python and poetry versions can be specified in inputs as well as the build_format, allow_poetry_pre_release and ignore_dev_requirements. +Python and poetry versions can be specified in inputs as well as the build_format, allow_poetry_pre_release and poetry_install_options. ```yaml - name: Build and publish to pypi @@ -83,7 +88,7 @@ Python and poetry versions can be specified in inputs as well as the build_forma pypi_token: ${{ secrets.PYPI_TOKEN }} build_format: "sdist" allow_poetry_pre_release: "yes" - ignore_dev_requirements: "yes" + poetry_install_options: "--sync --no-root" ``` Repository can be changed to TestPyPI or a private wheels repo by specifying repository_name and repository_url. diff --git a/action.yml b/action.yml index 2c22ca8..d549aad 100644 --- a/action.yml +++ b/action.yml @@ -31,8 +31,8 @@ inputs: build_format: description: 'The build format to be used, either "sdist" or "wheel"' required: false - ignore_dev_requirements: - description: "Install project without developer requirements." + poetry_install_options: + description: 'Adds possibility to pass options to "poetry install" command' required: false allow_poetry_pre_release: description: "Allow usage of poetry pre-release and development versions" @@ -57,7 +57,7 @@ runs: - ${{ inputs.repository_name}} - ${{ inputs.repository_url }} - ${{ inputs.build_format }} - - ${{ inputs.ignore_dev_requirements }} + - ${{ inputs.poetry_install_options }} - ${{ inputs.allow_poetry_pre_release }} - ${{ inputs.repository_username }} - ${{ inputs.repository_password }} diff --git a/entrypoint.sh b/entrypoint.sh index 3f5520f..25a0c7c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,10 +32,10 @@ if [ -n "${12}" ]; then poetry self add ${12} fi -if [ -z $7 ]; then +if [ -n "${7}" ]; then poetry install else - poetry install --no-dev + poetry install ${7} fi if [ -z $6 ]; then