From eb75a12a4f4858b0763128b396ad52755306a056 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Fri, 26 Jan 2024 11:49:50 -0500 Subject: [PATCH 01/53] specify PR head commit instead of Jenkins merge commit to codecov --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1f6245051..8b80884fb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -60,7 +60,9 @@ pipeline { shasum -a 256 -c codecov.SHA256SUM chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} -f .test_reports/coverage.xml + ./codecov -t ${CODECOV_TOKEN} \ + -f .test_reports/coverage.xml \ + -C ${GIT_PREVIOUS_COMMIT} ''' } } From 751a2ff7498d7af563518bbd8dc370ce300636eb Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Sat, 27 Jan 2024 00:22:00 -0500 Subject: [PATCH 02/53] remove inner jenkins coverage reporting. the plugin has a vulnerability breach --- Jenkinsfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b80884fb..07cc5a81a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -45,11 +45,6 @@ pipeline { ''' } discoverGitReferenceBuild() - recordCoverage( - name: 'Scilpy Coverage Report', - sourceCodeRetention: 'MODIFIED', - tools: [[parser: 'COBERTURA', - pattern: '**/.test_reports/coverage.xml']]) sh ''' curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step curl -Os https://uploader.codecov.io/latest/linux/codecov From 987b5dbc12896b9d2a47ca02a368f4ead248a3e7 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Sat, 27 Jan 2024 02:26:13 -0500 Subject: [PATCH 03/53] fix jenkins commit in env --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 07cc5a81a..14531517a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,6 +22,7 @@ pipeline { pip3 install -e . ''' } + } } } @@ -44,6 +45,9 @@ pipeline { pytest --cov-report term-missing:skip-covered ''' } + script { + GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse $GIT_BRANCH').trim() + } discoverGitReferenceBuild() sh ''' curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step @@ -55,9 +59,8 @@ pipeline { shasum -a 256 -c codecov.SHA256SUM chmod +x codecov - ./codecov -t ${CODECOV_TOKEN} \ - -f .test_reports/coverage.xml \ - -C ${GIT_PREVIOUS_COMMIT} + ./codecov -v -t ${CODECOV_TOKEN} \ + -f .test_reports/coverage.xml ''' } } From 7741a93f2f6485845f579dbf086de2e5363482f3 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 29 Jan 2024 12:09:24 -0500 Subject: [PATCH 04/53] force codecov commits to use --- Jenkinsfile | 5 ++++- codecov.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 codecov.yml diff --git a/Jenkinsfile b/Jenkinsfile index 14531517a..c31441d8f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,6 +47,7 @@ pipeline { } script { GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse $GIT_BRANCH').trim() + GIT_PREVIOUS_COMMIT = sh(returnStdout: true, script: 'git merge-base origin/master $GIT_BRANCH').trim() } discoverGitReferenceBuild() sh ''' @@ -60,7 +61,9 @@ pipeline { chmod +x codecov ./codecov -v -t ${CODECOV_TOKEN} \ - -f .test_reports/coverage.xml + -f .test_reports/coverage.xml \ + -C ${GIT_COMMIT} \ + -N ${GIT_PREVIOUS_COMMIT} ''' } } diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..6a204f89f --- /dev/null +++ b/codecov.yml @@ -0,0 +1,2 @@ +codecov: + allow_coverage_offsets: True \ No newline at end of file From 21a439748f1cf5f887de860dae57d2c140ea5567 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 29 Jan 2024 12:38:45 -0500 Subject: [PATCH 05/53] refine codecov config --- codecov.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/codecov.yml b/codecov.yml index 6a204f89f..42d8ef542 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,2 +1,34 @@ codecov: - allow_coverage_offsets: True \ No newline at end of file + allow_coverage_offsets: True + + comment: + layout: "header, diff, flags, components" + + component_management: + individual_components: + - component_id: scilpy_scripts + name: Scripts + paths: + - scripts/ + - component_id: scilpy_library + name: Library + paths: + - scilpy/ + + status: + project: + default: + target: 75% + threshold: 2% + branches: + - master + if_ci_failed: error + only_pulls: false + patch: + default: + target: 90% + branches: + - master + if_ci_failed: error + only_pulls: false + From ea531cd6922473bcd6c08b711fc2ea96a6266382 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 29 Jan 2024 13:58:10 -0500 Subject: [PATCH 06/53] Fix codecov config --- codecov.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/codecov.yml b/codecov.yml index 42d8ef542..9f9d97b6f 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,20 +1,7 @@ codecov: allow_coverage_offsets: True - - comment: - layout: "header, diff, flags, components" - - component_management: - individual_components: - - component_id: scilpy_scripts - name: Scripts - paths: - - scripts/ - - component_id: scilpy_library - name: Library - paths: - - scilpy/ +coverage: status: project: default: @@ -32,3 +19,16 @@ codecov: if_ci_failed: error only_pulls: false +component_management: + individual_components: + - component_id: scilpy_scripts + name: Scripts + paths: + - scripts/ + - component_id: scilpy_library + name: Library + paths: + - scilpy/ + +comment: + layout: "condensed_header, diff, components" \ No newline at end of file From 13b8128a04f2fc9b4422892fc8af959131b821e7 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 29 Jan 2024 14:34:08 -0500 Subject: [PATCH 07/53] set codecov commits in env clause for the stage --- Jenkinsfile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c31441d8f..d13a0e7ef 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,6 +31,14 @@ pipeline { stage('Test') { environment { CODECOV_TOKEN = credentials('scilpy-codecov-token') + CODECOV_GIT_COMMIT = """${sh( + returnStdout: true, + script: 'git rev-parse $GIT_BRANCH' + ).trim()}""" + CODECOV_PARENT_COMMIT = """${sh( + returnStdout: true, + script: 'git merge-base origin/master $GIT_BRANCH' + ).trim()}""" } steps { withPythonEnv('CPython-3.10') { @@ -45,10 +53,6 @@ pipeline { pytest --cov-report term-missing:skip-covered ''' } - script { - GIT_COMMIT = sh(returnStdout: true, script: 'git rev-parse $GIT_BRANCH').trim() - GIT_PREVIOUS_COMMIT = sh(returnStdout: true, script: 'git merge-base origin/master $GIT_BRANCH').trim() - } discoverGitReferenceBuild() sh ''' curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step @@ -62,8 +66,8 @@ pipeline { chmod +x codecov ./codecov -v -t ${CODECOV_TOKEN} \ -f .test_reports/coverage.xml \ - -C ${GIT_COMMIT} \ - -N ${GIT_PREVIOUS_COMMIT} + -C ${CODECOV_GIT_COMMIT} \ + -N ${CODECOV_PARENT_COMMIT} ''' } } From 861b9cced8d76ecc1088689f4634e9e8b24d9c2f Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Fri, 2 Feb 2024 15:54:21 -0500 Subject: [PATCH 08/53] Ensure that we get the right data even if ArraySequence's view is not ordered --- scripts/scil_tractogram_assign_custom_color.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/scil_tractogram_assign_custom_color.py b/scripts/scil_tractogram_assign_custom_color.py index 51b249b54..b49cbbb45 100755 --- a/scripts/scil_tractogram_assign_custom_color.py +++ b/scripts/scil_tractogram_assign_custom_color.py @@ -200,7 +200,9 @@ def main(): data = np.clip(data, np.quantile(data, 0.05), np.quantile(data, 0.95)) elif args.use_dpp: - data = np.squeeze(sft.data_per_point[args.use_dpp]._data) + tmp = [np.squeeze(sft.data_per_point[args.use_dpp][s]) for s in + range(len(sft))] + data = np.hstack(tmp) elif args.load_dps: data = np.squeeze(load_matrix_in_any_format(args.load_dps)) if len(data) != len(sft): From 17d7a104a8dc28da7759b557ee7be50512641657 Mon Sep 17 00:00:00 2001 From: EmmaRenauld Date: Fri, 2 Feb 2024 16:00:14 -0500 Subject: [PATCH 09/53] Rename test files --- ...o_tractogram.py => test_tractogram_assign_custom_color.py} | 4 ++-- ...tractograms.py => test_tractogram_assign_uniform_color.py} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename scripts/tests/{test_assign_custom_color_to_tractogram.py => test_tractogram_assign_custom_color.py} (85%) rename scripts/tests/{test_assign_uniform_color_to_tractograms.py => test_tractogram_assign_uniform_color.py} (83%) diff --git a/scripts/tests/test_assign_custom_color_to_tractogram.py b/scripts/tests/test_tractogram_assign_custom_color.py similarity index 85% rename from scripts/tests/test_assign_custom_color_to_tractogram.py rename to scripts/tests/test_tractogram_assign_custom_color.py index 1dc8a4a84..c048d41b7 100644 --- a/scripts/tests/test_assign_custom_color_to_tractogram.py +++ b/scripts/tests/test_tractogram_assign_custom_color.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_assign_custom_color_to_tractogram.py', + ret = script_runner.run('scil_tractogram_assign_custom_color.py', '--help') assert ret.success @@ -24,7 +24,7 @@ def test_execution_tractometry(script_runner): 'IFGWM.trk') in_anat = os.path.join(get_home(), 'tractometry', 'IFGWM_labels_map.nii.gz') - ret = script_runner.run('scil_assign_custom_color_to_tractogram.py', + ret = script_runner.run('scil_tractogram_assign_custom_color.py', in_bundle, 'colored.trk', '--from_anatomy', in_anat) assert ret.success diff --git a/scripts/tests/test_assign_uniform_color_to_tractograms.py b/scripts/tests/test_tractogram_assign_uniform_color.py similarity index 83% rename from scripts/tests/test_assign_uniform_color_to_tractograms.py rename to scripts/tests/test_tractogram_assign_uniform_color.py index 7caf221bf..20147b069 100644 --- a/scripts/tests/test_assign_uniform_color_to_tractograms.py +++ b/scripts/tests/test_tractogram_assign_uniform_color.py @@ -13,7 +13,7 @@ def test_help_option(script_runner): - ret = script_runner.run('scil_assign_uniform_color_to_tractograms.py', + ret = script_runner.run('scil_tractogram_assign_uniform_color.py', '--help') assert ret.success @@ -22,7 +22,7 @@ def test_execution_tractometry(script_runner): os.chdir(os.path.expanduser(tmp_dir.name)) in_bundle = os.path.join(get_home(), 'tractometry', 'IFGWM.trk') - ret = script_runner.run('scil_assign_uniform_color_to_tractograms.py', + ret = script_runner.run('scil_tractogram_assign_uniform_color.py', in_bundle, '--fill_color', '0x000000', '--out_tractogram', 'colored.trk') assert ret.success From 8b5de45b6f32411da85351ca726fbd46a02ff72f Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Wed, 31 Jan 2024 23:30:47 -0500 Subject: [PATCH 10/53] simple hello world workflow --- .github/workflows/hello_world.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/hello_world.yml diff --git a/.github/workflows/hello_world.yml b/.github/workflows/hello_world.yml new file mode 100644 index 000000000..c540c0f5f --- /dev/null +++ b/.github/workflows/hello_world.yml @@ -0,0 +1,10 @@ +name: Actions Runner Controller Demo +on: + workflow_dispatch: + +jobs: + Explore-GitHub-Actions: + # You need to use the INSTALLATION_NAME from the previous step + runs-on: scilus-runners + steps: + - run: echo "🎉 This job uses runner scale set runners!" From a8aa4a83fbf9976e7fcc500b67b4e872fec9d933 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 14:56:32 -0500 Subject: [PATCH 11/53] add simpletest pipeline --- .github/workflows/test.yml | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..a2048a6e6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,64 @@ +name: Scilpy test suite + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: action/checkout@v4 + + - name: Fetch python version from repository + id: python-selector + run: echo ::set-output name=python-version::$(cat .python-version) + + - name: Set up Python for Scilpy + uses: actions/setup-python@v5.0.0 + with: + python-version: python${{ steps.python-selector.outputs.python-version }} + + - name: Install non-python dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + python${{ steps.python-selector.outputs.python-version }}-dev \ + python${{ steps.python-selector.outputs.python-version }}-venv \ + python${{ steps.python-selector.outputs.python-version }}-minimal \ + python${{ steps.python-selector.outputs.python-version }}-tk \ + libblas-dev \ + liblapack-dev \ + libfreetype6-dev + + - name: Install Scilpy + run: | + python -m pip install --upgrade pip + python -m pip install -e . + + - name: Run tests + run: | + export MPLBACKEND="agg" + export OPENBLAS_NUM_THREADS=1 + pytest --cov-report term-missing:skip-covered + + - name: Upload test reports and coverage to artifacts + uses: echapmanFromBunnings/upload-artifact@3.0.0 + with: + name: test-reports + path: | + .test_reports/* + + - name: Upload coverage to codecov + uses: codecov/codecov-action@v4.0.0 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: .test_reports/coverage.xml + flags: unittests + fail_ci_if_error: true From 592a728a5844c02e3c56b515bd57df58f4c27d72 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 14:57:41 -0500 Subject: [PATCH 12/53] fix checkout --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2048a6e6..1f8b7e6a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: action/checkout@v4 + uses: actions/checkout@v4.1.1 - name: Fetch python version from repository id: python-selector From 9b7c4a285845a333db11184bee290e61c541be3c Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 15:00:20 -0500 Subject: [PATCH 13/53] bad python version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1f8b7e6a5..1c3256714 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Python for Scilpy uses: actions/setup-python@v5.0.0 with: - python-version: python${{ steps.python-selector.outputs.python-version }} + python-version: ${{ steps.python-selector.outputs.python-version }} - name: Install non-python dependencies run: | From f503d40725600c45b9f8065aebc190ee2dc07ab8 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 15:09:50 -0500 Subject: [PATCH 14/53] run on scilus-runners --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c3256714..8fecb38ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,9 +9,13 @@ on: - master workflow_dispatch: +env: + MPLBACKEND: agg + OPENBLAS_NUM_THREADS: 1 + jobs: test: - runs-on: ubuntu-latest + runs-on: scilus-runners steps: - name: Checkout repository uses: actions/checkout@v4.1.1 @@ -44,8 +48,6 @@ jobs: - name: Run tests run: | - export MPLBACKEND="agg" - export OPENBLAS_NUM_THREADS=1 pytest --cov-report term-missing:skip-covered - name: Upload test reports and coverage to artifacts From ef656e8fe1aae7b9991bf77a89328899b6f1671e Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 15:13:38 -0500 Subject: [PATCH 15/53] Add build-essentials for gcc --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fecb38ce..e0eb42844 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y \ + build-essentials \ python${{ steps.python-selector.outputs.python-version }}-dev \ python${{ steps.python-selector.outputs.python-version }}-venv \ python${{ steps.python-selector.outputs.python-version }}-minimal \ From a6e738d6e17c2404d9d8fe66af9feed53ead0467 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 15:15:02 -0500 Subject: [PATCH 16/53] typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0eb42844..7e3c5df34 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y \ - build-essentials \ + build-essential \ python${{ steps.python-selector.outputs.python-version }}-dev \ python${{ steps.python-selector.outputs.python-version }}-venv \ python${{ steps.python-selector.outputs.python-version }}-minimal \ From c35d3e5cafb0eb87af85a87ccffaa23643941d08 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 15:28:43 -0500 Subject: [PATCH 17/53] add libgl --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7e3c5df34..a8f329ec7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,9 @@ jobs: python${{ steps.python-selector.outputs.python-version }}-tk \ libblas-dev \ liblapack-dev \ - libfreetype6-dev + libfreetype6-dev \ + libgl1-mesa-dev \ + libgl1-mesa-dri - name: Install Scilpy run: | From a6e376496f4a498b4683fe353b79eb4cad28ee22 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 16:06:02 -0500 Subject: [PATCH 18/53] install git --- .github/workflows/test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8f329ec7..662b1075e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,15 +34,16 @@ jobs: sudo apt-get update sudo apt-get install -y \ build-essential \ - python${{ steps.python-selector.outputs.python-version }}-dev \ - python${{ steps.python-selector.outputs.python-version }}-venv \ - python${{ steps.python-selector.outputs.python-version }}-minimal \ - python${{ steps.python-selector.outputs.python-version }}-tk \ + git \ libblas-dev \ liblapack-dev \ libfreetype6-dev \ libgl1-mesa-dev \ - libgl1-mesa-dri + libgl1-mesa-dri \ + python${{ steps.python-selector.outputs.python-version }}-dev \ + python${{ steps.python-selector.outputs.python-version }}-venv \ + python${{ steps.python-selector.outputs.python-version }}-minimal \ + python${{ steps.python-selector.outputs.python-version }}-tk - name: Install Scilpy run: | From 180aed1135c614e85b449fc5c236d5d20c5bcecb Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 22:54:56 -0500 Subject: [PATCH 19/53] remove python install, should be handled by the setup-python action --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 662b1075e..d34100933 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,11 +39,7 @@ jobs: liblapack-dev \ libfreetype6-dev \ libgl1-mesa-dev \ - libgl1-mesa-dri \ - python${{ steps.python-selector.outputs.python-version }}-dev \ - python${{ steps.python-selector.outputs.python-version }}-venv \ - python${{ steps.python-selector.outputs.python-version }}-minimal \ - python${{ steps.python-selector.outputs.python-version }}-tk + libgl1-mesa-dri - name: Install Scilpy run: | From 13b54d325ece697f68d50947625c388bb0dd362a Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 23:26:01 -0500 Subject: [PATCH 20/53] remove mesa-dri --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d34100933..6f93dea11 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,8 +38,7 @@ jobs: libblas-dev \ liblapack-dev \ libfreetype6-dev \ - libgl1-mesa-dev \ - libgl1-mesa-dri + libgl1-mesa-dev - name: Install Scilpy run: | From 6dd408bae61a4cef0a2c87986a294e0b293f97bc Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Thu, 1 Feb 2024 23:36:01 -0500 Subject: [PATCH 21/53] add missing lib --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f93dea11..fc346997f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,8 @@ jobs: libblas-dev \ liblapack-dev \ libfreetype6-dev \ - libgl1-mesa-dev + libgl1-mesa-dev \ + libxrender1 - name: Install Scilpy run: | From b27527ed000661d6eb25c1572aa0d996f7a4d1e1 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Fri, 2 Feb 2024 16:34:22 -0500 Subject: [PATCH 22/53] try custom image (no need to set rendering) --- .github/workflows/test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc346997f..b363f369c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,9 +37,7 @@ jobs: git \ libblas-dev \ liblapack-dev \ - libfreetype6-dev \ - libgl1-mesa-dev \ - libxrender1 + libfreetype6-dev - name: Install Scilpy run: | From ce209343e6fb30d334ebb7b2aaf17aa6d39fbe96 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Sun, 4 Feb 2024 00:30:10 -0500 Subject: [PATCH 23/53] re-add python headers --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b363f369c..c1d95185e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,8 @@ jobs: git \ libblas-dev \ liblapack-dev \ - libfreetype6-dev + libfreetype6-dev \ + python${{ steps.python-selector.outputs.python-version }}-dev - name: Install Scilpy run: | From d486a03ba907edc8d5c8c9309f3a574ffc5d62dd Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 14:01:36 -0500 Subject: [PATCH 24/53] fixes --- .github/workflows/test.yml | 7 ++++--- MANIFEST.in | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c1d95185e..116413b06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,22 +31,23 @@ jobs: - name: Install non-python dependencies run: | + sudo apt-get update sudo apt-get install -y \ build-essential \ git \ libblas-dev \ liblapack-dev \ - libfreetype6-dev \ - python${{ steps.python-selector.outputs.python-version }}-dev + libfreetype6-dev - name: Install Scilpy run: | python -m pip install --upgrade pip - python -m pip install -e . + python -m pip install -e . -vvvvv - name: Run tests run: | + export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH pytest --cov-report term-missing:skip-covered - name: Upload test reports and coverage to artifacts diff --git a/MANIFEST.in b/MANIFEST.in index beea28192..2a51044ad 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,6 +2,7 @@ include README.md include LICENSE include requirements.txt include .python-version +include data/ recursive-include scilpy *.c recursive-include scilpy *.cpp From dcc2b4a8f60417eef3c1b4830d161955edbe6bed Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 14:31:23 -0500 Subject: [PATCH 25/53] downgrade action/setup-python --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 116413b06..f99e918d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: run: echo ::set-output name=python-version::$(cat .python-version) - name: Set up Python for Scilpy - uses: actions/setup-python@v5.0.0 + uses: actions/setup-python@v4.8.0 with: python-version: ${{ steps.python-selector.outputs.python-version }} From 3b9b4043e8266d54121fdf4cc79afa4ee3b397f5 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 14:41:45 -0500 Subject: [PATCH 26/53] run failing test only --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f99e918d7..14dc9c3fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,7 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH - pytest --cov-report term-missing:skip-covered + pytest --cov-report term-missing:skip-covered scilpy/scripts/tests/test_tractogram_filter_by_anatomy.py - name: Upload test reports and coverage to artifacts uses: echapmanFromBunnings/upload-artifact@3.0.0 From f29e6ab57098dc1ab78ff8b57173f1d17eccdfee Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 14:48:53 -0500 Subject: [PATCH 27/53] fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14dc9c3fd..93eda74a1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,7 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH - pytest --cov-report term-missing:skip-covered scilpy/scripts/tests/test_tractogram_filter_by_anatomy.py + pytest --cov-report term-missing:skip-covered scripts/tests/test_tractogram_filter_by_anatomy.py - name: Upload test reports and coverage to artifacts uses: echapmanFromBunnings/upload-artifact@3.0.0 From 35420f20a35c0ac19a4098716ecc00842627901b Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 15:10:20 -0500 Subject: [PATCH 28/53] include package data via manifest, as should be --- MANIFEST.in | 2 +- setup.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 2a51044ad..a685197b6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,8 +2,8 @@ include README.md include LICENSE include requirements.txt include .python-version -include data/ +recursive-include data * recursive-include scilpy *.c recursive-include scilpy *.cpp recursive-include scilpy *.pyx diff --git a/setup.py b/setup.py index f8127082b..ffaad9614 100644 --- a/setup.py +++ b/setup.py @@ -103,10 +103,6 @@ def run(self): os.path.basename(s).split(".")[0]) for s in SCRIPTS] + entry_point_legacy }, - data_files=[('data/LUT', - ["data/LUT/freesurfer_desikan_killiany.json", - "data/LUT/freesurfer_subcortical.json", - "data/LUT/dk_aggregate_structures.json"])], include_package_data=True) setup(**opts) From 5c70a47c8738fc9fb5af3171b445c5cc99722364 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 15:10:41 -0500 Subject: [PATCH 29/53] remove verbose install --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 93eda74a1..6c6033d47 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: - name: Install Scilpy run: | python -m pip install --upgrade pip - python -m pip install -e . -vvvvv + python -m pip install -e . - name: Run tests run: | From 283b33eeb9c04098c1e433f753415362fde8219d Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 15:16:03 -0500 Subject: [PATCH 30/53] use importlib --- scripts/scil_tractogram_filter_by_anatomy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/scil_tractogram_filter_by_anatomy.py b/scripts/scil_tractogram_filter_by_anatomy.py index b9c5bfeb0..3a8080381 100755 --- a/scripts/scil_tractogram_filter_by_anatomy.py +++ b/scripts/scil_tractogram_filter_by_anatomy.py @@ -49,7 +49,7 @@ import json import logging import os -import pkg_resources +import importlib.resources as resources from dipy.io.streamline import save_tractogram from dipy.io.utils import is_header_compatible @@ -142,9 +142,9 @@ def load_wmparc_labels(): Load labels dictionary of different parcellations from the Desikan-Killiany atlas """ - resource_package = pkg_resources.get_distribution('scilpy').location + resource_package = resources.path('scilpy', 'data') labels_path = os.path.join( - resource_package, 'data/LUT/dk_aggregate_structures.json') + resource_package, 'LUT/dk_aggregate_structures.json') with open(labels_path) as labels_file: labels = json.load(labels_file) return labels From c7d9904bc39e83e67bb54288809f90cbc56f1f0f Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 15:24:17 -0500 Subject: [PATCH 31/53] update setuptools and wheel --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c6033d47..8590dd9c7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,7 +42,7 @@ jobs: - name: Install Scilpy run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools wheel python -m pip install -e . - name: Run tests From 5f8252e5f89be2e94996eb98d52ac52998bbf359 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 15:42:31 -0500 Subject: [PATCH 32/53] fix manifest --- .github/workflows/test.yml | 2 +- MANIFEST.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8590dd9c7..f9b55ef97 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: run: echo ::set-output name=python-version::$(cat .python-version) - name: Set up Python for Scilpy - uses: actions/setup-python@v4.8.0 + uses: actions/setup-python@v5.0.0 with: python-version: ${{ steps.python-selector.outputs.python-version }} diff --git a/MANIFEST.in b/MANIFEST.in index a685197b6..e16edd8b0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,7 @@ include LICENSE include requirements.txt include .python-version -recursive-include data * +recursive-include data/LUT * recursive-include scilpy *.c recursive-include scilpy *.cpp recursive-include scilpy *.pyx From f595d2064ea35141df5abd8d4d3ddaf214ca4172 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 16:32:18 -0500 Subject: [PATCH 33/53] debug messages --- .github/workflows/test.yml | 4 +++- setup.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9b55ef97..4bc13422d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,8 +42,10 @@ jobs: - name: Install Scilpy run: | + python --version python -m pip install --upgrade pip setuptools wheel - python -m pip install -e . + python -m pip install -e . -v + python -m pip list - name: Run tests run: | diff --git a/setup.py b/setup.py index ffaad9614..68d63c4a6 100644 --- a/setup.py +++ b/setup.py @@ -103,6 +103,7 @@ def run(self): os.path.basename(s).split(".")[0]) for s in SCRIPTS] + entry_point_legacy }, + package_data={'': ['*.json', 'data/LUT/*.json']}, include_package_data=True) setup(**opts) From 0ec747d83f40ad56edb8c73320ad03c2752b6005 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 21:48:57 -0500 Subject: [PATCH 34/53] revert and debug --- .github/workflows/test.yml | 1 + setup.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4bc13422d..2936d0208 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,7 @@ jobs: - name: Install Scilpy run: | python --version + python -m pip list python -m pip install --upgrade pip setuptools wheel python -m pip install -e . -v python -m pip list diff --git a/setup.py b/setup.py index 68d63c4a6..f8127082b 100644 --- a/setup.py +++ b/setup.py @@ -103,7 +103,10 @@ def run(self): os.path.basename(s).split(".")[0]) for s in SCRIPTS] + entry_point_legacy }, - package_data={'': ['*.json', 'data/LUT/*.json']}, + data_files=[('data/LUT', + ["data/LUT/freesurfer_desikan_killiany.json", + "data/LUT/freesurfer_subcortical.json", + "data/LUT/dk_aggregate_structures.json"])], include_package_data=True) setup(**opts) From 25669e26acce59bc67b65f377dd605cd5ac0dea7 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 22:47:08 -0500 Subject: [PATCH 35/53] sleepfor debug purposes --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2936d0208..2b12c2424 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,6 +47,7 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install -e . -v python -m pip list + sleep infinite - name: Run tests run: | From 9d58df54cf7910bb0f55f271e0f086488bb5c3de Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 23:09:48 -0500 Subject: [PATCH 36/53] typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2b12c2424..65fa8df0e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,7 +47,7 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install -e . -v python -m pip list - sleep infinite + sleep infinity - name: Run tests run: | From d6924f59fd6710b6d657f70ff51215422bc5e7d1 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Mon, 5 Feb 2024 23:18:36 -0500 Subject: [PATCH 37/53] move sleep for debug --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65fa8df0e..fab10d239 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,11 +47,11 @@ jobs: python -m pip install --upgrade pip setuptools wheel python -m pip install -e . -v python -m pip list - sleep infinity - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH + sleep infinity pytest --cov-report term-missing:skip-covered scripts/tests/test_tractogram_filter_by_anatomy.py - name: Upload test reports and coverage to artifacts From 316397073598a2f7c178f002f2464e378ea93713 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 00:09:05 -0500 Subject: [PATCH 38/53] put sleep after pytest to investiguate --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fab10d239..7f10a26f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,8 +51,8 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH - sleep infinity pytest --cov-report term-missing:skip-covered scripts/tests/test_tractogram_filter_by_anatomy.py + sleep infinity - name: Upload test reports and coverage to artifacts uses: echapmanFromBunnings/upload-artifact@3.0.0 From f9f0e2f4ea1bd71d96aea1b63028bfbbf0d5b36d Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 00:30:14 -0500 Subject: [PATCH 39/53] final try --- scripts/scil_tractogram_filter_by_anatomy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/scil_tractogram_filter_by_anatomy.py b/scripts/scil_tractogram_filter_by_anatomy.py index 3a8080381..5accd0c94 100755 --- a/scripts/scil_tractogram_filter_by_anatomy.py +++ b/scripts/scil_tractogram_filter_by_anatomy.py @@ -142,9 +142,8 @@ def load_wmparc_labels(): Load labels dictionary of different parcellations from the Desikan-Killiany atlas """ - resource_package = resources.path('scilpy', 'data') - labels_path = os.path.join( - resource_package, 'LUT/dk_aggregate_structures.json') + lut_package = os.path.join(resources.files('data'), 'LUT') + labels_path = os.path.join(lut_package, 'dk_aggregate_structures.json') with open(labels_path) as labels_file: labels = json.load(labels_file) return labels From b22b800910b8e10ed65e482705a3715e7e8c1231 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 09:08:15 -0500 Subject: [PATCH 40/53] set pip cache + fix --- .github/workflows/test.yml | 3 ++- scripts/scil_tractogram_filter_by_anatomy.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f10a26f7..6d97906ab 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,7 @@ jobs: uses: actions/setup-python@v5.0.0 with: python-version: ${{ steps.python-selector.outputs.python-version }} + cache: 'pip' - name: Install non-python dependencies run: | @@ -45,7 +46,7 @@ jobs: python --version python -m pip list python -m pip install --upgrade pip setuptools wheel - python -m pip install -e . -v + python -m pip install -e . python -m pip list - name: Run tests diff --git a/scripts/scil_tractogram_filter_by_anatomy.py b/scripts/scil_tractogram_filter_by_anatomy.py index 5accd0c94..d2e2625f1 100755 --- a/scripts/scil_tractogram_filter_by_anatomy.py +++ b/scripts/scil_tractogram_filter_by_anatomy.py @@ -142,8 +142,8 @@ def load_wmparc_labels(): Load labels dictionary of different parcellations from the Desikan-Killiany atlas """ - lut_package = os.path.join(resources.files('data'), 'LUT') - labels_path = os.path.join(lut_package, 'dk_aggregate_structures.json') + lut_package = resources.files('data').joinpath('LUT') + labels_path = lut_package.joinpath('dk_aggregate_structures.json') with open(labels_path) as labels_file: labels = json.load(labels_file) return labels From e81424bd6b4edb96c2cb14ccaa933190038e9a5e Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 09:50:23 -0500 Subject: [PATCH 41/53] remove debug --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6d97906ab..390f92110 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,17 +43,13 @@ jobs: - name: Install Scilpy run: | - python --version - python -m pip list python -m pip install --upgrade pip setuptools wheel python -m pip install -e . - python -m pip list - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH - pytest --cov-report term-missing:skip-covered scripts/tests/test_tractogram_filter_by_anatomy.py - sleep infinity + pytest --cov-report term-missing:skip-covered - name: Upload test reports and coverage to artifacts uses: echapmanFromBunnings/upload-artifact@3.0.0 From 8745547a2ad6bca002ad866e135cbce5c7abc4a1 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 11:14:08 -0500 Subject: [PATCH 42/53] codecov fix --- .github/workflows/test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 390f92110..e9c0b8392 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,6 +62,8 @@ jobs: uses: codecov/codecov-action@v4.0.0 with: token: ${{ secrets.CODECOV_TOKEN }} - file: .test_reports/coverage.xml + directory: .test_reports/ + file: ./coverage.xml flags: unittests fail_ci_if_error: true + verbose: true From dcbc09434ef5ef688cf72c9010dc0522542bb889 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 11:19:07 -0500 Subject: [PATCH 43/53] update deprecated workflow components --- .github/workflows/test.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9c0b8392..f2393b62c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: - name: Fetch python version from repository id: python-selector - run: echo ::set-output name=python-version::$(cat .python-version) + run: echo "python-version=$(cat .python-version)" >> $GITHUB_OUTPUT - name: Set up Python for Scilpy uses: actions/setup-python@v5.0.0 @@ -32,7 +32,6 @@ jobs: - name: Install non-python dependencies run: | - sudo apt-get update sudo apt-get install -y \ build-essential \ @@ -52,7 +51,7 @@ jobs: pytest --cov-report term-missing:skip-covered - name: Upload test reports and coverage to artifacts - uses: echapmanFromBunnings/upload-artifact@3.0.0 + uses: actions/upload-artifact@v4.3.1 with: name: test-reports path: | From 9031dfcca9952963f6b960bfd711ecf9ed9a7af9 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 13:18:52 -0500 Subject: [PATCH 44/53] fix ownership --- .github/workflows/test.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2393b62c..2045e0da3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,15 +48,9 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH + git config --global --add safe.directory "$GITHUB_WORKSPACE" pytest --cov-report term-missing:skip-covered - - name: Upload test reports and coverage to artifacts - uses: actions/upload-artifact@v4.3.1 - with: - name: test-reports - path: | - .test_reports/* - - name: Upload coverage to codecov uses: codecov/codecov-action@v4.0.0 with: @@ -66,3 +60,10 @@ jobs: flags: unittests fail_ci_if_error: true verbose: true + + - name: Upload test reports and coverage to artifacts + uses: actions/upload-artifact@v4.3.1 + with: + name: test-reports + path: | + .test_reports/* From 6aaab8c89c3b9be15598335b6466343071ac0be6 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 14:33:37 -0500 Subject: [PATCH 45/53] bump codecov-action --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2045e0da3..116c731f7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,7 +52,7 @@ jobs: pytest --cov-report term-missing:skip-covered - name: Upload coverage to codecov - uses: codecov/codecov-action@v4.0.0 + uses: codecov/codecov-action@v4.0.1 with: token: ${{ secrets.CODECOV_TOKEN }} directory: .test_reports/ From 865e562c4c4075d0adb908790ff79b76200da3b4 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 16:17:40 -0500 Subject: [PATCH 46/53] use codecov-cli instead of action until its working --- .github/workflows/test.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 116c731f7..8e1f418c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: push: branches: - master - pull_request: + pull_request_target: branches: - master workflow_dispatch: @@ -52,14 +52,21 @@ jobs: pytest --cov-report term-missing:skip-covered - name: Upload coverage to codecov - uses: codecov/codecov-action@v4.0.1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: .test_reports/ - file: ./coverage.xml - flags: unittests - fail_ci_if_error: true - verbose: true + run: | + curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://cli.codecov.io/latest/linux/codecov + curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + + shasum -a 256 -c codecov.SHA256SUM + chmod +x codecov + ./codecov --verbose upload-process \ + --fail-on-error \ + -t ${{ secrets.CODECOV_TOKEN }} \ + -n 'scilpy-unittests'-${{ github.run_id }} \ + -F scilpy-unittests -f .test_reports/coverage.xml + - name: Upload test reports and coverage to artifacts uses: actions/upload-artifact@v4.3.1 From cd5d9d3d818aef19a8f11f0fea99e045c445c1a6 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 17:04:40 -0500 Subject: [PATCH 47/53] add curl --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e1f418c2..14c892159 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,7 @@ jobs: sudo apt-get update sudo apt-get install -y \ build-essential \ + curl \ git \ libblas-dev \ liblapack-dev \ From cb9380101e63b3022bdbf7ddf48354fe7405b38f Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 19:45:49 -0500 Subject: [PATCH 48/53] add service --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14c892159..d3bcb872e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,6 +64,7 @@ jobs: chmod +x codecov ./codecov --verbose upload-process \ --fail-on-error \ + --git-service github \ -t ${{ secrets.CODECOV_TOKEN }} \ -n 'scilpy-unittests'-${{ github.run_id }} \ -F scilpy-unittests -f .test_reports/coverage.xml From 7098dfb97eca1467bd9381840013ae4a0346dc03 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 22:20:23 -0500 Subject: [PATCH 49/53] back at codecov action --- .github/workflows/test.yml | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3bcb872e..2e5ce5665 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,25 +50,21 @@ jobs: run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH git config --global --add safe.directory "$GITHUB_WORKSPACE" - pytest --cov-report term-missing:skip-covered - - - name: Upload coverage to codecov - run: | - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import - curl -Os https://cli.codecov.io/latest/linux/codecov - curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM - curl -Os https://cli.codecov.io/latest/linux/codecov.SHA256SUM.sig - gpgv codecov.SHA256SUM.sig codecov.SHA256SUM - - shasum -a 256 -c codecov.SHA256SUM - chmod +x codecov - ./codecov --verbose upload-process \ - --fail-on-error \ - --git-service github \ - -t ${{ secrets.CODECOV_TOKEN }} \ - -n 'scilpy-unittests'-${{ github.run_id }} \ - -F scilpy-unittests -f .test_reports/coverage.xml + pytest --cov-report term-missing:skip-covered scripts/tests/test_bids_validate.py + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + flags: unittests + name: scilpy-unittests-${{ github.run_id }} + verbose: true + directory: .test_reports/ + plugin: pycoverage + file: ./coverage.xml + fail_ci_if_error: true + root_dir: $GITHUB_WORKSPACE/scilpy - name: Upload test reports and coverage to artifacts uses: actions/upload-artifact@v4.3.1 From b1fe1f3cfa6fe7ca94e095655f3f84e188e5b07d Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Tue, 6 Feb 2024 22:51:17 -0500 Subject: [PATCH 50/53] downgrade action --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e5ce5665..f004345ca 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,7 @@ jobs: pytest --cov-report term-missing:skip-covered scripts/tests/test_bids_validate.py - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: @@ -61,7 +61,6 @@ jobs: name: scilpy-unittests-${{ github.run_id }} verbose: true directory: .test_reports/ - plugin: pycoverage file: ./coverage.xml fail_ci_if_error: true root_dir: $GITHUB_WORKSPACE/scilpy From f4530c3a22b2e9062343f3f1ae3d4d5b352ab5b9 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Wed, 7 Feb 2024 00:54:33 -0500 Subject: [PATCH 51/53] fix --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f004345ca..b919cf600 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,9 +61,8 @@ jobs: name: scilpy-unittests-${{ github.run_id }} verbose: true directory: .test_reports/ - file: ./coverage.xml fail_ci_if_error: true - root_dir: $GITHUB_WORKSPACE/scilpy + root_dir: $GITHUB_WORKSPACE/scilpy/ - name: Upload test reports and coverage to artifacts uses: actions/upload-artifact@v4.3.1 From 6507f4ff022998d0498625c0a95df255e00edb9c Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Wed, 7 Feb 2024 01:13:53 -0500 Subject: [PATCH 52/53] production ready --- .github/workflows/build.yml | 28 ----- .github/workflows/freeze_requirements.yml | 2 +- .github/workflows/hello_world.yml | 10 -- .github/workflows/test.yml | 4 +- Jenkinsfile | 121 ---------------------- 5 files changed, 2 insertions(+), 163 deletions(-) delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/hello_world.yml delete mode 100644 Jenkinsfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index b2c3c96d9..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Build Docker with selected version - -on: - workflow_dispatch: - inputs: - scilpy_commit: - description: Scilpy commit id - required: true - -jobs: - Build_Docker: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - name: Check out repository - - name: Change scilpy version - run: sed -i '/ENV SCILPY_VERSION=/c\ENV SCILPY_VERSION=${{ github.event.inputs.scilpy_commit }}' containers/Dockerfile - - uses: mr-smithers-excellent/docker-build-push@v3.1 - name: Docker Build & Push - with: - image: scilus/scilpy - tag: dev - dockerfile: containers/Dockerfile - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/freeze_requirements.yml b/.github/workflows/freeze_requirements.yml index de49439f5..d63a55f11 100644 --- a/.github/workflows/freeze_requirements.yml +++ b/.github/workflows/freeze_requirements.yml @@ -7,7 +7,7 @@ on: jobs: freeze_requirements: - runs-on: ubuntu-latest + runs-on: scilus-runners steps: - name: Checkout scilpy diff --git a/.github/workflows/hello_world.yml b/.github/workflows/hello_world.yml deleted file mode 100644 index c540c0f5f..000000000 --- a/.github/workflows/hello_world.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Actions Runner Controller Demo -on: - workflow_dispatch: - -jobs: - Explore-GitHub-Actions: - # You need to use the INSTALLATION_NAME from the previous step - runs-on: scilus-runners - steps: - - run: echo "🎉 This job uses runner scale set runners!" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b919cf600..4bca3eb92 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,6 @@ on: pull_request_target: branches: - master - workflow_dispatch: env: MPLBACKEND: agg @@ -49,8 +48,7 @@ jobs: - name: Run tests run: | export C_INCLUDE_PATH=$pythonLocation/include/python${{ steps.python-selector.outputs.python-version }}:$C_INCLUDE_PATH - git config --global --add safe.directory "$GITHUB_WORKSPACE" - pytest --cov-report term-missing:skip-covered scripts/tests/test_bids_validate.py + pytest --cov-report term-missing:skip-covered - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index d13a0e7ef..000000000 --- a/Jenkinsfile +++ /dev/null @@ -1,121 +0,0 @@ -pipeline { - options { - disableConcurrentBuilds(abortPrevious: true) - throttleJobProperty(categories: ['ci_all_builds'], - throttleEnabled: true, - throttleOption: 'category') - } - - agent any - - stages { - stage('Build') { - stages { - stage('Python3.10') { - steps { - withPythonEnv('CPython-3.10') { - sh ''' - pip3 install wheel==0.38.* - pip3 install numpy==1.23.* - pip3 install Cython==0.29.* - pip3 install packaging==23.* - pip3 install -e . - ''' - } - - } - } - } - } - - stage('Test') { - environment { - CODECOV_TOKEN = credentials('scilpy-codecov-token') - CODECOV_GIT_COMMIT = """${sh( - returnStdout: true, - script: 'git rev-parse $GIT_BRANCH' - ).trim()}""" - CODECOV_PARENT_COMMIT = """${sh( - returnStdout: true, - script: 'git merge-base origin/master $GIT_BRANCH' - ).trim()}""" - } - steps { - withPythonEnv('CPython-3.10') { - sh ''' - pip3 install pytest-cov pytest-html - pip3 install wheel==0.38.* - pip3 install numpy==1.23.* - pip3 install packaging==23.* - pip3 install -e . - export MPLBACKEND="agg" - export OPENBLAS_NUM_THREADS=1 - pytest --cov-report term-missing:skip-covered - ''' - } - discoverGitReferenceBuild() - sh ''' - curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --import # One-time step - curl -Os https://uploader.codecov.io/latest/linux/codecov - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM - curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig - - gpg --verify codecov.SHA256SUM.sig codecov.SHA256SUM - shasum -a 256 -c codecov.SHA256SUM - - chmod +x codecov - ./codecov -v -t ${CODECOV_TOKEN} \ - -f .test_reports/coverage.xml \ - -C ${CODECOV_GIT_COMMIT} \ - -N ${CODECOV_PARENT_COMMIT} - ''' - } - } - - stage('Deploy') { - when { - branch 'master' - } - steps { - echo 'Deploying.' - } - } - } - post { - always { - script { - if (env.CHANGE_ID) { - if (pullRequest.createdBy != "arnaudbore"){ - pullRequest.createReviewRequests(['arnaudbore']) - } - else{ - pullRequest.createReviewRequests(['frheault']) - } - } - xunit( - checksName: '', - tools: [JUnit(excludesPattern: '', failIfNotNew: false, - pattern: '**/.test_reports/junit.xml', - skipNoTestFiles: true, - stopProcessingIfError: true)] - ) - } - } - failure { - script { - // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable - if (env.CHANGE_ID) { - pullRequest.comment('Build Failed :boom: \n' + env.BUILD_URL) - } - } - } - success { - script { - // CHANGE_ID is set only for pull requests, so it is safe to access the pullRequest global variable - if (env.CHANGE_ID) { - pullRequest.comment('Build passed ! Good Job :beers: !') - } - } - } - } -} From 697aa86cc3dc654caddd0a0c17193f1f1b3c3fd5 Mon Sep 17 00:00:00 2001 From: AlexVCaron Date: Wed, 7 Feb 2024 14:24:52 -0500 Subject: [PATCH 53/53] cancel previous concurrent build --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4bca3eb92..ea2a4d5df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,10 @@ on: branches: - master +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + env: MPLBACKEND: agg OPENBLAS_NUM_THREADS: 1