Skip to content
Snippets Groups Projects
Commit e079e305 authored by Emmanuel Courreges's avatar Emmanuel Courreges Committed by Pierre SMEYERS
Browse files

feat: add Poetry extras support (PYTHON_POETRY_EXTRAS variable)

parent e66945f9
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,12 @@ Poetry support is disabled if `PYTHON_POETRY_DISABLED` has a value. ...@@ -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_. :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 ## Jobs
### Lint jobs ### Lint jobs
......
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
"description": "Disable poetry support", "description": "Disable poetry support",
"type": "boolean", "type": "boolean",
"advanced": true "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": [ "features": [
......
...@@ -77,7 +77,7 @@ variables: ...@@ -77,7 +77,7 @@ variables:
fi fi
log_info "--- Poetry detected: generating \\e[33;1m${TEST_REQUIREMENTS_FILE}\\e[0m from poetry.lock" log_info "--- Poetry detected: generating \\e[33;1m${TEST_REQUIREMENTS_FILE}\\e[0m from poetry.lock"
pip install poetry 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 fi
if [[ -f "${TEST_REQUIREMENTS_FILE}" ]]; then if [[ -f "${TEST_REQUIREMENTS_FILE}" ]]; then
...@@ -97,7 +97,7 @@ variables: ...@@ -97,7 +97,7 @@ variables:
fi fi
log_info "--- Poetry detected: generating \\e[33;1m${REQUIREMENTS_FILE}\\e[0m from poetry.lock" log_info "--- Poetry detected: generating \\e[33;1m${REQUIREMENTS_FILE}\\e[0m from poetry.lock"
pip install poetry 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 fi
if [[ -f "${REQUIREMENTS_FILE}" ]]; then if [[ -f "${REQUIREMENTS_FILE}" ]]; then
...@@ -120,7 +120,7 @@ variables: ...@@ -120,7 +120,7 @@ variables:
fi fi
log_info "--- Poetry detected: generating \\e[33;1m${TEST_REQUIREMENTS_FILE}\\e[0m from poetry.lock" log_info "--- Poetry detected: generating \\e[33;1m${TEST_REQUIREMENTS_FILE}\\e[0m from poetry.lock"
pip install poetry 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 fi
if [[ -f "${DOCS_REQUIREMENTS_FILE}" ]]; then if [[ -f "${DOCS_REQUIREMENTS_FILE}" ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment