Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to install poetry without installing dependencies #20

Merged
merged 2 commits into from
Sep 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Optionally can export dependency tree to requirements.txt file.
If value is 'all', all extras will be installed
- install_only_dependencies -- If set to true, installs only dependencies for project, adds the parameter
`--no-root` to `poetry install` command. **Optional**. Default is '**false**'"
- skip_dependencies -- If set to true, installs only poetry without installing dependencies. **Optional**. Default is '**false**'"

### Outputs
No outputs defined
Expand Down
7 changes: 7 additions & 0 deletions install_poetry/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ inputs:
required: false
default: "false"

skip_dependencies:
description: |
If set to true, installs only poetry without installing dependencies
required: false
default: "false"

runs:
using: "composite"
steps:
Expand All @@ -79,4 +85,5 @@ runs:
EXPORT_CREDENTIALS: ${{ inputs.export_credentials }}
EXTRAS: ${{ inputs.install_extras }}
INSTALL_NO_ROOT: ${{ inputs.install_only_dependencies }}
SKIP_DEPENDENCIES: ${{ inputs.skip_dependencies}}
run: $GITHUB_ACTION_PATH/install_poetry.sh
7 changes: 6 additions & 1 deletion install_poetry/install_poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ if [[ "$(echo "$INSTALL_NO_ROOT" | tr '[:upper:]' '[:lower:]')" == 'true' ]]; th
POETRY_ADDITIONAL_OPTIONS+=("--no-root")
fi;

poetry install "${POETRY_ADDITIONAL_OPTIONS[@]}"
if [[ "$(echo "$SKIP_DEPENDENCIES" | tr '[:upper:]' '[:lower:]')" == 'false' ]]; then
echo "Install dependencies"
poetry install "${POETRY_ADDITIONAL_OPTIONS[@]}"
else
echo "Install dependencies skipped because SKIP_DEPENDENCIES is set to \"$SKIP_DEPENDENCIES\""
fi;

EXPORT_ADDITIONAL_OPTIONS=""
if [[ "$(echo "$EXPORT_CREDENTIALS" | tr '[:upper:]' '[:lower:]')" == "true" ]];
Expand Down