bec-widgets 0.52.0__py3-none-any.whl → 0.53.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. .git_hooks/pre-commit +3 -0
  2. .gitignore +177 -0
  3. .gitlab/issue_templates/bug_report_template.md +17 -0
  4. .gitlab/issue_templates/documentation_update_template.md +27 -0
  5. .gitlab/issue_templates/feature_request_template.md +40 -0
  6. .gitlab/merge_request_templates/default.md +28 -0
  7. .gitlab-ci.yml +225 -0
  8. .pylintrc +581 -0
  9. .readthedocs.yaml +25 -0
  10. CHANGELOG.md +176 -0
  11. PKG-INFO +33 -0
  12. bec_widgets-0.52.0.dist-info/METADATA → README.md +6 -42
  13. bec_widgets/cli/client.py +132 -17
  14. bec_widgets/cli/client_utils.py +1 -0
  15. bec_widgets/cli/generate_cli.py +1 -0
  16. bec_widgets/cli/rpc_register.py +4 -0
  17. bec_widgets/cli/rpc_wigdet_handler.py +2 -3
  18. bec_widgets/examples/modular_app/modular.ui +92 -0
  19. bec_widgets/examples/modular_app/modular_app.py +197 -0
  20. bec_widgets/examples/motor_movement/motor_control_compilations.py +1 -1
  21. bec_widgets/examples/motor_movement/motor_example.py +3 -12
  22. bec_widgets/utils/bec_connector.py +7 -0
  23. bec_widgets/utils/bec_dispatcher.py +1 -3
  24. bec_widgets/utils/bec_table.py +1 -0
  25. bec_widgets/utils/container_utils.py +3 -0
  26. bec_widgets/utils/crosshair.py +1 -0
  27. bec_widgets/utils/entry_validator.py +2 -0
  28. bec_widgets/utils/layout_manager.py +4 -0
  29. bec_widgets/utils/widget_io.py +5 -0
  30. bec_widgets/utils/yaml_dialog.py +2 -0
  31. bec_widgets/validation/monitor_config_validator.py +2 -1
  32. bec_widgets/widgets/dock/dock_area.py +6 -4
  33. bec_widgets/widgets/figure/figure.py +15 -15
  34. bec_widgets/widgets/monitor/config_dialog.py +3 -19
  35. bec_widgets/widgets/monitor/example_configs/config_device.yaml +60 -0
  36. bec_widgets/widgets/monitor/example_configs/config_scans.yaml +92 -0
  37. bec_widgets/widgets/motor_map/motor_map.py +3 -14
  38. bec_widgets/widgets/plots/image.py +41 -0
  39. bec_widgets/widgets/plots/motor_map.py +16 -9
  40. bec_widgets/widgets/plots/plot_base.py +10 -0
  41. bec_widgets/widgets/plots/waveform.py +31 -0
  42. bec_widgets/widgets/scan_control/scan_control.py +11 -5
  43. bec_widgets/widgets/toolbar/toolbar.py +1 -0
  44. bec_widgets-0.53.0.dist-info/METADATA +33 -0
  45. bec_widgets-0.53.0.dist-info/RECORD +156 -0
  46. {bec_widgets-0.52.0.dist-info → bec_widgets-0.53.0.dist-info}/WHEEL +1 -2
  47. bec_widgets-0.53.0.dist-info/licenses/LICENSE +29 -0
  48. docs/Makefile +20 -0
  49. docs/_templates/custom-class-template.rst +34 -0
  50. docs/_templates/custom-module-template.rst +66 -0
  51. docs/conf.py +81 -0
  52. docs/developer/developer.md +26 -0
  53. docs/developer/reference.md +10 -0
  54. docs/index.md +39 -0
  55. docs/introduction/introduction.md +18 -0
  56. docs/make.bat +35 -0
  57. docs/requirements.txt +10 -0
  58. docs/user/apps/modular_app.md +6 -0
  59. docs/user/apps/motor_app.md +34 -0
  60. docs/user/apps/motor_app_10fps.gif +0 -0
  61. docs/user/apps/plot_app.md +6 -0
  62. docs/user/apps.md +39 -0
  63. docs/user/customisation.md +13 -0
  64. docs/user/installation.md +46 -0
  65. docs/user/user.md +38 -0
  66. docs/user/widgets/motor.gif +0 -0
  67. docs/user/widgets/scatter_2D.gif +0 -0
  68. docs/user/widgets/w1D.gif +0 -0
  69. docs/user/widgets.md +41 -0
  70. pyproject.toml +94 -0
  71. tests/unit_tests/test_bec_dispatcher.py +3 -26
  72. tests/unit_tests/test_bec_figure.py +1 -5
  73. tests/unit_tests/test_bec_motor_map.py +1 -4
  74. tests/unit_tests/test_config_dialog.py +1 -5
  75. tests/unit_tests/test_configs/config_device.yaml +33 -0
  76. tests/unit_tests/test_configs/config_device_no_entry.yaml +27 -0
  77. tests/unit_tests/test_configs/config_scan.yaml +82 -0
  78. tests/unit_tests/test_motor_control.py +1 -1
  79. tests/unit_tests/test_motor_map.py +5 -20
  80. tests/unit_tests/test_stream_plot.py +2 -12
  81. bec_widgets/utils/ctrl_c.py +0 -39
  82. bec_widgets-0.52.0.dist-info/RECORD +0 -115
  83. bec_widgets-0.52.0.dist-info/top_level.txt +0 -2
  84. /bec_widgets-0.52.0.dist-info/LICENSE → /LICENSE +0 -0
  85. /bec_widgets/{simulations/__init__.py → examples/modular_app/___init__.py} +0 -0
