From 485312d9ea61ed459442705d50278a7aec04b3e2 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Tue, 11 Feb 2025 01:37:24 +0100 Subject: [PATCH 1/3] feat(jobs): update scripts to use uv --- jobs/scripts/i18n-find-untranslated.sh | 8 +++++++- jobs/scripts/plips.sh | 8 ++++---- jobs/scripts/pr-tests.sh | 12 +++++++----- jobs/scripts/robot.sh | 7 ++++--- jobs/scripts/tests.sh | 7 ++++--- jobs/scripts/translations.sh | 8 +++++++- jobs/scripts/volto-i18n.sh | 8 +++++--- 7 files changed, 38 insertions(+), 20 deletions(-) diff --git a/jobs/scripts/i18n-find-untranslated.sh b/jobs/scripts/i18n-find-untranslated.sh index 0f4e275..3163163 100644 --- a/jobs/scripts/i18n-find-untranslated.sh +++ b/jobs/scripts/i18n-find-untranslated.sh @@ -1,7 +1,13 @@ #!/bin/sh set -x -pip install -r requirements.txt +PYTHON_VERSION="{py}" + +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate +uv pip install -r requirements.txt + buildout buildout:git-clone-depth=1 -c experimental/i18n.cfg install i18n-find-untranslated i18ndude export PYTHONIOENCODING=utf-8 diff --git a/jobs/scripts/plips.sh b/jobs/scripts/plips.sh index 4a02652..272e6ea 100644 --- a/jobs/scripts/plips.sh +++ b/jobs/scripts/plips.sh @@ -3,10 +3,10 @@ set -x PYTHON_VERSION="{py}" -/srv/python${{PYTHON_VERSION}}/bin/python3 -m venv venv -. venv/bin/activate - -pip install -r requirements.txt +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate +uv pip install -r requirements.txt buildout buildout:git-clone-depth=1 -c {buildout} diff --git a/jobs/scripts/pr-tests.sh b/jobs/scripts/pr-tests.sh index 87e9018..4e35dc1 100644 --- a/jobs/scripts/pr-tests.sh +++ b/jobs/scripts/pr-tests.sh @@ -1,19 +1,21 @@ #!/bin/bash set -x -python_version="{py}" +PYTHON_VERSION="{py}" PLONE_VERSION="{plone-version}" -/srv/python${{python_version}}/bin/python3 -m venv venv -. venv/bin/activate +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate if [ "$COREDEV" = "1" ]; then # TODO(gforcada): allow to test remote branches (i.e. branches not in github.com/plone/buildout.coredev) git checkout $BRANCH fi -pip install pygithub==1.56 -pip install -r requirements.txt +uv pip install pygithub==1.56 +uv pip install -r requirements.txt + buildout buildout:git-clone-depth=1 -c buildout.cfg return_code="all_right" diff --git a/jobs/scripts/robot.sh b/jobs/scripts/robot.sh index d8ee0ff..f1f4c2f 100644 --- a/jobs/scripts/robot.sh +++ b/jobs/scripts/robot.sh @@ -4,10 +4,11 @@ set -x PYTHON_VERSION="{py}" PLONE_VERSION="{plone-version}" -/srv/python${{PYTHON_VERSION}}/bin/python3 -m venv venv -. venv/bin/activate +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate +uv pip install -r requirements.txt -pip install -r requirements.txt buildout buildout:git-clone-depth=1 -c buildout.cfg export PATH="/usr/lib/chromium-browser:$PATH" diff --git a/jobs/scripts/tests.sh b/jobs/scripts/tests.sh index 069550c..ce5d4d0 100644 --- a/jobs/scripts/tests.sh +++ b/jobs/scripts/tests.sh @@ -3,10 +3,11 @@ set -x PYTHON_VERSION="{py}" PLONE_VERSION="{plone-version}" -/srv/python${{PYTHON_VERSION}}/bin/python3 -m venv venv -. venv/bin/activate -pip install -r requirements.txt +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate +uv pip install -r requirements.txt buildout buildout:git-clone-depth=1 -c buildout.cfg diff --git a/jobs/scripts/translations.sh b/jobs/scripts/translations.sh index c0e7ee6..e53732f 100644 --- a/jobs/scripts/translations.sh +++ b/jobs/scripts/translations.sh @@ -1,7 +1,13 @@ #!/bin/sh set -x -pip install -r requirements.txt +PYTHON_VERSION="{py}" + +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate +uv pip install -r requirements.txt + buildout buildout:git-clone-depth=1 -c experimental/i18n.cfg install i18ndude i18n i18n-update-all ./bin/i18n-update-all diff --git a/jobs/scripts/volto-i18n.sh b/jobs/scripts/volto-i18n.sh index 823782e..2236c30 100644 --- a/jobs/scripts/volto-i18n.sh +++ b/jobs/scripts/volto-i18n.sh @@ -1,11 +1,13 @@ #!/bin/bash set -x +PYTHON_VERSION="{py}" VOLTO_BRANCH="{branch}" -python -m venv venv -. venv/bin/activate -pip install i18ndude +uv python install ${{PYTHON_VERSION}} +uv venv -p ${{PYTHON_VERSION}} +. .venv/bin/activate +uv pip install i18ndude export PYTHONIOENCODING=utf-8 From 8caea611913576908075f887782ee0fd4445aad9 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Tue, 11 Feb 2025 01:38:44 +0100 Subject: [PATCH 2/3] feat(jobs): test Plone 6.1 with Python 3.14 Thanks to uv, this is a matter of a single line change! --- jobs/jobs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jobs/jobs.yml b/jobs/jobs.yml index 8b202ff..5796600 100644 --- a/jobs/jobs.yml +++ b/jobs/jobs.yml @@ -122,6 +122,8 @@ - "6.1" - "6.0" py: + - "3.14": + python-version: "Python3.14" - "3.12": python-version: "Python3.12" - "3.11": @@ -133,6 +135,8 @@ exclude: - plone-version: "6.1" py: "3.10" + - plone-version: "6.0" + py: "3.14" jobs: - "plone-{plone-version}-python-{py}-scheduled" - "plone-{plone-version}-python-{py}-robot-{browser}-scheduled" From 61960eaebcf9ce571d472c948a38c50abb1dc4a0 Mon Sep 17 00:00:00 2001 From: Gil Forcada Codinachs Date: Tue, 11 Feb 2025 01:40:35 +0100 Subject: [PATCH 3/3] feat(jobs): simplify them thanks to uv --- jobs/jobs.yml | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/jobs/jobs.yml b/jobs/jobs.yml index 5796600..e1795be 100644 --- a/jobs/jobs.yml +++ b/jobs/jobs.yml @@ -160,7 +160,9 @@ - "16.x.x" - "17.x.x" - "main" - python-version: "Python3.9" + py: + - "3.9": + python-version: "Python3.9" jobs: - "volto-translations-{branch}" @@ -194,12 +196,7 @@ - timed: "@weekly" builders: - - shining-panda: - build-environment: virtualenv - python-version: "{python-version}" - clear: true - nature: shell - command: !include-raw: scripts/translations.sh + - shell: !include-raw: scripts/translations.sh wrappers: - custom-workspace-cleanup @@ -232,12 +229,7 @@ - timed: "@weekly" builders: - - shining-panda: - build-environment: virtualenv - python-version: "{python-version}" - clear: true - nature: shell - command: !include-raw: scripts/volto-i18n.sh + - shell: !include-raw: scripts/volto-i18n.sh wrappers: - custom-workspace-cleanup @@ -570,12 +562,7 @@ - timed: "@weekly" builders: - - shining-panda: - build-environment: virtualenv - python-version: "{python-version}" - clear: true - nature: shell - command: !include-raw: scripts/i18n-find-untranslated.sh + - shell: !include-raw: scripts/i18n-find-untranslated.sh wrappers: - custom-workspace-cleanup