Skip to content

Commit 3cba806

Browse files
committed
Fix gitlab CI
1 parent d6921c8 commit 3cba806

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

{{ cookiecutter.project_name.lower().replace(' ', '-') }}/.gitlab-ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Global --------------------------
22

33
variables:
4-
UV_VERSION: "0.8.14"
5-
PYTHON_VERSION: "{{ cookiecutter.python_version }}"
6-
BASE_LAYER: bookworm-slim
74
# GitLab CI creates a separate mountpoint for the build directory,
85
# so we need to copy instead of using hard links.
96
UV_LINK_MODE: copy
@@ -23,8 +20,9 @@ stages:
2320
# Jobs templates ------------------
2421

2522
.install-deps-template: &install-deps
26-
image: ghcr.io/astral-sh/uv:$UV_VERSION-python$PYTHON_VERSION-$BASE_LAYER
23+
image: python:{{ cookiecutter.python_version }}
2724
before_script:
25+
- pip install uv==0.8.14
2826
- uv --version
2927
- uv sync --dev
3028
after_script:

{{ cookiecutter.project_name.lower().replace(' ', '-') }}/Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,26 @@ check-ruff:
5656
.PHONY: check-codestyle
5757
check-codestyle:
5858
uv run ruff format $(CODE) --check
59-
60-
59+
{% if cookiecutter.git_platform == 'gitlab' %}
60+
.PHONY: check-ruff-gitlab
61+
check-ruff-gitlab:
62+
uv run ruff check $(CODE) --output-format=gitlab > ruff-report.json
63+
{% endif %}
64+
{% if cookiecutter.git_platform == 'github' %}
6165
.PHONY: check-ruff-github
6266
check-ruff-github:
6367
uv run ruff check $(CODE) --no-fix --output-format=github
64-
68+
{% endif %}
6569

6670
.PHONY: check-mypy
6771
check-mypy:
6872
uv run mypy --install-types --non-interactive --config-file pyproject.toml $(CODE)
69-
73+
{% if cookiecutter.git_platform == 'gitlab' %}
74+
.PHONY: check-mypy-gitlab
75+
check-mypy-gitlab:
76+
uv run mypy --install-types --non-interactive --no-error-summary --no-pretty --config-file pyproject.toml $(CODE) \
77+
2>&1 | uv run mypy-gitlab-code-quality > mypy-report.json
78+
{% endif %}
7079
.PHONY: static-lint
7180
static-lint: check-ruff check-mypy
7281

0 commit comments

Comments
 (0)