Skip to content

Commit

Permalink
Allow install poetry to be used with PyPi repos (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
george-zubrienko authored May 2, 2024
1 parent 0605153 commit de9bf39
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ Optionally can export dependency tree to requirements.txt file.
### Inputs
| Name | Description | Optional | Default value |
|---------------------------|:---------------------------------------------------------------------------------------------------------------------------|----------|-----------------------------|
| pypi_repo_url | URL of python package index (for custom packages) | False | |
| pypi_token_username | Package index authentication username. | False | |
| pypi_token | Package index authentication token or password. | False | |
| export_requirements | Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**. | False | |
| export_credentials | If export_requirements is set to true, it exports requirements.txt with --with-credentials flag. Otherwise, does nothing. | True | true |
| requirements_path | Path to requirements.txt to be generated (relative to sources root). | True | .container/requirements.txt |
| install_preview | Install preview version of Poetry. This should be set to **true** in build process until Poetry version 1.2.0 is released. | True | false |
| version | Version to install. If value is 'latest', script will install the latest available version of Poetry. | True | latest |
| install_extras | List of optional dependencies to install, separated by space. If value is 'all', all extras will be installed | True | |
| install_only_dependencies | If set to true, installs only dependencies for project, adds the parameter `--no-root` to `poetry install` command. | True | false |
| skip_dependencies | If set to true, installs only poetry without installing dependencies. | True | false |
| export_dev_requirements | If export_requirements is set to true, it exports dev requirements.txt with --without-dev flag. Otherwise, does nothing. | True | true |
| Name | Description | Optional | Default value |
|---------------------------|:---------------------------------------------------------------------------------------------------------------------------|-----------|-----------------------------|
| pypi_repo_url | URL of python package index (for custom packages) | True | "" |
| pypi_token_username | Package index authentication username. | True | "" |
| pypi_token | Package index authentication token or password. | True | "" |
| export_requirements | Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**. | True | false |
| export_credentials | If export_requirements is set to true, it exports requirements.txt with --with-credentials flag. Otherwise, does nothing. | True | true |
| requirements_path | Path to requirements.txt to be generated (relative to sources root). | True | .container/requirements.txt |
| install_preview | Install preview version of Poetry. This should be set to **true** in build process until Poetry version 1.2.0 is released. | True | false |
| version | Version to install. If value is 'latest', script will install the latest available version of Poetry. | True | latest |
| install_extras | List of optional dependencies to install, separated by space. If value is 'all', all extras will be installed | True | |
| install_only_dependencies | If set to true, installs only dependencies for project, adds the parameter `--no-root` to `poetry install` command. | True | false |
| skip_dependencies | If set to true, installs only poetry without installing dependencies. | True | false |
| export_dev_requirements | If export_requirements is set to true, it exports dev requirements.txt with --without-dev flag. Otherwise, does nothing. | True | true |

### Outputs
| Name | Description |
Expand Down
13 changes: 8 additions & 5 deletions install_poetry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ branding:
inputs:
pypi_repo_url:
description: URL of python package index (for custom packages)
required: true
required: false
default: ""

pypi_token_username:
description: Package index authentication username.
required: true
description: Package index authentication username (for custom packages)
required: false
default: ""

pypi_token:
description: Package index authentication token or password.
required: true
description: Package index authentication token or password (for custom packages)
required: false
default: ""

export_requirements:
description: Set to true if need to generate requirements.txt
Expand Down
7 changes: 5 additions & 2 deletions install_poetry/install_poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@ fi

curl -sSL https://install.python-poetry.org | python3 -
export PATH=$HOME/.local/bin:$PATH
poetry config repositories.custom_repo "$REPO_URL"
echo "custom_repo_name=custom_repo" >> "$GITHUB_OUTPUT"

if [[ -n "$REPO_URL" ]]; then
poetry config repositories.custom_repo "$REPO_URL"
echo "custom_repo_name=custom_repo" >> "$GITHUB_OUTPUT"
fi;

POETRY_ADDITIONAL_OPTIONS=()
if [[ -n "$EXTRAS" ]]; then
Expand Down

0 comments on commit de9bf39

Please sign in to comment.