Commit dbfe6f6b authored by Cédric OLIVIER's avatar Cédric OLIVIER Committed by Pierre SMEYERS
Browse files

fix(poetry): add option to disable poetry

parent d2a71c1b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ Default configuration follows [this Python project structure](https://docs.pytho
The Python template supports [Poetry](https://python-poetry.org/) as packaging and dependency management tool.

If a `pyproject.toml` and `poetry.lock` file is detected at the root of your project structure, requirements will automatically be generated from Poetry.
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_.

+13 −2
Original line number Diff line number Diff line
@@ -30,6 +30,12 @@
      "name": "PIP_OPTS",
      "description": "pip extra [options](https://pip.pypa.io/en/stable/reference/pip/#general-options)",
      "advanced": true
    },
    {
      "name": "PYTHON_POETRY_DISABLED",
      "description": "Disable poetry support",
      "type": "boolean",
      "advanced": true
    }
  ],
  "features": [
@@ -169,7 +175,12 @@
        {
          "name": "RELEASE_VERSION_PART",
          "type": "enum",
          "values": ["", "major", "minor", "patch"],
          "values": [
            "",
            "major",
            "minor",
            "patch"
          ],
          "description": "The part of the version to increase (one of: `major`, `minor`, `patch`)",
          "default": "minor",
          "advanced": true
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ variables:
  }

  function install_test_requirements() {
    if [[ -f "pyproject.toml" ]]; then
    if [[ -f "pyproject.toml" ]] && [[ -z "${PYTHON_POETRY_DISABLED}" ]]; then
      if  [[ ! -f "poetry.lock" ]]; then 
        log_error "Poetry detected but \\e[33;1mpoetry.lock\\e[0m file not found: you shall commit it with your project files"
        exit 1