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
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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
+6 −1
Original line number Diff line number Diff line
@@ -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": [
+3 −3
Original line number Diff line number Diff line
@@ -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