genie-python 15.1.0rc1__tar.gz

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 (89) hide show
  1. genie_python-15.1.0rc1/.git-blame-ignore-revs +6 -0
  2. genie_python-15.1.0rc1/.gitattributes +33 -0
  3. genie_python-15.1.0rc1/.github/workflows/documentation.yml +8 -0
  4. genie_python-15.1.0rc1/.github/workflows/lint_and_test.yml +45 -0
  5. genie_python-15.1.0rc1/.github/workflows/release.yml +92 -0
  6. genie_python-15.1.0rc1/.gitignore +164 -0
  7. genie_python-15.1.0rc1/Jenkinsfile +121 -0
  8. genie_python-15.1.0rc1/Jenkinsfile_linux +97 -0
  9. genie_python-15.1.0rc1/LICENSE +28 -0
  10. genie_python-15.1.0rc1/PKG-INFO +95 -0
  11. genie_python-15.1.0rc1/PULL_REQUEST_TEMPLATE.md +25 -0
  12. genie_python-15.1.0rc1/README.md +21 -0
  13. genie_python-15.1.0rc1/doc/Makefile +177 -0
  14. genie_python-15.1.0rc1/doc/conf.py +260 -0
  15. genie_python-15.1.0rc1/doc/genie_python.rst +21 -0
  16. genie_python-15.1.0rc1/doc/make.bat +242 -0
  17. genie_python-15.1.0rc1/doc/make_doc.sh +8 -0
  18. genie_python-15.1.0rc1/mantid_requirements.txt +12 -0
  19. genie_python-15.1.0rc1/parse_rules +8 -0
  20. genie_python-15.1.0rc1/pyproject.toml +126 -0
  21. genie_python-15.1.0rc1/ruff.toml +42 -0
  22. genie_python-15.1.0rc1/setup.cfg +4 -0
  23. genie_python-15.1.0rc1/src/genie_python/.pylintrc +539 -0
  24. genie_python-15.1.0rc1/src/genie_python/__init__.py +1 -0
  25. genie_python-15.1.0rc1/src/genie_python/block_names.py +123 -0
  26. genie_python-15.1.0rc1/src/genie_python/channel_access_exceptions.py +45 -0
  27. genie_python-15.1.0rc1/src/genie_python/genie.py +2462 -0
  28. genie_python-15.1.0rc1/src/genie_python/genie_advanced.py +418 -0
  29. genie_python-15.1.0rc1/src/genie_python/genie_alerts.py +195 -0
  30. genie_python-15.1.0rc1/src/genie_python/genie_api_setup.py +451 -0
  31. genie_python-15.1.0rc1/src/genie_python/genie_blockserver.py +64 -0
  32. genie_python-15.1.0rc1/src/genie_python/genie_cachannel_wrapper.py +545 -0
  33. genie_python-15.1.0rc1/src/genie_python/genie_change_cache.py +151 -0
  34. genie_python-15.1.0rc1/src/genie_python/genie_dae.py +2218 -0
  35. genie_python-15.1.0rc1/src/genie_python/genie_epics_api.py +906 -0
  36. genie_python-15.1.0rc1/src/genie_python/genie_experimental_data.py +186 -0
  37. genie_python-15.1.0rc1/src/genie_python/genie_logging.py +200 -0
  38. genie_python-15.1.0rc1/src/genie_python/genie_p4p_wrapper.py +203 -0
  39. genie_python-15.1.0rc1/src/genie_python/genie_plot.py +77 -0
  40. genie_python-15.1.0rc1/src/genie_python/genie_pre_post_cmd_manager.py +21 -0
  41. genie_python-15.1.0rc1/src/genie_python/genie_pv_connection_protocol.py +36 -0
  42. genie_python-15.1.0rc1/src/genie_python/genie_script_checker.py +507 -0
  43. genie_python-15.1.0rc1/src/genie_python/genie_script_generator.py +212 -0
  44. genie_python-15.1.0rc1/src/genie_python/genie_simulate.py +69 -0
  45. genie_python-15.1.0rc1/src/genie_python/genie_simulate_impl.py +1265 -0
  46. genie_python-15.1.0rc1/src/genie_python/genie_startup.py +29 -0
  47. genie_python-15.1.0rc1/src/genie_python/genie_toggle_settings.py +58 -0
  48. genie_python-15.1.0rc1/src/genie_python/genie_wait_for_move.py +154 -0
  49. genie_python-15.1.0rc1/src/genie_python/genie_waitfor.py +576 -0
  50. genie_python-15.1.0rc1/src/genie_python/matplotlib_backend/__init__.py +0 -0
  51. genie_python-15.1.0rc1/src/genie_python/matplotlib_backend/ibex_websocket_backend.py +366 -0
  52. genie_python-15.1.0rc1/src/genie_python/mysql_abstraction_layer.py +272 -0
  53. genie_python-15.1.0rc1/src/genie_python/run_tests.py +56 -0
  54. genie_python-15.1.0rc1/src/genie_python/scanning_instrument_pylint_plugin.py +31 -0
  55. genie_python-15.1.0rc1/src/genie_python/typings/CaChannel/CaChannel.pyi +893 -0
  56. genie_python-15.1.0rc1/src/genie_python/typings/CaChannel/__init__.pyi +9 -0
  57. genie_python-15.1.0rc1/src/genie_python/typings/CaChannel/_version.pyi +6 -0
  58. genie_python-15.1.0rc1/src/genie_python/typings/CaChannel/ca.pyi +31 -0
  59. genie_python-15.1.0rc1/src/genie_python/utilities.py +406 -0
  60. genie_python-15.1.0rc1/src/genie_python/version.py +1 -0
  61. genie_python-15.1.0rc1/src/genie_python.egg-info/PKG-INFO +95 -0
  62. genie_python-15.1.0rc1/src/genie_python.egg-info/SOURCES.txt +87 -0
  63. genie_python-15.1.0rc1/src/genie_python.egg-info/dependency_links.txt +1 -0
  64. genie_python-15.1.0rc1/src/genie_python.egg-info/requires.txt +33 -0
  65. genie_python-15.1.0rc1/src/genie_python.egg-info/top_level.txt +1 -0
  66. genie_python-15.1.0rc1/tests/__init__.py +15 -0
  67. genie_python-15.1.0rc1/tests/py3_test_genie_experimental_data.py +397 -0
  68. genie_python-15.1.0rc1/tests/test_block_names.py +245 -0
  69. genie_python-15.1.0rc1/tests/test_genie.py +648 -0
  70. genie_python-15.1.0rc1/tests/test_genie_alerts.py +75 -0
  71. genie_python-15.1.0rc1/tests/test_genie_api_setup.py +404 -0
  72. genie_python-15.1.0rc1/tests/test_genie_blockserver_tests.py +54 -0
  73. genie_python-15.1.0rc1/tests/test_genie_change_cache.py +49 -0
  74. genie_python-15.1.0rc1/tests/test_genie_dae.py +818 -0
  75. genie_python-15.1.0rc1/tests/test_genie_epics_api.py +851 -0
  76. genie_python-15.1.0rc1/tests/test_genie_wait_for_move.py +80 -0
  77. genie_python-15.1.0rc1/tests/test_genie_waitfor.py +84 -0
  78. genie_python-15.1.0rc1/tests/test_matplotlib_backend.py +30 -0
  79. genie_python-15.1.0rc1/tests/test_mysql_abstraction_layer.py +150 -0
  80. genie_python-15.1.0rc1/tests/test_script_checker.py +636 -0
  81. genie_python-15.1.0rc1/tests/test_script_generator.py +312 -0
  82. genie_python-15.1.0rc1/tests/test_scripts/error.py +5 -0
  83. genie_python-15.1.0rc1/tests/test_scripts/error_for_script_checker.py +8 -0
  84. genie_python-15.1.0rc1/tests/test_scripts/valid.py +12 -0
  85. genie_python-15.1.0rc1/tests/test_scripts/valid_python_2.py +4 -0
  86. genie_python-15.1.0rc1/tests/test_scripts/valid_to_import.py +8 -0
  87. genie_python-15.1.0rc1/tests/test_simulation.py +290 -0
  88. genie_python-15.1.0rc1/tests/test_utilities.py +352 -0
  89. genie_python-15.1.0rc1/tests/test_utils_with_unicode_literals.py +69 -0
