diff --git a/TODO.md b/TODO.md index a3b6fe0..924f353 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,4 @@ # TODO: -- add CI - add flake - use bool value for `generate_gitea_project` when the feature is available diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 745f65c..dfa5100 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -1,4 +1,17 @@ import subprocess +import os + +REMOVE_PATHS = [ + {% if cookiecutter.open_source_license == "Proprietary" %} "LICENSE", {% endif %} + {% if cookiecutter.configure_ci == "False" %} ".woodpecker.yml", {% endif %} +] + +for path in REMOVE_PATHS: + if path and os.path.exists(path): + if os.path.isdir(path): + os.rmdir(path) + else: + os.unlink(path) subprocess.call(["git", "init"]) subprocess.call(["git", "checkout", "-b", "main"]) diff --git a/{{ cookiecutter.project_slug }}/.woodpecker.yml b/{{ cookiecutter.project_slug }}/.woodpecker.yml index 300eafc..8fe54b3 100644 --- a/{{ cookiecutter.project_slug }}/.woodpecker.yml +++ b/{{ cookiecutter.project_slug }}/.woodpecker.yml @@ -1,5 +1,14 @@ pipeline: - a-test-step: - image: debian + test: + image: python:${PYTHON_VERSION} + pull: true + environment: + - POETRY_VIRTUALENVS_IN_PROJECT=true commands: - - echo "Testing.." + - pip install poetry + - poetry install + - poetry run pytest + +matrix: + PYTHON_VERSION: + - {{ cookiecutter. python_min_version}}