.git_hooks/pre-commit ADDED
@@ -0,0 +1,3 @@
1
+ black --line-length=100 $(git diff --cached --name-only --diff-filter=ACM -- '*.py')
2
+ isort --line-length=100 --profile=black --multi-line=3 --trailing-comma $(git diff --cached --name-only --diff-filter=ACM -- '*.py')
3
+ git add $(git diff --cached --name-only --diff-filter=ACM -- '*.py')
.gitignore ADDED
@@ -0,0 +1,177 @@
1
+ **/*_venv
2
+ **/.idea
3
+ *.log
4
+ **/__pycache__
5
+ **/.DS_Store
6
+ **/out
7
+ **/.vscode
8
+ **/.pytest_cache
9
+ **/*.egg*
10
+
11
+ # file writer data
12
+ **.h5
13
+
14
+ # Byte-compiled / optimized / DLL files
15
+ __pycache__/
16
+ *.py[cod]
17
+ *$py.class
18
+
19
+ # C extensions
20
+ *.so
21
+
22
+ # Distribution / packaging
23
+ .Python
24
+ build/
25
+ develop-eggs/
26
+ dist/
27
+ downloads/
28
+ eggs/
29
+ .eggs/
30
+ lib/
31
+ lib64/
32
+ parts/
33
+ sdist/
34
+ var/
35
+ wheels/
36
+ share/python-wheels/
37
+ *.egg-info/
38
+ .installed.cfg
39
+ *.egg
40
+ MANIFEST
41
+
42
+ # PyInstaller
43
+ # Usually these files are written by a python script from a template
44
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
45
+ *.manifest
46
+ *.spec
47
+
48
+ # Installer logs
49
+ pip-log.txt
50
+ pip-delete-this-directory.txt
51
+
52
+ # Unit test / coverage reports
53
+ htmlcov/
54
+ .tox/
55
+ .nox/
56
+ .coverage
57
+ .coverage.*
58
+ .cache
59
+ nosetests.xml
60
+ coverage.xml
61
+ *.cover
62
+ *.py,cover
63
+ .hypothesis/
64
+ .pytest_cache/
65
+ cover/
66
+
67
+ # Translations
68
+ *.mo
69
+ *.pot
70
+
71
+ # Django stuff:
72
+ *.log
73
+ local_settings.py
74
+ db.sqlite3
75
+ db.sqlite3-journal
76
+
77
+ # Flask stuff:
78
+ instance/
79
+ .webassets-cache
80
+
81
+ # Scrapy stuff:
82
+ .scrapy
83
+
84
+ # Sphinx documentation
85
+ docs/**/_build/
86
+ docs/**/autodoc/
87
+ docs/**/_autosummary/
88
+
89
+ # PyBuilder
90
+ .pybuilder/
91
+ target/
92
+
93
+ # Jupyter Notebook
94
+ .ipynb_checkpoints
95
+
96
+ # IPython
97
+ profile_default/
98
+ ipython_config.py
99
+
100
+ **.prof
101
+
102
+ # pyenv
103
+ # For a library or package, you might want to ignore these files since the code is
104
+ # intended to run in multiple environments; otherwise, check them in:
105
+ # .python-version
106
+
107
+ # pipenv
108
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
109
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
110
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
111
+ # install all needed dependencies.
112
+ #Pipfile.lock
113
+
114
+ # poetry
115
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
116
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
117
+ # commonly ignored for libraries.
118
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
119
+ #poetry.lock
120
+
121
+ # pdm
122
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
123
+ #pdm.lock
124
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
125
+ # in version control.
126
+ # https://pdm.fming.dev/#use-with-ide
127
+ .pdm.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule
134
+ celerybeat.pid
135
+
136
+ # SageMath parsed files
137
+ *.sage.py
138
+
139
+ # Environments
140
+ .env
141
+ .venv
142
+ env/
143
+ venv/
144
+ ENV/
145
+ env.bak/
146
+ venv.bak/
147
+
148
+ # Spyder project settings
149
+ .spyderproject
150
+ .spyproject
151
+
152
+ # Rope project settings
153
+ .ropeproject
154
+
155
+ # mkdocs documentation
156
+ /site
157
+
158
+ # mypy
159
+ .mypy_cache/
160
+ .dmypy.json
161
+ dmypy.json
162
+
163
+ # Pyre type checker
164
+ .pyre/
165
+
166
+ # pytype static type analyzer
167
+ .pytype/
168
+
169
+ # Cython debug symbols
170
+ cython_debug/
171
+
172
+ # PyCharm
173
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
174
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
176
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
177
+ #.idea/
@@ -0,0 +1,17 @@
1
+ ## Bug report
2
+
3
+ ## Summary
4
+
5
+ [Provide a brief description of the bug.]
6
+
7
+ ## Expected Behavior vs Actual Behavior
8
+
9
+ [Describe what you expected to happen and what actually happened.]
10
+
11
+ ## Steps to Reproduce
12
+
13
+ [Outline the steps that lead to the bug's occurrence. Be specific and provide a clear sequence of actions.]
14
+
15
+ ## Related Issues
16
+
17
+ [Paste links to any related issues or feature requests.]
@@ -0,0 +1,27 @@
1
+ ## Documentation Section
2
+
3
+ [Specify the section or page of the documentation that needs updating]
4
+
5
+ ## Current Information
6
+
7
+ [Provide the current information in the documentation that needs to be updated]
8
+
9
+ ## Proposed Update
10
+
11
+ [Describe the proposed update or correction. Be specific about the changes that need to be made]
12
+
13
+ ## Reason for Update
14
+
15
+ [Explain the reason for the documentation update. Include any recent changes, new features, or corrections that necessitate the update]
16
+
17
+ ## Additional Context
18
+
19
+ [Include any additional context or information that can help the documentation team understand the update better]
20
+
21
+ ## Attachments
22
+
23
+ [Attach any files, screenshots, or references that can assist in making the documentation update]
24
+
25
+ ## Priority
26
+
27
+ [Assign a priority level to the documentation update based on its urgency. Use a scale such as Low, Medium, High]
@@ -0,0 +1,40 @@
1
+ ## Feature Summary
2
+
3
+ [Provide a brief and clear summary of the new feature you are requesting]
4
+
5
+ ## Problem Description
6
+
7
+ [Explain the problem or need that this feature aims to address. Be specific about the issues or gaps in the current functionality]
8
+
9
+ ## Use Case
10
+
11
+ [Describe a real-world scenario or use case where this feature would be beneficial. Explain how it would improve the user experience or workflow]
12
+
13
+ ## Proposed Solution
14
+
15
+ [If you have a specific solution in mind, describe it here. Explain how it would work and how it would address the problem described above]
16
+
17
+ ## Benefits
18
+
19
+ [Explain the benefits and advantages of implementing this feature. Highlight how it adds value to the product or improves user satisfaction]
20
+
21
+ ## Alternatives Considered
22
+
23
+ [If you've considered alternative solutions or workarounds, mention them here. Explain why the proposed feature is the preferred option]
24
+
25
+ ## Impact on Existing Functionality
26
+
27
+ [Discuss how the new feature might impact or interact with existing features. Address any potential conflicts or dependencies]
28
+
29
+ ## Priority
30
+
31
+ [Assign a priority level to the feature request based on its importance. Use a scale such as Low, Medium, High]
32
+
33
+ ## Attachments
34
+
35
+ [Include any relevant attachments, such as sketches, diagrams, or references that can help the development team understand your feature request better]
36
+
37
+ ## Additional Information
38
+
39
+ [Provide any additional information that might be relevant to the feature request, such as user feedback, market trends, or similar features in other products]
40
+
@@ -0,0 +1,28 @@
1
+ ## Description
2
+
3
+ [Provide a brief description of the changes introduced by this merge request.]
4
+
5
+ ## Related Issues
6
+
7
+ [Cite any related issues or feature requests that are addressed or resolved by this merge request. Use the gitlab syntax for linking issues, for example, `fixes #123` or `closes #123`.]
8
+
9
+ ## Type of Change
10
+
11
+ - Change 1
12
+ - Change 2
13
+
14
+ ## Potential side effects
15
+
16
+ [Describe any potential side effects or risks of merging this MR.]
17
+
18
+ ## Screenshots / GIFs (if applicable)
19
+
20
+ [Include any relevant screenshots or GIFs to showcase the changes made.]
21
+
22
+ ## Additional Comments
23
+
24
+ [Add any additional comments or information that may be helpful for reviewers.]
25
+
26
+ ## Definition of Done
27
+ - [ ] Documentation is up-to-date.
28
+
.gitlab-ci.yml ADDED
@@ -0,0 +1,225 @@
1
+ # This file is a template, and might need editing before it works on your project.
2
+ # Official language image. Look for the different tagged releases at:
3
+ # https://hub.docker.com/r/library/python/tags/
4
+ image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10
5
+ #commands to run in the Docker container before starting each job.
6
+ variables:
7
+ DOCKER_TLS_CERTDIR: ""
8
+ BEC_CORE_BRANCH: "main"
9
+ OPHYD_DEVICES_BRANCH: "main"
10
+ CHILD_PIPELINE_BRANCH: "main"
11
+
12
+ workflow:
13
+ rules:
14
+ - if: $CI_PIPELINE_SOURCE == "schedule"
15
+ - if: $CI_PIPELINE_SOURCE == "web"
16
+ - if: $CI_PIPELINE_SOURCE == "pipeline"
17
+ - if: $CI_PIPELINE_SOURCE == "parent_pipeline"
18
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
19
+ - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
20
+ when: never
21
+ - if: $CI_COMMIT_BRANCH
22
+
23
+ include:
24
+ - template: Security/Secret-Detection.gitlab-ci.yml
25
+
26
+
27
+ # different stages in the pipeline
28
+ stages:
29
+ - Formatter
30
+ - test
31
+ - AdditionalTests
32
+ - End2End
33
+ - Deploy
34
+
35
+ before_script:
36
+ - if [[ "$CI_PROJECT_PATH" != "bec/bec_widgets" ]]; then
37
+ test -d bec_widgets || git clone --branch $CHILD_PIPELINE_BRANCH https://gitlab.psi.ch/bec/bec_widgets.git; cd bec_widgets;
38
+ fi
39
+
40
+ formatter:
41
+ stage: Formatter
42
+ needs: []
43
+ script:
44
+ - pip install black isort
45
+ - isort --check --diff ./
46
+ - black --check --diff --color ./
47
+ rules:
48
+ - if: $CI_PROJECT_PATH == "bec/bec_widgets"
49
+
50
+ pylint:
51
+ stage: Formatter
52
+ needs: []
53
+ before_script:
54
+ - pip install pylint pylint-exit anybadge
55
+ - pip install -e .[dev,pyqt6]
56
+ script:
57
+ - mkdir ./pylint
58
+ - pylint ./bec_widgets --output-format=text --output=./pylint/pylint.log | tee ./pylint/pylint.log || pylint-exit $?
59
+ - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
60
+ - anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
61
+ - echo "Pylint score is $PYLINT_SCORE"
62
+ artifacts:
63
+ paths:
64
+ - ./pylint/
65
+ expire_in: 1 week
66
+ rules:
67
+ - if: $CI_PROJECT_PATH == "bec/bec_widgets"
68
+
69
+ pylint-check:
70
+ stage: Formatter
71
+ needs: []
72
+ allow_failure: true
73
+ before_script:
74
+ - pip install pylint pylint-exit anybadge
75
+ - apt-get update
76
+ - apt-get install -y bc
77
+ script:
78
+ # Identify changed Python files
79
+ - if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ]; then
80
+ TARGET_BRANCH_COMMIT_SHA=$(git rev-parse $CI_MERGE_REQUEST_TARGET_BRANCH_NAME);
81
+ CHANGED_FILES=$(git diff --name-only $SOURCE_BRANCH_COMMIT_SHA $TARGET_BRANCH_COMMIT_SHA | grep '\.py$' || true);
82
+ else
83
+ CHANGED_FILES=$(git diff --name-only $CI_COMMIT_BEFORE_SHA $CI_COMMIT_SHA | grep '\.py$' || true);
84
+ fi
85
+ - if [ -z "$CHANGED_FILES" ]; then echo "No Python files changed."; exit 0; fi
86
+
87
+ # Run pylint only on changed files
88
+ - mkdir ./pylint
89
+ - pylint $CHANGED_FILES --output-format=text . | tee ./pylint/pylint_changed_files.log || pylint-exit $?
90
+ - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint_changed_files.log)
91
+ - echo "Pylint score is $PYLINT_SCORE"
92
+
93
+ # Fail the job if the pylint score is below 9
94
+ - if [ "$(echo "$PYLINT_SCORE < 9" | bc)" -eq 1 ]; then echo "Your pylint score is below the acceptable threshold (9)."; exit 1; fi
95
+ artifacts:
96
+ paths:
97
+ - ./pylint/
98
+ expire_in: 1 week
99
+ rules:
100
+ - if: $CI_PROJECT_PATH == "bec/bec_widgets"
101
+
102
+ tests:
103
+ stage: test
104
+ needs: []
105
+ variables:
106
+ QT_QPA_PLATFORM: "offscreen"
107
+ script:
108
+ - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
109
+ - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
110
+ - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
111
+ - apt-get update
112
+ - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
113
+ - pip install -e ./bec/bec_lib[dev]
114
+ - pip install -e .[dev,pyqt6]
115
+ - coverage run --source=./bec_widgets -m pytest -v --junitxml=report.xml --random-order --full-trace ./tests/unit_tests
116
+ - coverage report
117
+ - coverage xml
118
+ coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
119
+ artifacts:
120
+ reports:
121
+ junit: report.xml
122
+ coverage_report:
123
+ coverage_format: cobertura
124
+ path: coverage.xml
125
+
126
+
127
+ tests-3.11:
128
+ extends: "tests"
129
+ stage: AdditionalTests
130
+ image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
131
+ allow_failure: true
132
+
133
+ tests-3.12:
134
+ extends: "tests"
135
+ stage: AdditionalTests
136
+ image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12
137
+ allow_failure: true
138
+
139
+ end-2-end-conda:
140
+ stage: End2End
141
+ needs: []
142
+ image: continuumio/miniconda3
143
+ allow_failure: false
144
+ variables:
145
+ QT_QPA_PLATFORM: "offscreen"
146
+ script:
147
+ - apt-get update
148
+ - apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
149
+ - conda config --prepend channels conda-forge
150
+ - conda config --set channel_priority strict
151
+ - conda config --set always_yes yes --set changeps1 no
152
+ - conda create -q -n test-environment python=3.10
153
+ - conda init bash
154
+ - source ~/.bashrc
155
+ - conda activate test-environment
156
+
157
+ - git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
158
+ - git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
159
+ - export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
160
+
161
+ - cd ./bec
162
+ - source ./bin/install_bec_dev.sh -t
163
+
164
+ - pip install -e ./bec_lib[dev]
165
+ - pip install -e ./bec_ipython_client[dev]
166
+ - cd ../
167
+ - pip install -e .[dev,pyqt6]
168
+ - cd ./tests/end-2-end
169
+ - pytest --start-servers --flush-redis --random-order
170
+
171
+ artifacts:
172
+ when: on_failure
173
+ paths:
174
+ - ./logs/*.log
175
+ expire_in: 1 week
176
+
177
+ rules:
178
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
179
+ - if: '$CI_PIPELINE_SOURCE == "web"'
180
+ - if: '$CI_PIPELINE_SOURCE == "pipeline"'
181
+ - if: '$CI_PIPELINE_SOURCE == "parent_pipeline"'
182
+ - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
183
+ - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"'
184
+
185
+
186
+ semver:
187
+ stage: Deploy
188
+ needs: ["tests"]
189
+ script:
190
+ - git config --global user.name "ci_update_bot"
191
+ - git config --global user.email "ci_update_bot@bec.ch"
192
+ - git checkout "$CI_COMMIT_REF_NAME"
193
+ - git reset --hard origin/"$CI_COMMIT_REF_NAME"
194
+
195
+ # delete all local tags
196
+ - git tag -l | xargs git tag -d
197
+ - git fetch --tags
198
+ - git tag
199
+
200
+ # build and publish package
201
+ - pip install python-semantic-release==9.* wheel build twine
202
+ - export GL_TOKEN=$CI_UPDATES
203
+ - semantic-release -vv version
204
+
205
+ # check if any artifacts were created
206
+ - if [ ! -d dist ]; then echo No release will be made; exit 0; fi
207
+ - twine upload dist/* -u __token__ -p $CI_PYPI_TOKEN --skip-existing
208
+ - semantic-release publish
209
+
210
+ allow_failure: false
211
+ rules:
212
+ - if: '$CI_COMMIT_REF_NAME == "main" && $CI_PROJECT_PATH == "bec/bec_widgets"'
213
+
214
+ pages:
215
+ stage: Deploy
216
+ needs: ["semver"]
217
+ variables:
218
+ TARGET_BRANCH: $CI_COMMIT_REF_NAME
219
+ rules:
220
+ - if: '$CI_COMMIT_TAG != null'
221
+ variables:
222
+ TARGET_BRANCH: $CI_COMMIT_TAG
223
+ - if: '$CI_COMMIT_REF_NAME == "main" && $CI_PROJECT_PATH == "bec/bec_widgets"'
224
+ script:
225
+ - curl -X POST -d "branches=$CI_COMMIT_REF_NAME" -d "token=$RTD_TOKEN" https://readthedocs.org/api/v2/webhook/bec_widgets/253243/