Skip to content

Commit de9bf39

Browse files
Allow install poetry to be used with PyPi repos (#73)
1 parent 0605153 commit de9bf39

File tree

3 files changed

+27
-21
lines changed

3 files changed

+27
-21
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@ Optionally can export dependency tree to requirements.txt file.
7171
7272
7373
### Inputs
74-
| Name | Description | Optional | Default value |
75-
|---------------------------|:---------------------------------------------------------------------------------------------------------------------------|----------|-----------------------------|
76-
| pypi_repo_url | URL of python package index (for custom packages) | False | |
77-
| pypi_token_username | Package index authentication username. | False | |
78-
| pypi_token | Package index authentication token or password. | False | |
79-
| export_requirements | Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**. | False | |
80-
| export_credentials | If export_requirements is set to true, it exports requirements.txt with --with-credentials flag. Otherwise, does nothing. | True | true |
81-
| requirements_path | Path to requirements.txt to be generated (relative to sources root). | True | .container/requirements.txt |
82-
| 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 |
83-
| version | Version to install. If value is 'latest', script will install the latest available version of Poetry. | True | latest |
84-
| install_extras | List of optional dependencies to install, separated by space. If value is 'all', all extras will be installed | True | |
85-
| install_only_dependencies | If set to true, installs only dependencies for project, adds the parameter `--no-root` to `poetry install` command. | True | false |
86-
| skip_dependencies | If set to true, installs only poetry without installing dependencies. | True | false |
87-
| export_dev_requirements | If export_requirements is set to true, it exports dev requirements.txt with --without-dev flag. Otherwise, does nothing. | True | true |
74+
| Name | Description | Optional | Default value |
75+
|---------------------------|:---------------------------------------------------------------------------------------------------------------------------|-----------|-----------------------------|
76+
| pypi_repo_url | URL of python package index (for custom packages) | True | "" |
77+
| pypi_token_username | Package index authentication username. | True | "" |
78+
| pypi_token | Package index authentication token or password. | True | "" |
79+
| export_requirements | Set to `true` if need to generate requirements.txt. **Optional** defaults to **false**. | True | false |
80+
| export_credentials | If export_requirements is set to true, it exports requirements.txt with --with-credentials flag. Otherwise, does nothing. | True | true |
81+
| requirements_path | Path to requirements.txt to be generated (relative to sources root). | True | .container/requirements.txt |
82+
| 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 |
83+
| version | Version to install. If value is 'latest', script will install the latest available version of Poetry. | True | latest |
84+
| install_extras | List of optional dependencies to install, separated by space. If value is 'all', all extras will be installed | True | |
85+
| install_only_dependencies | If set to true, installs only dependencies for project, adds the parameter `--no-root` to `poetry install` command. | True | false |
86+
| skip_dependencies | If set to true, installs only poetry without installing dependencies. | True | false |
87+
| export_dev_requirements | If export_requirements is set to true, it exports dev requirements.txt with --without-dev flag. Otherwise, does nothing. | True | true |
8888

8989
### Outputs
9090
| Name | Description |

install_poetry/action.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ branding:
88
inputs:
99
pypi_repo_url:
1010
description: URL of python package index (for custom packages)
11-
required: true
11+
required: false
12+
default: ""
1213

1314
pypi_token_username:
14-
description: Package index authentication username.
15-
required: true
15+
description: Package index authentication username (for custom packages)
16+
required: false
17+
default: ""
1618

1719
pypi_token:
18-
description: Package index authentication token or password.
19-
required: true
20+
description: Package index authentication token or password (for custom packages)
21+
required: false
22+
default: ""
2023

2124
export_requirements:
2225
description: Set to true if need to generate requirements.txt

install_poetry/install_poetry.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ fi
2626

2727
curl -sSL https://install.python-poetry.org | python3 -
2828
export PATH=$HOME/.local/bin:$PATH
29-
poetry config repositories.custom_repo "$REPO_URL"
30-
echo "custom_repo_name=custom_repo" >> "$GITHUB_OUTPUT"
29+
30+
if [[ -n "$REPO_URL" ]]; then
31+
poetry config repositories.custom_repo "$REPO_URL"
32+
echo "custom_repo_name=custom_repo" >> "$GITHUB_OUTPUT"
33+
fi;
3134

3235
POETRY_ADDITIONAL_OPTIONS=()
3336
if [[ -n "$EXTRAS" ]]; then

0 commit comments

Comments
 (0)