diff --git a/README.md b/README.md index 9134cb379c5b4ba3d04a4469b03fccb9b665a194..709e4ada69d66e4ff88b2c281b966d946ac854dd 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,12 @@ Poetry support is disabled if `PYTHON_POETRY_DISABLED` has a value. :warning: as stated in [Poetry documentation](https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control), _You should commit the `poetry.lock` file to your project repo so that all people working on the project are locked to the same versions of dependencies_. +It uses the following variables: + +| Name | description | default value | +| ------------------------ | ---------------------------------------------------------- | ----------------- | +| `PYTHON_POETRY_EXTRAS` | Poetry [extra sets of dependencies](https://python-poetry.org/docs/pyproject/#extras) to include, space separated | _none_ | + ## Jobs ### Lint jobs diff --git a/kicker.json b/kicker.json index 8d23974b51fa5f14e717e19aed918d1da69ebfb6..efffb3e8cbb401c1871af7307f6ae664a3498676 100644 --- a/kicker.json +++ b/kicker.json @@ -36,6 +36,11 @@ "description": "Disable poetry support", "type": "boolean", "advanced": true + }, + { + "name": "PYTHON_POETRY_EXTRAS", + "description": "Poetry [extra sets of dependencies](https://python-poetry.org/docs/pyproject/#extras) to include, space separated", + "advanced": true } ], "features": [ @@ -232,4 +237,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/templates/gitlab-ci-python.yml b/templates/gitlab-ci-python.yml index 977317fd358aa056fdb125884379ed69802f39df..0555e8bc60f89d4ddc7d8baa0e00968e737caee8 100644 --- a/templates/gitlab-ci-python.yml +++ b/templates/gitlab-ci-python.yml @@ -77,7 +77,7 @@ variables: fi log_info "--- Poetry detected: generating \\e[33;1m${TEST_REQUIREMENTS_FILE}\\e[0m from poetry.lock" pip install poetry - poetry export --without-hashes --dev -f requirements.txt --output "${TEST_REQUIREMENTS_FILE}" + poetry export --without-hashes ${PYTHON_POETRY_EXTRAS:+--extras "$PYTHON_POETRY_EXTRAS"} --dev -f requirements.txt --output "${TEST_REQUIREMENTS_FILE}" fi if [[ -f "${TEST_REQUIREMENTS_FILE}" ]]; then @@ -97,7 +97,7 @@ variables: fi log_info "--- Poetry detected: generating \\e[33;1m${REQUIREMENTS_FILE}\\e[0m from poetry.lock" pip install poetry - poetry export --without-hashes -f requirements.txt --output "${REQUIREMENTS_FILE}" + poetry export --without-hashes ${PYTHON_POETRY_EXTRAS:+--extras "$PYTHON_POETRY_EXTRAS"} -f requirements.txt --output "${REQUIREMENTS_FILE}" fi if [[ -f "${REQUIREMENTS_FILE}" ]]; then @@ -120,7 +120,7 @@ variables: fi log_info "--- Poetry detected: generating \\e[33;1m${TEST_REQUIREMENTS_FILE}\\e[0m from poetry.lock" pip install poetry - poetry export --without-hashes -f requirements.txt --output "${DOCS_REQUIREMENTS_FILE}" + poetry export --without-hashes ${PYTHON_POETRY_EXTRAS:+--extras "$PYTHON_POETRY_EXTRAS"} -f requirements.txt --output "${DOCS_REQUIREMENTS_FILE}" fi if [[ -f "${DOCS_REQUIREMENTS_FILE}" ]]; then