Skip to content

Commit

Permalink
add poetry check (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITProKyle authored Sep 26, 2023
1 parent fc6eaee commit d15737b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"mdformat",
"minlevel",
"printf",
"pyproject",
"redhat",
"venv",
"virtualenvs",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ steps:
| architecture | The target architecture (x86, x64) of the Python interpreter.The target architecture (x86, x64) of the Python interpreter. |
| cache-key-suffix | Temporary input to allow for slight customization of the cache key until full customization can be provided. This will be removed in the future. |
| ensure-cache-is-healthy | Ensure the cached Python virtual environment is healthy. In most cases, this should be left set to `true` (default). _(non-Windows only)_ |
| poetry-check | Whether validate the content of the `pyproject.toml` file and its consistency with the `poetry.lock` file. |
| poetry-check-cmd | The poetry command to run when checking the lock file (e.g. `check`). This command was changed in poetry 1.6 (default used by this action). To support older versions of poetry, provide a value for this input. |
| poetry-install | Whether to run `poetry install` (or the value of `poetry-install-cmd`). Defaults to `true`. |
| poetry-install-args | Additional args to pass to `poetry install`. Defaults to `-vvv --remove-untracked` |
| poetry-install-cmd | Command for installing poetry project. Can be used to provide a custom install command. The value of `poetry-install-args` is appended after this. Defaults to `poetry install`. This is also a check for the existence of a `Makefile` with a `setup-poetry` target. If found, using it takes precedence. |
Expand Down
17 changes: 17 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ inputs:
In most cases, this should be left set to `true` (default). _(non-Windows only)_
required: false
default: true
poetry-check:
description: Whether validate the content of the `pyproject.toml` file and its consistency with the `poetry.lock` file.
required: false
default: true
poetry-check-cmd:
description: |
The poetry command to run when checking the lock file (e.g. `check`).
This command was changed in poetry 1.6 (default used by this action).
To support older versions of poetry, provide a value for this input.
required: false
default: check
poetry-install:
description: Whether to run `poetry install`.
required: false
Expand Down Expand Up @@ -85,6 +96,12 @@ runs:
steps.composite-python-venv-cache.outputs.cache-hit == 'true'
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
shell: bash
- name: Check pyproject.toml & poetry.lock
if: inputs.poetry-check == 'true'
env:
POETRY_CHECK_CMD: ${{ inputs.poetry-check-cmd }}
run: poetry ${POETRY_CHECK_CMD}
shell: bash
- name: Install Dependencies
if: inputs.poetry-install == 'true'
env:
Expand Down

0 comments on commit d15737b

Please sign in to comment.