From c7d628d545bc89e1b221cd14289c0fdf88ec8e12 Mon Sep 17 00:00:00 2001 From: perl_d Date: Fri, 27 Feb 2026 12:10:29 +0100 Subject: [PATCH 1/3] Update repo with template version v1.2.7 --- .copier-answers.yml | 2 +- .gitea/workflows/ci.yml | 22 ++++++---- .gitea/workflows/create_update_pr.yml | 62 +++++++++++++++++++++++++++ .gitlab-ci.yml | 7 --- pyproject.toml | 2 +- 5 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 .gitea/workflows/create_update_pr.yml delete mode 100644 .gitlab-ci.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index f853e50..8cf6712 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -2,7 +2,7 @@ # It is needed to track the repo template version, and editing may break things. # This file will be overwritten by copier on template updates. -_commit: v1.2.2 +_commit: v1.2.7 _src_path: https://github.com/bec-project/plugin_copier_template.git make_commit: true project_name: pearl diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f7e971c..d560e5e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -28,7 +28,7 @@ on: description: "Python version to use" required: false type: string - default: "3.11" + default: "3.12" permissions: pull-requests: write @@ -44,7 +44,18 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "${{ inputs.PYTHON_VERSION || '3.11' }}" + python-version: "${{ inputs.PYTHON_VERSION || '3.12' }}" + + - name: Checkout BEC Plugin Repository + uses: actions/checkout@v4 + with: + repository: bec/pearl + ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" + path: ./pearl + + - name: Lint for merge conflicts + run: | + - name: Checkout BEC Core uses: actions/checkout@v4 @@ -67,13 +78,6 @@ jobs: ref: "${{ inputs.BEC_WIDGETS_BRANCH || 'main' }}" path: ./bec_widgets - - name: Checkout BEC Plugin Repository - uses: actions/checkout@v4 - with: - repository: bec/pearl - ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" - path: ./pearl - - name: Install dependencies shell: bash run: | diff --git a/.gitea/workflows/create_update_pr.yml b/.gitea/workflows/create_update_pr.yml new file mode 100644 index 0000000..4a7a8c2 --- /dev/null +++ b/.gitea/workflows/create_update_pr.yml @@ -0,0 +1,62 @@ +name: Create template upgrade PR for pearl +on: + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + create_update_branch_and_pr: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install tools + run: | + pip install copier PySide6 + + - name: Checkout + uses: actions/checkout@v4 + + - name: Perform update + run: | + git config --global user.email "bec_ci_staging@psi.ch" + git config --global user.name "BEC automated CI" + + branch="chore/update-template-$(python -m uuid)" + echo "switching to branch $branch" + git checkout -b $branch + + echo "Running copier update..." + output="$(copier update --trust --defaults --conflict inline 2>&1)" + echo "$output" + msg="$(printf '%s\n' "$output" | head -n 1)" + + if ! grep -q "make_commit: true" .copier-answers.yml ; then + echo "Autocommit not made, committing..." + git add -A + git commit -a -m "$msg" + fi + + if diff-index --quiet HEAD ; then + echo "No changes detected" + exit 0 + fi + + git push -u origin $branch + curl -X POST "https://gitea.psi.ch/api/v1/repos/${{ gitea.repository }}/pulls" \ + -H "Authorization: token ${{ secrets.CI_REPO_WRITE }}" \ + -H "Content-Type: application/json" \ + -d "{ + \"title\": \"Template: $(echo $msg)\", + \"body\": \"This PR was created by Gitea Actions\", + \"head\": \"$(echo $branch)\", + \"base\": \"main\" + }" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ecb3565..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,7 +0,0 @@ -include: -- file: /templates/plugin-repo-template.yml - inputs: - name: pearl - target: pearl - branch: $CHILD_PIPELINE_BRANCH - project: bec/awi_utils diff --git a/pyproject.toml b/pyproject.toml index 9f1078a..7f1c1be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" name = "pearl" version = "0.0.0" description = "A plugin repository for BEC" -requires-python = ">=3.10" +requires-python = ">=3.11" classifiers = [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", -- 2.49.1 From 65fc416516b7314428b70732a55a175c3654be41 Mon Sep 17 00:00:00 2001 From: perl_d Date: Fri, 27 Feb 2026 15:48:56 +0100 Subject: [PATCH 2/3] Update repo with template version v1.2.8 --- .copier-answers.yml | 2 +- .gitea/workflows/ci.yml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 8cf6712..41cfaaf 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -2,7 +2,7 @@ # It is needed to track the repo template version, and editing may break things. # This file will be overwritten by copier on template updates. -_commit: v1.2.7 +_commit: v1.2.8 _src_path: https://github.com/bec-project/plugin_copier_template.git make_commit: true project_name: pearl diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d560e5e..b9763bf 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -53,9 +53,10 @@ jobs: ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" path: ./pearl - - name: Lint for merge conflicts - run: | - + - name: Lint for merge conflicts from template updates + shell: bash + # Find all Copier conflicts except this line + run: '! grep -r "<<<<<<< before updating" | grep -v "grep -r \"<<<<<<< before updating"' - name: Checkout BEC Core uses: actions/checkout@v4 -- 2.49.1 From 4e2b37aae388f5bd56dcd678c6899b400ff36ab8 Mon Sep 17 00:00:00 2001 From: perl_d Date: Fri, 27 Feb 2026 15:56:41 +0100 Subject: [PATCH 3/3] fix: rename repo to pearl_bec --- .copier-answers.yml | 2 +- .gitea/workflows/ci.yml | 10 +++++----- .gitea/workflows/create_update_pr.yml | 2 +- {pearl => pearl_bec}/__init__.py | 0 .../bec_ipython_client/__init__.py | 0 .../high_level_interface/__init__.py | 0 .../bec_ipython_client/startup/__init__.py | 0 .../startup/post_startup.py | 0 .../bec_ipython_client/startup/pre_startup.py | 4 ++-- {pearl => pearl_bec}/bec_widgets/__init__.py | 0 .../bec_widgets/auto_updates/__init__.py | 0 .../bec_widgets/widgets/__init__.py | 0 {pearl => pearl_bec}/deployments/__init__.py | 0 .../deployments/device_server/__init__.py | 0 .../deployments/device_server/startup.py | 0 .../device_configs/__init__.py | 0 {pearl => pearl_bec}/devices/__init__.py | 0 {pearl => pearl_bec}/file_writer/__init__.py | 0 {pearl => pearl_bec}/macros/README.md | 2 +- {pearl => pearl_bec}/macros/__init__.py | 0 {pearl => pearl_bec}/scans/__init__.py | 0 .../scans/metadata_schema/__init__.py | 0 .../metadata_schema_registry.py | 0 .../metadata_schema_template.py | 0 {pearl => pearl_bec}/services/__init__.py | 0 pyproject.toml | 20 +++++++++---------- 26 files changed, 20 insertions(+), 20 deletions(-) rename {pearl => pearl_bec}/__init__.py (100%) rename {pearl => pearl_bec}/bec_ipython_client/__init__.py (100%) rename {pearl => pearl_bec}/bec_ipython_client/high_level_interface/__init__.py (100%) rename {pearl => pearl_bec}/bec_ipython_client/startup/__init__.py (100%) rename {pearl => pearl_bec}/bec_ipython_client/startup/post_startup.py (100%) rename {pearl => pearl_bec}/bec_ipython_client/startup/pre_startup.py (95%) rename {pearl => pearl_bec}/bec_widgets/__init__.py (100%) rename {pearl => pearl_bec}/bec_widgets/auto_updates/__init__.py (100%) rename {pearl => pearl_bec}/bec_widgets/widgets/__init__.py (100%) rename {pearl => pearl_bec}/deployments/__init__.py (100%) rename {pearl => pearl_bec}/deployments/device_server/__init__.py (100%) rename {pearl => pearl_bec}/deployments/device_server/startup.py (100%) rename {pearl => pearl_bec}/device_configs/__init__.py (100%) rename {pearl => pearl_bec}/devices/__init__.py (100%) rename {pearl => pearl_bec}/file_writer/__init__.py (100%) rename {pearl => pearl_bec}/macros/README.md (86%) rename {pearl => pearl_bec}/macros/__init__.py (100%) rename {pearl => pearl_bec}/scans/__init__.py (100%) rename {pearl => pearl_bec}/scans/metadata_schema/__init__.py (100%) rename {pearl => pearl_bec}/scans/metadata_schema/metadata_schema_registry.py (100%) rename {pearl => pearl_bec}/scans/metadata_schema/metadata_schema_template.py (100%) rename {pearl => pearl_bec}/services/__init__.py (100%) diff --git a/.copier-answers.yml b/.copier-answers.yml index 41cfaaf..3f3c17a 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -5,5 +5,5 @@ _commit: v1.2.8 _src_path: https://github.com/bec-project/plugin_copier_template.git make_commit: true -project_name: pearl +project_name: pearl_bec widget_plugins_input: [] diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b9763bf..07b45fe 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI for pearl +name: CI for pearl_bec on: push: pull_request: @@ -49,9 +49,9 @@ jobs: - name: Checkout BEC Plugin Repository uses: actions/checkout@v4 with: - repository: bec/pearl + repository: bec/pearl_bec ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" - path: ./pearl + path: ./pearl_bec - name: Lint for merge conflicts from template updates shell: bash @@ -95,8 +95,8 @@ jobs: uv pip install --system -e ./bec/bec_ipython_client uv pip install --system -e ./bec/bec_server[dev] uv pip install --system -e ./bec_widgets[dev,pyside6] - uv pip install --system -e ./pearl + uv pip install --system -e ./pearl_bec - name: Run Pytest with Coverage id: coverage - run: pytest --random-order --cov=./pearl --cov-config=./pearl/pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./pearl/tests/ || test $? -eq 5 + run: pytest --random-order --cov=./pearl_bec --cov-config=./pearl_bec/pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./pearl_bec/tests/ || test $? -eq 5 diff --git a/.gitea/workflows/create_update_pr.yml b/.gitea/workflows/create_update_pr.yml index 4a7a8c2..6d6365a 100644 --- a/.gitea/workflows/create_update_pr.yml +++ b/.gitea/workflows/create_update_pr.yml @@ -1,4 +1,4 @@ -name: Create template upgrade PR for pearl +name: Create template upgrade PR for pearl_bec on: workflow_dispatch: diff --git a/pearl/__init__.py b/pearl_bec/__init__.py similarity index 100% rename from pearl/__init__.py rename to pearl_bec/__init__.py diff --git a/pearl/bec_ipython_client/__init__.py b/pearl_bec/bec_ipython_client/__init__.py similarity index 100% rename from pearl/bec_ipython_client/__init__.py rename to pearl_bec/bec_ipython_client/__init__.py diff --git a/pearl/bec_ipython_client/high_level_interface/__init__.py b/pearl_bec/bec_ipython_client/high_level_interface/__init__.py similarity index 100% rename from pearl/bec_ipython_client/high_level_interface/__init__.py rename to pearl_bec/bec_ipython_client/high_level_interface/__init__.py diff --git a/pearl/bec_ipython_client/startup/__init__.py b/pearl_bec/bec_ipython_client/startup/__init__.py similarity index 100% rename from pearl/bec_ipython_client/startup/__init__.py rename to pearl_bec/bec_ipython_client/startup/__init__.py diff --git a/pearl/bec_ipython_client/startup/post_startup.py b/pearl_bec/bec_ipython_client/startup/post_startup.py similarity index 100% rename from pearl/bec_ipython_client/startup/post_startup.py rename to pearl_bec/bec_ipython_client/startup/post_startup.py diff --git a/pearl/bec_ipython_client/startup/pre_startup.py b/pearl_bec/bec_ipython_client/startup/pre_startup.py similarity index 95% rename from pearl/bec_ipython_client/startup/pre_startup.py rename to pearl_bec/bec_ipython_client/startup/pre_startup.py index c500de3..5df88ef 100644 --- a/pearl/bec_ipython_client/startup/pre_startup.py +++ b/pearl_bec/bec_ipython_client/startup/pre_startup.py @@ -7,7 +7,7 @@ import os from bec_lib.service_config import ServiceConfig -import pearl +import pearl_bec def extend_command_line_args(parser): @@ -23,7 +23,7 @@ def get_config() -> ServiceConfig: """ Create and return the ServiceConfig for the plugin repository """ - deployment_path = os.path.dirname(os.path.dirname(os.path.dirname(pearl.__file__))) + deployment_path = os.path.dirname(os.path.dirname(os.path.dirname(pearl_bec.__file__))) files = os.listdir(deployment_path) if "bec_config.yaml" in files: return ServiceConfig(config_path=os.path.join(deployment_path, "bec_config.yaml")) diff --git a/pearl/bec_widgets/__init__.py b/pearl_bec/bec_widgets/__init__.py similarity index 100% rename from pearl/bec_widgets/__init__.py rename to pearl_bec/bec_widgets/__init__.py diff --git a/pearl/bec_widgets/auto_updates/__init__.py b/pearl_bec/bec_widgets/auto_updates/__init__.py similarity index 100% rename from pearl/bec_widgets/auto_updates/__init__.py rename to pearl_bec/bec_widgets/auto_updates/__init__.py diff --git a/pearl/bec_widgets/widgets/__init__.py b/pearl_bec/bec_widgets/widgets/__init__.py similarity index 100% rename from pearl/bec_widgets/widgets/__init__.py rename to pearl_bec/bec_widgets/widgets/__init__.py diff --git a/pearl/deployments/__init__.py b/pearl_bec/deployments/__init__.py similarity index 100% rename from pearl/deployments/__init__.py rename to pearl_bec/deployments/__init__.py diff --git a/pearl/deployments/device_server/__init__.py b/pearl_bec/deployments/device_server/__init__.py similarity index 100% rename from pearl/deployments/device_server/__init__.py rename to pearl_bec/deployments/device_server/__init__.py diff --git a/pearl/deployments/device_server/startup.py b/pearl_bec/deployments/device_server/startup.py similarity index 100% rename from pearl/deployments/device_server/startup.py rename to pearl_bec/deployments/device_server/startup.py diff --git a/pearl/device_configs/__init__.py b/pearl_bec/device_configs/__init__.py similarity index 100% rename from pearl/device_configs/__init__.py rename to pearl_bec/device_configs/__init__.py diff --git a/pearl/devices/__init__.py b/pearl_bec/devices/__init__.py similarity index 100% rename from pearl/devices/__init__.py rename to pearl_bec/devices/__init__.py diff --git a/pearl/file_writer/__init__.py b/pearl_bec/file_writer/__init__.py similarity index 100% rename from pearl/file_writer/__init__.py rename to pearl_bec/file_writer/__init__.py diff --git a/pearl/macros/README.md b/pearl_bec/macros/README.md similarity index 86% rename from pearl/macros/README.md rename to pearl_bec/macros/README.md index f846214..96cb0ff 100644 --- a/pearl/macros/README.md +++ b/pearl_bec/macros/README.md @@ -2,5 +2,5 @@ This directory is intended to store macros which will be loaded automatically when starting BEC. Macros are small functions to make repetitive tasks easier. Functions defined in python files in this directory will be accessible from the BEC console. -Please do not put any code outside of function definitions here. If you wish for code to be automatically run when starting BEC, see the startup script at pearl/bec_ipython_client/startup/post_startup.py +Please do not put any code outside of function definitions here. If you wish for code to be automatically run when starting BEC, see the startup script at pearl_bec/bec_ipython_client/startup/post_startup.py For a guide on writing macros, please see: https://bec.readthedocs.io/en/latest/user/command_line_interface.html#how-to-write-a-macro diff --git a/pearl/macros/__init__.py b/pearl_bec/macros/__init__.py similarity index 100% rename from pearl/macros/__init__.py rename to pearl_bec/macros/__init__.py diff --git a/pearl/scans/__init__.py b/pearl_bec/scans/__init__.py similarity index 100% rename from pearl/scans/__init__.py rename to pearl_bec/scans/__init__.py diff --git a/pearl/scans/metadata_schema/__init__.py b/pearl_bec/scans/metadata_schema/__init__.py similarity index 100% rename from pearl/scans/metadata_schema/__init__.py rename to pearl_bec/scans/metadata_schema/__init__.py diff --git a/pearl/scans/metadata_schema/metadata_schema_registry.py b/pearl_bec/scans/metadata_schema/metadata_schema_registry.py similarity index 100% rename from pearl/scans/metadata_schema/metadata_schema_registry.py rename to pearl_bec/scans/metadata_schema/metadata_schema_registry.py diff --git a/pearl/scans/metadata_schema/metadata_schema_template.py b/pearl_bec/scans/metadata_schema/metadata_schema_template.py similarity index 100% rename from pearl/scans/metadata_schema/metadata_schema_template.py rename to pearl_bec/scans/metadata_schema/metadata_schema_template.py diff --git a/pearl/services/__init__.py b/pearl_bec/services/__init__.py similarity index 100% rename from pearl/services/__init__.py rename to pearl_bec/services/__init__.py diff --git a/pyproject.toml b/pyproject.toml index 7f1c1be..20e84b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling"] build-backend = "hatchling.build" [project] -name = "pearl" +name = "pearl_bec" version = "0.0.0" description = "A plugin repository for BEC" requires-python = ">=3.11" @@ -28,29 +28,29 @@ dev = [ ] [project.entry-points."bec"] -plugin_bec = "pearl" +plugin_bec = "pearl_bec" [project.entry-points."bec.deployment.device_server"] -plugin_ds_startup = "pearl.deployments.device_server.startup:run" +plugin_ds_startup = "pearl_bec.deployments.device_server.startup:run" [project.entry-points."bec.file_writer"] -plugin_file_writer = "pearl.file_writer" +plugin_file_writer = "pearl_bec.file_writer" [project.entry-points."bec.scans"] -plugin_scans = "pearl.scans" +plugin_scans = "pearl_bec.scans" [project.entry-points."bec.scans.metadata_schema"] -plugin_metadata_schema = "pearl.scans.metadata_schema" +plugin_metadata_schema = "pearl_bec.scans.metadata_schema" [project.entry-points."bec.ipython_client_startup"] -plugin_ipython_client_pre = "pearl.bec_ipython_client.startup.pre_startup" -plugin_ipython_client_post = "pearl.bec_ipython_client.startup" +plugin_ipython_client_pre = "pearl_bec.bec_ipython_client.startup.pre_startup" +plugin_ipython_client_post = "pearl_bec.bec_ipython_client.startup" [project.entry-points."bec.widgets.auto_updates"] -plugin_widgets_update = "pearl.bec_widgets.auto_updates" +plugin_widgets_update = "pearl_bec.bec_widgets.auto_updates" [project.entry-points."bec.widgets.user_widgets"] -plugin_widgets = "pearl.bec_widgets.widgets" +plugin_widgets = "pearl_bec.bec_widgets.widgets" [tool.hatch.build.targets.wheel] include = ["*"] -- 2.49.1