@@ -0,0 +1,6 @@
1
+ 75bb795dad342ba7ecdca101653326459597922a
2
+ 64f120eddbf62214f7bb34d1492b856aa7df0c3b
3
+ 7b4ca34f7e26bce2d2c33953a82142214e590e51
4
+ 2082444b40dbc11f764e033998527791ce1d0e85
5
+ 26b8eb3ff334eab700ae75ac4393796d5a5df95d
6
+ d771c7ff205a3e4f23dd55418cfebce95de1e935
@@ -0,0 +1,33 @@
1
+ # Set the default behavior, in case people don't have core.autocrlf set.
2
+ * text=auto
3
+
4
+ # Explicitly declare text files you want to always be normalized and converted
5
+ # to native line endings on checkout.
6
+ *.c text
7
+ *.cpp text
8
+ *.h text
9
+ *.hpp text
10
+ *.java text
11
+ *.cmd text
12
+ *.db text
13
+ *.dbd text
14
+ *.template text
15
+ *.substitutions text
16
+ *.acf text
17
+ *.py text
18
+ *.md text
19
+ *.rst text
20
+
21
+ # Declare files that will always have LF line endings on checkout.
22
+ *.sh text eol=lf
23
+
24
+ # Declare files that will always have CRLF line endings on checkout.
25
+ *.sln text eol=crlf
26
+ *.bat text eol=crlf
27
+
28
+ # Denote all files that are truly binary and should not be modified.
29
+ *.png binary
30
+ *.jpg binary
31
+ *.class binary
32
+ *.vi binary
33
+ *.ico binary
@@ -0,0 +1,8 @@
1
+ name: sphinx
2
+
3
+ on: [push, pull_request, workflow_call]
4
+
5
+ jobs:
6
+ call_sphinx_builder:
7
+ uses: ISISComputingGroup/reusable-workflows/.github/workflows/sphinx.yml@main
8
+ secrets: inherit
@@ -0,0 +1,45 @@
1
+ env:
2
+ PYTHONUNBUFFERED: "TRUE"
3
+ name: test
4
+ on: [pull_request, workflow_call]
5
+ jobs:
6
+ lint:
7
+ uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
8
+ with:
9
+ compare-branch: origin/main
10
+ python-ver: '3.11'
11
+ unit-tests:
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ matrix:
15
+ os: ["ubuntu-latest", "windows-latest"]
16
+ version: ['3.11']
17
+ fail-fast: false
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.version }}
23
+ - name: Install base requirements
24
+ run: pip install -e .
25
+ - name: Verify package is importable
26
+ run: |
27
+ python -c "from genie_python.genie_startup import *"
28
+ python -c "from genie_python import genie as g"
29
+ - name: Install dev requirements
30
+ run: pip install -e .[dev]
31
+ - name: Run unit tests
32
+ run: python -m pytest
33
+ results:
34
+ if: ${{ always() }}
35
+ runs-on: ubuntu-latest
36
+ name: Final Results
37
+ needs: [lint, unit-tests]
38
+ steps:
39
+ - run: exit 1
40
+ # see https://stackoverflow.com/a/67532120/4907315
41
+ if: >-
42
+ ${{
43
+ contains(needs.*.result, 'failure')
44
+ || contains(needs.*.result, 'cancelled')
45
+ }}
@@ -0,0 +1,92 @@
1
+ name: Publish Python distribution to PyPI
2
+ on: push
3
+ jobs:
4
+ lint-and-test:
5
+ if: github.ref_type == 'tag'
6
+ name: Run lint & tests
7
+ uses: ./.github/workflows/lint_and_test.yml
8
+ build:
9
+ needs: lint-and-test
10
+ if: github.ref_type == 'tag'
11
+ name: build distribution
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.11"
20
+ - name: Install pypa/build
21
+ run: >-
22
+ python3 -m
23
+ pip install
24
+ build
25
+ --user
26
+ - name: Build a binary wheel and a source tarball
27
+ run: python3 -m build
28
+ - name: Store the distribution packages
29
+ uses: actions/upload-artifact@v4
30
+ with:
31
+ name: python-package-distributions
32
+ path: dist/
33
+ publish-to-pypi:
34
+ name: >-
35
+ Publish Python distribution to PyPI
36
+ if: github.ref_type == 'tag'
37
+ needs: [lint-and-test, build]
38
+ runs-on: ubuntu-latest
39
+ environment:
40
+ name: release
41
+ url: https://pypi.org/p/genie_python
42
+ permissions:
43
+ id-token: write # IMPORTANT: mandatory for trusted publishing
44
+ steps:
45
+ - name: Download all the dists
46
+ uses: actions/download-artifact@v4
47
+ with:
48
+ name: python-package-distributions
49
+ path: dist/
50
+ - name: Publish distribution to PyPI
51
+ uses: pypa/gh-action-pypi-publish@release/v1
52
+ github-release:
53
+ name: >-
54
+ Sign the Python distribution with Sigstore
55
+ and upload them to GitHub Release
56
+ needs: [lint-and-test, build, publish-to-pypi]
57
+ runs-on: ubuntu-latest
58
+
59
+ permissions:
60
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
61
+ id-token: write # IMPORTANT: mandatory for sigstore
62
+
63
+ steps:
64
+ - name: Download all the dists
65
+ uses: actions/download-artifact@v4
66
+ with:
67
+ name: python-package-distributions
68
+ path: dist/
69
+ - name: Sign the dists with Sigstore
70
+ uses: sigstore/gh-action-sigstore-python@v2.1.1
71
+ with:
72
+ inputs: >-
73
+ ./dist/*.tar.gz
74
+ ./dist/*.whl
75
+ - name: Create GitHub Release
76
+ env:
77
+ GITHUB_TOKEN: ${{ github.token }}
78
+ run: >-
79
+ gh release create
80
+ '${{ github.ref_name }}'
81
+ --repo '${{ github.repository }}'
82
+ --notes ""
83
+ - name: Upload artifact signatures to GitHub Release
84
+ env:
85
+ GITHUB_TOKEN: ${{ github.token }}
86
+ # Upload to GitHub Release using the `gh` CLI.
87
+ # `dist/` contains the built packages, and the
88
+ # sigstore-produced signatures and certificates.
89
+ run: >-
90
+ gh release upload
91
+ '${{ github.ref_name }}' dist/**
92
+ --repo '${{ github.repository }}'
@@ -0,0 +1,164 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110
+ .pdm.toml
111
+ .pdm-python
112
+ .pdm-build/
113
+
114
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115
+ __pypackages__/
116
+
117
+ # Celery stuff
118
+ celerybeat-schedule
119
+ celerybeat.pid
120
+
121
+ # SageMath parsed files
122
+ *.sage.py
123
+
124
+ # Environments
125
+ .env
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+
133
+ # Spyder project settings
134
+ .spyderproject
135
+ .spyproject
136
+
137
+ # Rope project settings
138
+ .ropeproject
139
+
140
+ # mkdocs documentation
141
+ /site
142
+
143
+ # mypy
144
+ .mypy_cache/
145
+ .dmypy.json
146
+ dmypy.json
147
+
148
+ # Pyre type checker
149
+ .pyre/
150
+
151
+ # pytype static type analyzer
152
+ .pytype/
153
+
154
+ # Cython debug symbols
155
+ cython_debug/
156
+
157
+ # PyCharm
158
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
161
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
162
+ .idea/
163
+
164
+ _build/
@@ -0,0 +1,121 @@
1
+ #!groovy
2
+
3
+ pipeline {
4
+
5
+ // agent defines where the pipeline will run.
6
+ agent {
7
+ label {
8
+ label "genie"
9
+ }
10
+ }
11
+
12
+ environment {
13
+ NODE = "${env.NODE_NAME}"
14
+ PLOCK = "python_${NODE}"
15
+ }
16
+
17
+ triggers {
18
+ pollSCM('H/2 * * * *')
19
+ }
20
+
21
+ // The options directive is for configuration that applies to the whole job.
22
+ options {
23
+ buildDiscarder(logRotator(numToKeepStr:'5', daysToKeepStr: '7'))
24
+ disableConcurrentBuilds()
25
+ timestamps()
26
+ office365ConnectorWebhooks([[
27
+ name: "Office 365",
28
+ notifyBackToNormal: true,
29
+ startNotification: false,
30
+ notifyFailure: true,
31
+ notifySuccess: false,
32
+ notifyNotBuilt: false,
33
+ notifyAborted: false,
34
+ notifyRepeatedFailure: true,
35
+ notifyUnstable: true,
36
+ url: "${env.MSTEAMS_URL}"
37
+ ]]
38
+ )
39
+ }
40
+
41
+ stages {
42
+ stage("Checkout") {
43
+ steps {
44
+ timeout(time: 2, unit: 'HOURS') {
45
+ retry(5) {
46
+ echo "Branch: ${env.BRANCH_NAME}"
47
+ checkout scm
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ stage("Build for Python 3") {
54
+ steps {
55
+ echo "Build Number: ${env.BUILD_NUMBER}"
56
+ lock(resource: PLOCK, inversePrecedence: false) {
57
+ timeout(time: 120, unit: 'MINUTES') {
58
+ script {
59
+ env.GIT_COMMIT = bat(returnStdout: true, script: '@git rev-parse HEAD').trim()
60
+ env.GIT_BRANCH = bat(returnStdout: true, script: '@git rev-parse --abbrev-ref HEAD').trim()
61
+ echo "git commit: ${env.GIT_COMMIT}"
62
+ echo "git branch: ${env.BRANCH_NAME} ${env.GIT_BRANCH}"
63
+ // env.BRANCH_NAME is only supplied to multi-branch pipeline jobs
64
+ if (env.BRANCH_NAME == null) {
65
+ env.BRANCH_NAME = "master"
66
+ }
67
+
68
+ if (env.BRANCH_NAME != null && env.BRANCH_NAME.startsWith("Release")) {
69
+ env.IS_RELEASE = "YES"
70
+ env.RELEASE_VERSION = "${env.BRANCH_NAME}".replace('Release_', '')
71
+ echo "release version: ${env.RELEASE_VERSION}"
72
+ }
73
+ else {
74
+ env.IS_RELEASE = "NO"
75
+ env.RELEASE_VERSION = ""
76
+ }
77
+ }
78
+ bat """
79
+ git clean -fqdx
80
+ set BUILD_NUMBER=${env.BUILD_NUMBER}
81
+ set BRANCH_NAME=${env.BRANCH_NAME}
82
+ set GIT_COMMIT=${env.GIT_COMMIT}
83
+ set RELEASE_BRANCH=${env.RELEASE_VERSION}
84
+ set RELEASE=${env.IS_RELEASE}
85
+ cd package_builder
86
+ jenkins_build_python.bat 3
87
+ """
88
+ }
89
+ }
90
+ }
91
+ }
92
+ stage("Report Unit Tests python 3") {
93
+ steps {
94
+ junit '**/test-reports/TEST-*.xml'
95
+ }
96
+ }
97
+ stage("Trigger Downstream") {
98
+ steps {
99
+ build job: 'ibex_gui_pipeline', wait: false
100
+ }
101
+ }
102
+ }
103
+ post {
104
+ cleanup {
105
+ echo "***"
106
+ echo "*** Any Office365connector Matched status FAILURE message below means"
107
+ echo "*** an earlier Jenkins step failed not the Office365connector itself"
108
+ echo "*** Search log file for ERROR to locate true cause"
109
+ echo "***"
110
+ }
111
+ always {
112
+ logParser ([
113
+ projectRulePath: 'parse_rules',
114
+ parsingRulesPath: '',
115
+ showGraphs: true,
116
+ unstableOnWarning: false,
117
+ useProjectRule: true,
118
+ ])
119
+ }
120
+ }
121
+ }
@@ -0,0 +1,97 @@
1
+ #!groovy
2
+
3
+ pipeline {
4
+
5
+ // agent defines where the pipeline will run.
6
+ agent {
7
+ label {
8
+ label "sl7cloud"
9
+ }
10
+ }
11
+
12
+ triggers {
13
+ pollSCM('H/2 * * * *')
14
+ }
15
+
16
+ // The options directive is for configuration that applies to the whole job.
17
+ options {
18
+ buildDiscarder(logRotator(numToKeepStr:'5', daysToKeepStr: '7'))
19
+ timeout(time: 60, unit: 'MINUTES')
20
+ disableConcurrentBuilds()
21
+ timestamps()
22
+ office365ConnectorWebhooks([[
23
+ name: "Office 365",
24
+ notifyBackToNormal: true,
25
+ startNotification: false,
26
+ notifyFailure: true,
27
+ notifySuccess: false,
28
+ notifyNotBuilt: false,
29
+ notifyAborted: false,
30
+ notifyRepeatedFailure: true,
31
+ notifyUnstable: true,
32
+ url: "${env.MSTEAMS_URL}"
33
+ ]]
34
+ )
35
+ }
36
+
37
+ stages {
38
+ stage("Checkout") {
39
+ steps {
40
+ echo "Branch: ${env.BRANCH_NAME}"
41
+ checkout scm
42
+ }
43
+ }
44
+
45
+ stage("Build for Python 3") {
46
+ steps {
47
+ echo "Build Number: ${env.BUILD_NUMBER}"
48
+ script {
49
+ env.GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
50
+ env.GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
51
+ echo "git commit: ${env.GIT_COMMIT}"
52
+ echo "git branch: ${env.BRANCH_NAME} ${env.GIT_BRANCH}"
53
+ // env.BRANCH_NAME is only supplied to multi-branch pipeline jobs
54
+ if (env.BRANCH_NAME == null) {
55
+ env.BRANCH_NAME = "master"
56
+ }
57
+
58
+ if (env.BRANCH_NAME != null && env.BRANCH_NAME.startsWith("Release")) {
59
+ env.IS_RELEASE = "YES"
60
+ env.RELEASE_VERSION = "${env.BRANCH_NAME}".replace('Release_', '')
61
+ echo "release version: ${env.RELEASE_VERSION}"
62
+ }
63
+ else {
64
+ env.IS_RELEASE = "NO"
65
+ env.RELEASE_VERSION = ""
66
+ }
67
+ }
68
+
69
+ sh """
70
+ git clean -fqdx
71
+ export BUILD_NUMBER=${env.BUILD_NUMBER}
72
+ export BRANCH_NAME=${env.BRANCH_NAME}
73
+ export GIT_COMMIT=${env.GIT_COMMIT}
74
+ export RELEASE_BRANCH=${env.RELEASE_VERSION}
75
+ export RELEASE=${env.IS_RELEASE}
76
+ cd package_builder
77
+ sh jenkins_build_python.sh
78
+ """
79
+ }
80
+ }
81
+ stage("Report Unit Tests python 3") {
82
+ steps {
83
+ junit '**/test-reports/TEST-*.xml'
84
+ }
85
+ }
86
+ stage("Trigger Downstream") {
87
+ steps {
88
+ build job: 'ibex_gui_linux_pipeline', wait: false
89
+ }
90
+ }
91
+ }
92
+ post {
93
+ always {
94
+ archiveArtifacts artifacts: 'docs/_build/html/**/*', caseSensitive: false
95
+ }
96
+ }
97
+ }
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, ISIS Experiment Controls Computing
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,95 @@
1
+ Metadata-Version: 2.1
2
+ Name: genie_python
3
+ Version: 15.1.0rc1
4
+ Summary: Instrument control & scripting for the ISIS Neutron & Muon source
5
+ Author-email: ISIS Experiment Controls <ISISExperimentControls@stfc.ac.uk>
6
+ Maintainer-email: ISIS Experiment Controls <ISISExperimentControls@stfc.ac.uk>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2024, ISIS Experiment Controls Computing
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice, this
15
+ list of conditions and the following disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above copyright notice,
18
+ this list of conditions and the following disclaimer in the documentation
19
+ and/or other materials provided with the distribution.
20
+
21
+ 3. Neither the name of the copyright holder nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+
36
+ Project-URL: Homepage, https://github.com/isiscomputinggroup/genie
37
+ Project-URL: Bug Reports, https://github.com/isiscomputinggroup/genie/issues
38
+ Project-URL: Source, https://github.com/isiscomputinggroup/genie
39
+ Classifier: Development Status :: 5 - Production/Stable
40
+ Classifier: Intended Audience :: Developers
41
+ Classifier: License :: OSI Approved :: BSD License
42
+ Classifier: Programming Language :: Python :: 3.11
43
+ Requires-Python: >=3.11
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: CaChannel
47
+ Requires-Dist: caffi
48
+ Requires-Dist: graypy
49
+ Requires-Dist: ipython
50
+ Requires-Dist: mysql-connector-python
51
+ Requires-Dist: numpy
52
+ Requires-Dist: p4p
53
+ Requires-Dist: psutil
54
+ Requires-Dist: pylint
55
+ Requires-Dist: pyright
56
+ Requires-Dist: pywin32; platform_system == "Windows"
57
+ Provides-Extra: plot
58
+ Requires-Dist: matplotlib==3.9.2; extra == "plot"
59
+ Requires-Dist: py4j; extra == "plot"
60
+ Requires-Dist: tornado; extra == "plot"
61
+ Provides-Extra: doc
62
+ Requires-Dist: sphinx; extra == "doc"
63
+ Requires-Dist: sphinx_rtd_theme; extra == "doc"
64
+ Requires-Dist: myst_parser; extra == "doc"
65
+ Requires-Dist: sphinx-autobuild; extra == "doc"
66
+ Provides-Extra: dev
67
+ Requires-Dist: genie_python[doc,plot]; extra == "dev"
68
+ Requires-Dist: mock; extra == "dev"
69
+ Requires-Dist: parameterized; extra == "dev"
70
+ Requires-Dist: pyhamcrest; extra == "dev"
71
+ Requires-Dist: pytest; extra == "dev"
72
+ Requires-Dist: pytest-cov; extra == "dev"
73
+ Requires-Dist: ruff>=0.6; extra == "dev"
74
+
75
+ # genie_python
76
+
77
+ The ISIS Python-based instrument control and scripting library.
78
+
79
+ ## Instrument initialisation
80
+
81
+ By default when setting an instrument the init_default.py file is loaded.
82
+ This file checks for the existence of a folder called C:\Instrument\Settings\config\NDX%INSTNAME%\Python and adds this to the sys path if it does.
83
+ If this path exists and contains a file called init_%INSTNAME%.py, it will load it too.
84
+
85
+ On the NDX any files in C:\Instrument\Settings\config\NDX%INSTNAME%\Python can be added to SVN for safe keeping.
86
+
87
+ Python modules can be imported directly from the C:\Instrument\Settings\config\NDX%INSTNAME%\Python directory. If running on a client it is necessary to have a copy of the Python directory for the instrument being connected to in the correct location.
88
+
89
+ Folders inside the Python directory must have a `__init__.py` file for them to be available to be imported.
90
+
91
+ ## Start-up
92
+ The line "from genie_python import *" in genie_startup is responsible for loading all the genie_python stuff!
93
+ This file also contains code for disabling quickedit and for making genie_python guess the instrument name.
94
+
95
+ As genie_python is running inside IPython we use c.TerminalIPythonApp.exec_files to run genie_start.py, so everything is imported correctly.