From 936159c51e278145c205d73f3f5b633dbbb15ee9 Mon Sep 17 00:00:00 2001 From: Johannes Mueller Date: Mon, 16 Dec 2024 10:35:30 +0100 Subject: [PATCH] Remove old installation and build files This was overdue since everything is installable via pip. Signed-off-by: Johannes Mueller --- Jenkinsfile | 133 -------------------- batch_scripts/build_docs.bat | 16 --- batch_scripts/create_pylife_environment.bat | 25 ---- batch_scripts/create_pylife_environment.sh | 29 ----- batch_scripts/run_code_analysis.bat | 13 -- batch_scripts/run_pylife_tests.bat | 17 --- batch_scripts/run_test_cov_analysis.bat | 12 -- batch_scripts/start_Jupyter_notebook.bat | 10 -- install_pylife_win.bat | 2 - sonar-project.properties | 4 - 10 files changed, 261 deletions(-) delete mode 100644 Jenkinsfile delete mode 100644 batch_scripts/build_docs.bat delete mode 100644 batch_scripts/create_pylife_environment.bat delete mode 100755 batch_scripts/create_pylife_environment.sh delete mode 100644 batch_scripts/run_code_analysis.bat delete mode 100644 batch_scripts/run_pylife_tests.bat delete mode 100644 batch_scripts/run_test_cov_analysis.bat delete mode 100644 batch_scripts/start_Jupyter_notebook.bat delete mode 100644 install_pylife_win.bat delete mode 100644 sonar-project.properties diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 97a88030..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,133 +0,0 @@ -import hudson.tasks.junit.TestResultSummary - -// SonarQube related variable - FEEL FREE TO MODIFY -BASE_BRANCH_NAME = "develop" - -// SonarQube related variables -SONAR_PROPERTY_FILE = "sonar-project.properties" -CURRENT_BRANCH_NAME = env.BRANCH_NAME -PR_KEY = env.CHANGE_ID -SONARQUBE_SERVER_ID = "SonarqubeMSO" - -@Library('create-jenkins-library') _ -pipeline { - // Which Build Node? - agent any - // Discard the old builds and artifacts - options { - buildDiscarder logRotator( - artifactDaysToKeepStr: '30', - artifactNumToKeepStr: '1', - daysToKeepStr: '30', - numToKeepStr: '10' - ) - } - // Build stages - stages { - // Create a new Anaconda python virtual environment and install PIP packages - stage('Prepare Python env') { - steps { - bat 'install_pylife_win.bat' - } - } - // Test Python packages with PyTest - stage('PyTest') { - steps { - // Running unit tests - bat 'batch_scripts/run_pylife_tests.bat' - } - } - // Static code analysis with Flake8 - stage('Flake8') { - steps { - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - bat 'batch_scripts/run_code_analysis.bat' - } - } - } - // Building documentation - stage('Documentation') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { - bat 'batch_scripts/build_docs.bat' - } - } - } - stage ('Publish Test Results') { - steps { - // JUnit Test results - junit 'junit.xml' - - //Publish - publishHTML target: [ - allowMissing: false, - alwaysLinkToLastBuild: false, - keepAll: true, - reportDir: 'coverage_report', - reportFiles: 'index.html', - reportName: 'Test coverage' - ] - } - } - stage ('Publish coverage report') { - steps{ - script { - cobertura( - coberturaReportFile: "coverage_report.xml", - onlyStable: false, - failNoReports: true, - failUnhealthy: false, - failUnstable: false, - autoUpdateHealth: true, - autoUpdateStability: true, - zoomCoverageChart: true, - maxNumberOfBuilds: 0, - lineCoverageTargets: '75, 75, 75', - conditionalCoverageTargets: '75, 75, 75', - classCoverageTargets: '75, 75, 75', - methodCoverageTargets: '75, 75, 75', - fileCoverageTargets: '75, 75, 75', - ) - } - } - } - stage ('Publish documentation') { - steps{ - publishHTML target: [ - allowMissing: false, - alwaysLinkToLastBuild: false, - keepAll: true, - reportDir: 'docs/_build/', - reportFiles: 'index.html', - reportName: 'Documentation' - ] - } - } - stage ('SonarQube analysis') { - steps { - sonarScanner ( - sonarqubeServerID: SONARQUBE_SERVER_ID, - currentBranchName: CURRENT_BRANCH_NAME, - sonarBaseBranchName: BASE_BRANCH_NAME, - prKey: PR_KEY, - workSpacePath: env.WORKSPACE - ) - } - } - } - // Post-build actions - post { - always { - // Sending emails to developers & Culprits & Requester - script { - emailext body: '''${SCRIPT, template="groovy-html.template"}''', - mimeType: 'text/html', - subject: "[Jenkins] ${currentBuild.result}: '${env.JOB_NAME} [Build #${env.BUILD_NUMBER}]'", - recipientProviders: [ - [$class: 'CulpritsRecipientProvider'], - [$class: 'RequesterRecipientProvider'] - ] - } - } - } -} \ No newline at end of file diff --git a/batch_scripts/build_docs.bat b/batch_scripts/build_docs.bat deleted file mode 100644 index 3ddcef2a..00000000 --- a/batch_scripts/build_docs.bat +++ /dev/null @@ -1,16 +0,0 @@ -:: go one level up, if started from within the batch_scripts directory -set BATCH_PATH=%cd% - -:: test if current path contains "batch_scripts" -if not x%BATCH_PATH%==x%BATCH_PATH:batch_scripts=% ( - echo "cd" - cd .. -) - -call conda activate ./.venv - -for /f "tokens=*" %%a in ('git rev-parse --show-toplevel') do (set repo_path=%%a) - -set jupyter_path=%repo_path%.venv/Scripts/jupyter - -call sphinx-build -j1 -b html docs/ docs/_build diff --git a/batch_scripts/create_pylife_environment.bat b/batch_scripts/create_pylife_environment.bat deleted file mode 100644 index 6f5c6d54..00000000 --- a/batch_scripts/create_pylife_environment.bat +++ /dev/null @@ -1,25 +0,0 @@ -:: go one level up, if started from within the batch_scripts directory -set BATCH_PATH=%cd% - -:: test if current path contains "batch_scripts" -if not x%BATCH_PATH%==x%BATCH_PATH:batch_scripts=% ( - echo "cd" - cd .. -) - -call conda deactivate - -call conda env remove -p ./.venv - -for /f "tokens=*" %%a in ('git rev-parse --show-toplevel') do (set repo_path=%%a) - -set jupyter_path=%repo_path%/.venv/Scripts/jupyter - -rem filter disabled because it takes very long on windows and makes sourcetree basically unusable -rem call git config filter.jupyter_clean.clean "%jupyter_path% nbconvert --stdin --stdout --to notebook --ClearOutputPreprocessor.enabled=True" - -call conda create -p .venv --yes pip=20.2 pandoc setuptools_scm "python==3.9" - -call conda activate ./.venv - -call pip install -e .[testing,docs,analysis,pymc,extras,tsfresh] diff --git a/batch_scripts/create_pylife_environment.sh b/batch_scripts/create_pylife_environment.sh deleted file mode 100755 index 889d0e34..00000000 --- a/batch_scripts/create_pylife_environment.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - - -if [[ `uname` = Linux ]] ; then - JUPYTER=`git rev-parse --show-toplevel`/.venv/bin/jupyter - . $ANACONDA_HOME/etc/profile.d/conda.sh -else - JUPYTER=`git rev-parse --show-toplevel`/.venv/Scripts/jupyter - eval "$('/c/Program Files/Anaconda3/Scripts/conda.exe' 'shell.bash' 'hook')" -fi - -git config filter.jupyter_clean.clean \ - "$JUPYTER nbconvert \ - --stdin --stdout --to notebook --ClearOutputPreprocessor.enabled=True" - - -conda env create -p .venv --file environment.yml - -conda activate ./.venv - -if [[ `uname` != Linux ]] ; then - conda install pywin32 -fi - -NO_INSTALL_REQUIREMENTS=true python setup.py develop - -conda deactivate - -shopt -q login_shell && read -n1 -r -p "Press any key to continue..." key diff --git a/batch_scripts/run_code_analysis.bat b/batch_scripts/run_code_analysis.bat deleted file mode 100644 index 957f44d2..00000000 --- a/batch_scripts/run_code_analysis.bat +++ /dev/null @@ -1,13 +0,0 @@ -:: go one level up, if started from within the batch_scripts directory -set BATCH_PATH=%cd% - -:: test if current path contains "batch_scripts" -if not x%BATCH_PATH%==x%BATCH_PATH:batch_scripts=% ( - echo "cd" - cd .. -) - -call conda activate ./.venv - -if exist flake8.log del flake8.log -call flake8 --exit-zero --exclude=.venv > flake8.log || exit /B 1 \ No newline at end of file diff --git a/batch_scripts/run_pylife_tests.bat b/batch_scripts/run_pylife_tests.bat deleted file mode 100644 index 84bf18b4..00000000 --- a/batch_scripts/run_pylife_tests.bat +++ /dev/null @@ -1,17 +0,0 @@ -:: go one level up, if started from within the batch_scripts directory -set BATCH_PATH=%cd% - -:: test if current path contains "batch_scripts" -if not x%BATCH_PATH%==x%BATCH_PATH:batch_scripts=% ( - echo "cd" - cd .. -) - - -call conda activate ./.venv - -call python setup.py build_ext --inplace --force --define CYTHON_TRACE - -call python -m pytest -v -ra --cache-clear --junit-xml=junit.xml --cov-report xml:coverage_report.xml --cov-report html:coverage_report --cov=pylife || exit /B 1 - -call pytest -mdemos \ No newline at end of file diff --git a/batch_scripts/run_test_cov_analysis.bat b/batch_scripts/run_test_cov_analysis.bat deleted file mode 100644 index 709efa6a..00000000 --- a/batch_scripts/run_test_cov_analysis.bat +++ /dev/null @@ -1,12 +0,0 @@ -:: go one level up, if started from within the batch_scripts directory -set BATCH_PATH=%cd% - -:: test if current path contains "batch_scripts" -if not x%BATCH_PATH%==x%BATCH_PATH:batch_scripts=% ( - echo "cd" - cd .. -) - -call conda activate ./.venv - -call python batch_scripts\test_cov_analysis.py E:\pyLife_coverage\ || exit /B 1 \ No newline at end of file diff --git a/batch_scripts/start_Jupyter_notebook.bat b/batch_scripts/start_Jupyter_notebook.bat deleted file mode 100644 index 58bb0ebf..00000000 --- a/batch_scripts/start_Jupyter_notebook.bat +++ /dev/null @@ -1,10 +0,0 @@ -rem go one level up -cd .. - -call conda activate ./.venv - -rem make sure that jupyter is installed -call pip install jupyter - -call jupyter notebook --notebook-dir ./demos - diff --git a/install_pylife_win.bat b/install_pylife_win.bat deleted file mode 100644 index d50c60d2..00000000 --- a/install_pylife_win.bat +++ /dev/null @@ -1,2 +0,0 @@ -cd batch_scripts -.\create_pylife_environment.bat \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 5a54bf2b..00000000 --- a/sonar-project.properties +++ /dev/null @@ -1,4 +0,0 @@ -sonar.projectKey=com.bosch.mso_sw.pyLife -sonar.web.javaOpts=-Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Djdk.http.auth.tunneling.disabledSchemes="" -sonar.python.coverage.reportPaths=coverage_report.xml -sonar.inclusions=src/pylife/**/*.py