Skip to content

Commit

Permalink
Add options
Browse files Browse the repository at this point in the history
  • Loading branch information
JRubics committed Feb 2, 2024
1 parent dffe3ac commit 31c2daa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 }}
Expand Down
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31c2daa

Please sign in to comment.