From 6e055c9434bec6a5edc76f05192ea49b7a33dd7e Mon Sep 17 00:00:00 2001 From: swayand Date: Tue, 7 Oct 2025 23:34:02 +0200 Subject: [PATCH 1/2] add dummy test+ --- .gitlab-ci.yml | 20 +++++++++++++++++--- pyproject.toml | 2 ++ tests/test_training.py | 6 ++++++ uv.lock | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 tests/test_training.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d785dea..eae01b6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,14 +1,28 @@ default: image: registry.gitlab.com/python-devs/ci-images:active - - stages: - - build - test - prepare - release + +unit_test_job: + stage: test # This stage must run before the release stage + image: registry.gitlab.com/python-devs/ci-images:active + + rules: + - if: $CI_COMMIT_TAG + when: never + - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH + script: + - uv run pytest --junitxml=report.xml + artifacts: + when: always + reports: + junit: report.xml + + prepare_job: stage: prepare # This stage must run before the release stage image: registry.gitlab.com/python-devs/ci-images:active diff --git a/pyproject.toml b/pyproject.toml index f53c92c..e03817c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,5 +42,7 @@ build-backend = "hatchling.build" dev = [ "id>=1.5.0", "mkdocs>=1.6.1", + "pytest>=8.4.2", + "pytest-gitlab>=0.3.1", "ruff>=0.11.2", ] diff --git a/tests/test_training.py b/tests/test_training.py new file mode 100644 index 0000000..b769fb6 --- /dev/null +++ b/tests/test_training.py @@ -0,0 +1,6 @@ + + + +def test_train(): + + assert 2 == 2 \ No newline at end of file diff --git a/uv.lock b/uv.lock index 7cde44a..087ce27 100644 --- a/uv.lock +++ b/uv.lock @@ -65,6 +65,7 @@ dependencies = [ dev = [ { name = "id" }, { name = "mkdocs" }, + { name = "pytest" }, { name = "ruff" }, ] @@ -85,6 +86,7 @@ requires-dist = [ dev = [ { name = "id", specifier = ">=1.5.0" }, { name = "mkdocs", specifier = ">=1.6.1" }, + { name = "pytest", specifier = ">=8.4.2" }, { name = "ruff", specifier = ">=0.11.2" }, ] @@ -188,6 +190,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/76/c6/c88e154df9c4e1a2a66ccf0005a88dfb2650c1dffb6f5ce603dfbd452ce3/idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3", size = 70442, upload-time = "2024-09-15T18:07:37.964Z" }, ] +[[package]] +name = "iniconfig" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" }, +] + [[package]] name = "jinja2" version = "3.1.6" @@ -429,6 +440,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/40/4b/2028861e724d3bd36227adfa20d3fd24c3fc6d52032f4a93c133be5d17ce/platformdirs-4.4.0-py3-none-any.whl", hash = "sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85", size = 18654, upload-time = "2025-08-26T14:32:02.735Z" }, ] +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + [[package]] name = "polars" version = "1.32.0" @@ -521,6 +541,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293, upload-time = "2025-01-06T17:26:25.553Z" }, ] +[[package]] +name = "pytest" +version = "8.4.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/5c/00a0e072241553e1a7496d638deababa67c5058571567b92a7eaa258397c/pytest-8.4.2.tar.gz", hash = "sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01", size = 1519618, upload-time = "2025-09-04T14:34:22.711Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a8/a4/20da314d277121d6534b3a980b29035dcd51e6744bd79075a6ce8fa4eb8d/pytest-8.4.2-py3-none-any.whl", hash = "sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79", size = 365750, upload-time = "2025-09-04T14:34:20.226Z" }, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0" -- GitLab From a78607cd60b07cb06ae6c2d82b8fcdf8b848cc45 Mon Sep 17 00:00:00 2001 From: swayand Date: Tue, 7 Oct 2025 23:36:47 +0200 Subject: [PATCH 2/2] finalize release --- .gitlab-ci.yml | 3 +-- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eae01b6..e3dd8bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -91,7 +91,7 @@ publish_pypi_job: - oidc_token=$(python -m id PYPI) - resp=$(curl -X POST https://upload.pypi.org/_/oidc/mint-token -d "{\"token\":\"${oidc_token}\"}") - api_token=$(jq --raw-output '.token' <<< "${resp}") - - uv publish --dry-run -u __token__ -p "${api_token}" + - uv publish -u __token__ -p "${api_token}" release_job: stage: release @@ -104,7 +104,6 @@ release_job: when: never # Do not run this job when a tag is created manually - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch script: - - exit 1 - echo "running release_job for $TAG" - echo "$RELEASE_NOTES" - sed -n '/^## \['"$TAG"'/,/^## /p' CHANGELOG | head -n -1 > RELEASE_NOTES diff --git a/pyproject.toml b/pyproject.toml index e03817c..f7a4ef9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,8 @@ license = "GPL-3.0-or-later" license-files = ["LICENSE"] [project.urls] -Homepage = "https://gitlab.com/gwhe/champions" +Homepage = "https://champions-ab0723.gitlab.io" +Repository = "https://gitlab.com/gwhe/champions" Issues = "https://gitlab.com/gwhe/champions/-/issues" [project.scripts] @@ -43,6 +44,5 @@ dev = [ "id>=1.5.0", "mkdocs>=1.6.1", "pytest>=8.4.2", - "pytest-gitlab>=0.3.1", "ruff>=0.11.2", ] -- GitLab