From dbfe6f6b9abee4bf4aa68b603d015283a5e0bcc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20OLIVIER?= <cedric3.olivier@orange.com> Date: Mon, 26 Jul 2021 10:31:00 +0000 Subject: [PATCH] fix(poetry): add option to disable poetry --- README.md | 1 + kicker.json | 15 +++++++++++++-- templates/gitlab-ci-python.yml | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cc1e8ad..664e108 100644 --- a/README.md +++ b/README.md @@ -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_. diff --git a/kicker.json b/kicker.json index 4bbcde2..8d23974 100644 --- a/kicker.json +++ b/kicker.json @@ -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 @@ -221,4 +232,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/templates/gitlab-ci-python.yml b/templates/gitlab-ci-python.yml index a167d4b..dd5a5c6 100644 --- a/templates/gitlab-ci-python.yml +++ b/templates/gitlab-ci-python.yml @@ -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 -- GitLab