Skip to content

Commit

Permalink
feat: allow passing options to poetry install (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreone authored Feb 26, 2024
1 parent 7408b6e commit 324b00a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 20 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/python-deploy-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,24 @@ name: pypi_deploy
description: The runner group on which jobs will run.
required: false
type: string
poetry_install_options:
default: '--no-root'
description: Extra options to pass to Poetry when doing an install.
required: false
type: string
python_version:
description: The version of Python to use for the run.
default: '3.11'
description: The version of Python to use for the run.
required: false
type: string
timeout_minutes:
description: The maximum time (in minutes) for a job to run.
default: 5
description: The maximum time (in minutes) for a job to run.
required: false
type: number
working_directory:
description: The working directory where all jobs should be executed.
default: '.'
description: The working directory where all jobs should be executed.
required: false
type: string
secrets:
Expand Down Expand Up @@ -56,7 +61,7 @@ jobs:
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
run: poetry install ${{ inputs.poetry_install_options }}
- name: Setup PyPi credential
env:
PYPI_TOKEN: ${{ secrets.pypi_token }}
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/python-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ name: python-linting
description: The runner group on which jobs will run.
required: false
type: string
poetry_install_options:
default: '--no-root'
description: Extra options to pass to Poetry when doing an install.
required: false
type: string
python_version:
description: The version of Python to use for the run.
default: '3.11'
description: The version of Python to use for the run.
required: false
type: string
ruff_version:
Expand All @@ -25,23 +30,23 @@ name: python-linting
required: false
type: string
timeout_minutes:
description: The maximum time (in minutes) for a job to run.
default: 5
description: The maximum time (in minutes) for a job to run.
required: false
type: number
use_pylama:
description: If true, use pylama to lint the repository.
default: true
description: If true, use pylama to lint the repository.
required: false
type: boolean
use_ruff:
description: If true, use ruff to lint the repository.
default: false
description: If true, use ruff to lint the repository.
required: false
type: boolean
working_directory:
description: The working directory where all jobs should be executed.
default: '.'
description: The working directory where all jobs should be executed.
required: false
type: string

Expand All @@ -67,7 +72,7 @@ jobs:
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
run: poetry install ${{ inputs.poetry_install_options }}
- name: Lint with yamllint
run: poetry run yamllint . -s
- name: Lint with pylama
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/python-test-deploy-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ name: pypi_test_deploy
description: The runner group on which jobs will run.
required: false
type: string
poetry_install_options:
default: '--no-root'
description: Extra options to pass to Poetry when doing an install.
required: false
type: string
python_version:
description: The version of Python to use for the run.
default: '3.11'
Expand Down Expand Up @@ -56,7 +61,7 @@ jobs:
- name: Configure Poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
run: poetry install ${{ inputs.poetry_install_options }}
- name: Setup PyPi credential
env:
PYPI_TOKEN: ${{ secrets.pypi_test_token }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/python-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ name: Python Checks
description: The runner group on which jobs will run.
required: false
type: string
poetry_install_options:
default: '--no-root'
description: Extra options to pass to Poetry when doing an install.
required: false
type: string
python_versions:
default: '{ "versions": [ "3.7", "3.8", "3.9", "3.10", "3.11" ] }'
description: The versions of Python on which the unit tests should run.
Expand Down Expand Up @@ -67,7 +72,7 @@ jobs:
- name: Check pyproject.toml
run: poetry check
- name: Install dependencies
run: poetry install
run: poetry install ${{ inputs.poetry_install_options }}
- name: Test with green
run: |
poetry run green ${{ inputs.test_targets }}
Expand Down
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ This workflow will setup [Python][5] (`3.11`) and do a build and deploy of the

#### python-deploy-to-pypi Inputs

* `additional_packages`: String of additional packages that should be
installed. Default: ``
* `additional_packages`: String of additional packages that should be installed.
Default: ``
* `poetry_install_options`: Extra options to pass to Poetry when doing an install.
Default: `--no-root`
* `python_version`: The version of [Python][5] to use. Default: `3.11`

#### python-deploy-to-pypi Secrets
Expand All @@ -157,8 +159,10 @@ by setting the `use_ruff` input to `true`.

#### python-lint Inputs

* `additional_packages`: String of additional packages that should be
installed. Default: ``
* `additional_packages`: String of additional packages that should be installed.
Default: ``
* `poetry_install_options`: Extra options to pass to Poetry when doing an install.
Default: `--no-root`
* `python_version`: The version of [Python][5] to use. Default: `3.11`
* `ruff_version`: The version of [Ruff](https://github.com/astral-sh/ruff) to
run. Default: `0.1.0`
Expand All @@ -175,8 +179,10 @@ This workflow will setup [Python][5] (`3.11`) and do a build and deploy of the

#### python-test-deploy-to-pypi Inputs

* `additional_packages`: String of additional packages that should be
installed. Default: ``
* `additional_packages`: String of additional packages that should be installed.
Default: ``
* `poetry_install_options`: Extra options to pass to Poetry when doing an install.
Default: `--no-root`
* `python_version`: The version of [Python][5] to use. Default: `3.11`

#### python-test-deploy-to-pypi Secrets
Expand All @@ -192,8 +198,10 @@ install any [Python][5] dependencies.

#### python-unit-test Inputs

* `additional_packages`: String of additional packages that should be
installed. Default: ``
* `additional_packages`: String of additional packages that should be installed.
Default: ``
* `poetry_install_options`: Extra options to pass to Poetry when doing an install.
Default: `--no-root`
* `python_package_name`: The name of the [PyPi][2] package the repo will
create. Default: ``
* `python_versions`: The versions of [Python][5] to use in the unit tests, passed as a
Expand Down

0 comments on commit 324b00a

Please sign in to comment.