diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3dd5a257..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,121 +0,0 @@ -#!groovy - -pipeline { - - // agent defines where the pipeline will run. - agent { - label { - label "genie" - } - } - - environment { - NODE = "${env.NODE_NAME}" - PLOCK = "python_${NODE}" - } - - triggers { - pollSCM('H/2 * * * *') - } - - // The options directive is for configuration that applies to the whole job. - options { - buildDiscarder(logRotator(numToKeepStr:'5', daysToKeepStr: '7')) - disableConcurrentBuilds() - timestamps() - office365ConnectorWebhooks([[ - name: "Office 365", - notifyBackToNormal: true, - startNotification: false, - notifyFailure: true, - notifySuccess: false, - notifyNotBuilt: false, - notifyAborted: false, - notifyRepeatedFailure: true, - notifyUnstable: true, - url: "${env.MSTEAMS_URL}" - ]] - ) - } - - stages { - stage("Checkout") { - steps { - timeout(time: 2, unit: 'HOURS') { - retry(5) { - echo "Branch: ${env.BRANCH_NAME}" - checkout scm - } - } - } - } - - stage("Build for Python 3") { - steps { - echo "Build Number: ${env.BUILD_NUMBER}" - lock(resource: PLOCK, inversePrecedence: false) { - timeout(time: 120, unit: 'MINUTES') { - script { - env.GIT_COMMIT = bat(returnStdout: true, script: '@git rev-parse HEAD').trim() - env.GIT_BRANCH = bat(returnStdout: true, script: '@git rev-parse --abbrev-ref HEAD').trim() - echo "git commit: ${env.GIT_COMMIT}" - echo "git branch: ${env.BRANCH_NAME} ${env.GIT_BRANCH}" - // env.BRANCH_NAME is only supplied to multi-branch pipeline jobs - if (env.BRANCH_NAME == null) { - env.BRANCH_NAME = "master" - } - - if (env.BRANCH_NAME != null && env.BRANCH_NAME.startsWith("Release")) { - env.IS_RELEASE = "YES" - env.RELEASE_VERSION = "${env.BRANCH_NAME}".replace('Release_', '') - echo "release version: ${env.RELEASE_VERSION}" - } - else { - env.IS_RELEASE = "NO" - env.RELEASE_VERSION = "" - } - } - bat """ - git clean -fqdx - set BUILD_NUMBER=${env.BUILD_NUMBER} - set BRANCH_NAME=${env.BRANCH_NAME} - set GIT_COMMIT=${env.GIT_COMMIT} - set RELEASE_BRANCH=${env.RELEASE_VERSION} - set RELEASE=${env.IS_RELEASE} - cd package_builder - jenkins_build_python.bat 3 - """ - } - } - } - } - stage("Report Unit Tests python 3") { - steps { - junit '**/test-reports/TEST-*.xml' - } - } - stage("Trigger Downstream") { - steps { - build job: 'ibex_gui_pipeline', wait: false - } - } - } - post { - cleanup { - echo "***" - echo "*** Any Office365connector Matched status FAILURE message below means" - echo "*** an earlier Jenkins step failed not the Office365connector itself" - echo "*** Search log file for ERROR to locate true cause" - echo "***" - } - always { - logParser ([ - projectRulePath: 'parse_rules', - parsingRulesPath: '', - showGraphs: true, - unstableOnWarning: false, - useProjectRule: true, - ]) - } - } -} diff --git a/Jenkinsfile_linux b/Jenkinsfile_linux deleted file mode 100644 index a882d0ef..00000000 --- a/Jenkinsfile_linux +++ /dev/null @@ -1,97 +0,0 @@ -#!groovy - -pipeline { - - // agent defines where the pipeline will run. - agent { - label { - label "sl7cloud" - } - } - - triggers { - pollSCM('H/2 * * * *') - } - - // The options directive is for configuration that applies to the whole job. - options { - buildDiscarder(logRotator(numToKeepStr:'5', daysToKeepStr: '7')) - timeout(time: 60, unit: 'MINUTES') - disableConcurrentBuilds() - timestamps() - office365ConnectorWebhooks([[ - name: "Office 365", - notifyBackToNormal: true, - startNotification: false, - notifyFailure: true, - notifySuccess: false, - notifyNotBuilt: false, - notifyAborted: false, - notifyRepeatedFailure: true, - notifyUnstable: true, - url: "${env.MSTEAMS_URL}" - ]] - ) - } - - stages { - stage("Checkout") { - steps { - echo "Branch: ${env.BRANCH_NAME}" - checkout scm - } - } - - stage("Build for Python 3") { - steps { - echo "Build Number: ${env.BUILD_NUMBER}" - script { - env.GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse HEAD').trim() - env.GIT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim() - echo "git commit: ${env.GIT_COMMIT}" - echo "git branch: ${env.BRANCH_NAME} ${env.GIT_BRANCH}" - // env.BRANCH_NAME is only supplied to multi-branch pipeline jobs - if (env.BRANCH_NAME == null) { - env.BRANCH_NAME = "master" - } - - if (env.BRANCH_NAME != null && env.BRANCH_NAME.startsWith("Release")) { - env.IS_RELEASE = "YES" - env.RELEASE_VERSION = "${env.BRANCH_NAME}".replace('Release_', '') - echo "release version: ${env.RELEASE_VERSION}" - } - else { - env.IS_RELEASE = "NO" - env.RELEASE_VERSION = "" - } - } - - sh """ - git clean -fqdx - export BUILD_NUMBER=${env.BUILD_NUMBER} - export BRANCH_NAME=${env.BRANCH_NAME} - export GIT_COMMIT=${env.GIT_COMMIT} - export RELEASE_BRANCH=${env.RELEASE_VERSION} - export RELEASE=${env.IS_RELEASE} - cd package_builder - sh jenkins_build_python.sh - """ - } - } - stage("Report Unit Tests python 3") { - steps { - junit '**/test-reports/TEST-*.xml' - } - } - stage("Trigger Downstream") { - steps { - build job: 'ibex_gui_linux_pipeline', wait: false - } - } - } - post { - always { - archiveArtifacts artifacts: 'docs/_build/html/**/*', caseSensitive: false - } - } -} diff --git a/README.md b/README.md index 949ef816..793edf48 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,11 @@ # genie_python -The ISIS Python-based instrument control and scripting library. +Instrument control and scripting library at the ISIS Neutron & Muon source. -## Instrument initialisation +--- -By default when setting an instrument the init_default.py file is loaded. -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. -If this path exists and contains a file called init_%INSTNAME%.py, it will load it too. +Documentation: https://isiscomputinggroup.github.io/genie/genie_python -On the NDX any files in C:\Instrument\Settings\config\NDX%INSTNAME%\Python can be added to SVN for safe keeping. +Source: https://github.com/ISISComputingGroup/genie -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. - -Folders inside the Python directory must have a `__init__.py` file for them to be available to be imported. - -## Start-up -The line "from genie_python import *" in genie_startup is responsible for loading all the genie_python stuff! -This file also contains code for disabling quickedit and for making genie_python guess the instrument name. - -As genie_python is running inside IPython we use c.TerminalIPythonApp.exec_files to run genie_start.py, so everything is imported correctly. +PyPi: https://pypi.org/project/genie_python/ diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index 9bf33cfb..00000000 --- a/doc/Makefile +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -W -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/genie_python.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/genie_python.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/genie_python" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/genie_python" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/doc/make.bat b/doc/make.bat deleted file mode 100644 index 2c0993f5..00000000 --- a/doc/make.bat +++ /dev/null @@ -1,242 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\genie_python.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\genie_python.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end diff --git a/doc/make_doc.sh b/doc/make_doc.sh deleted file mode 100644 index c117445b..00000000 --- a/doc/make_doc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -set -o errexit - -source ../package_builder/build-genie-python/venv/bin/activate -python3 -m pip install -r requirements.txt -make html - -deactivate diff --git a/mantid_requirements.txt b/mantid_requirements.txt deleted file mode 100644 index c93c5de9..00000000 --- a/mantid_requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -# -# additional requirements needed to run genie python in a mantid python session -# -pylint==2.13.9 -mysql-connector-python -CaChannel -graypy -mock -# these are also needed by genie python but look to be already in Mantid -#pywin32;platform_system=="Windows" -#future -#psutil diff --git a/parse_rules b/parse_rules deleted file mode 100644 index 290f3f42..00000000 --- a/parse_rules +++ /dev/null @@ -1,8 +0,0 @@ -# allow for [timestamp] -ok /IPython does not exist, auto complete not installed/ -error /(?i)^(\[[^]]*\] )?error:/ -error /(?i)^(\[[^]]*\] )?fatal:/ -error /FAILED \(errors=/ -error /FAILED \(failures=/ -warning /(?i)^(\[[^]]*\] )?warning:?/ -info /(?i)^(\[[^]]*\] )?info:?/ diff --git a/pyproject.toml b/pyproject.toml index 86e08b26..c055d372 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,9 +28,6 @@ classifiers = [ dependencies = [ # EPICS Channel access lib "CaChannel", - # Caffi provides some EPICS CA definitions if CaChannel is falling back to using caffi backend - # (not used if CaChannel._ca is available) - "caffi", # Send log messages to graylog "graypy", # genie_python will install ipython completers diff --git a/src/genie_python/genie_cachannel_wrapper.py b/src/genie_python/genie_cachannel_wrapper.py index a703d990..c5ad58cb 100644 --- a/src/genie_python/genie_cachannel_wrapper.py +++ b/src/genie_python/genie_cachannel_wrapper.py @@ -21,7 +21,13 @@ dbf_type_to_DBR_TIME, ) except ImportError: - from caffi.ca import AlarmCondition, AlarmSeverity, dbf_type_to_DBR_STS, dbf_type_to_DBR_TIME + # Note: caffi dynamically added to dependencies by CaChannel if not using built backend. + from caffi.ca import ( # type: ignore[reportMissingImports] + AlarmCondition, + AlarmSeverity, + dbf_type_to_DBR_STS, + dbf_type_to_DBR_TIME, + ) if TYPE_CHECKING: from genie_python.genie import PVValue diff --git a/src/genie_python/genie_dae.py b/src/genie_python/genie_dae.py index d9e69251..474b79c5 100644 --- a/src/genie_python/genie_dae.py +++ b/src/genie_python/genie_dae.py @@ -22,7 +22,8 @@ try: from CaChannel._ca import AlarmCondition, AlarmSeverity except ImportError: - from caffi.ca import AlarmCondition, AlarmSeverity + # Note: caffi dynamically added to dependencies by CaChannel if not using built backend. + from caffi.ca import AlarmCondition, AlarmSeverity # type: ignore[reportMissingImports] from genie_python.genie_cachannel_wrapper import CaChannelWrapper from genie_python.genie_change_cache import ChangeCache diff --git a/src/genie_python/run_tests.py b/src/genie_python/run_tests.py deleted file mode 100644 index 496cf82a..00000000 --- a/src/genie_python/run_tests.py +++ /dev/null @@ -1,56 +0,0 @@ -# This file is part of the ISIS IBEX application. -# Copyright (C) 2012-2016 Science & Technology Facilities Council. -# All rights reserved. -# -# This program is distributed in the hope that it will be useful. -# This program and the accompanying materials are made available under the -# terms of the Eclipse Public License v1.0 which accompanies this distribution. -# EXCEPT AS EXPRESSLY SET FORTH IN THE ECLIPSE PUBLIC LICENSE V1.0, THE PROGRAM -# AND ACCOMPANYING MATERIALS ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES -# OR CONDITIONS OF ANY KIND. See the Eclipse Public License v1.0 for more details. -# -# You should have received a copy of the Eclipse Public License v1.0 -# along with this program; if not, you can obtain a copy from -# https://www.eclipse.org/org/documents/epl-v10.php or -# http://opensource.org/licenses/eclipse-1.0.php - -# Add root path for access to server_commons -from __future__ import absolute_import, print_function - -import argparse -import os -import sys - -# Standard imports -import unittest - -import xmlrunner - -DEFAULT_DIRECTORY = os.path.join(".", "test-reports") - - -if __name__ == "__main__": - # get output directory from command line arguments - parser = argparse.ArgumentParser() - parser.add_argument( - "-o", - "--output_dir", - nargs=1, - type=str, - default=[DEFAULT_DIRECTORY], - help="The directory to save the test reports", - ) - args = parser.parse_args() - xml_dir = args.output_dir[0] - - # Load tests from test suites - test_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "test_modules")) - pattern = "*test_*.py" - test_suite = unittest.TestLoader().discover(test_dir, pattern=pattern) - - print("\n\n------ BEGINNING GENIE_PYTHON UNIT TESTS ------") - ret_vals = xmlrunner.XMLTestRunner(output=xml_dir).run(test_suite) - print("------ GENIE_PYTHON UNIT TESTS COMPLETE ------\n\n") - - # Return failure exit code if a test failed - sys.exit(bool(ret_vals.errors or ret_vals.failures))