From a52bb0d4522ad8929a35d31092c093c383c60e90 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 18:17:48 -0400 Subject: [PATCH 01/24] I-252 Add qtpy and remove musr2py from conda_requirements * qtpy is required by qdarkstyle * musr2py is not on an anaconda channel --- conda_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_requirements.txt b/conda_requirements.txt index f684ee7..671c1b5 100644 --- a/conda_requirements.txt +++ b/conda_requirements.txt @@ -1,4 +1,5 @@ pyqt +qtpy requests numpy sympy @@ -10,5 +11,4 @@ h5py sentry-sdk pyinstaller pytest -musr2py regex \ No newline at end of file From 0ed2b187175e2ba2610ab61ae67ca5ed3f3e914e Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 18:18:11 -0400 Subject: [PATCH 02/24] I-252 Update readme with new conda instructions --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f28806..3c45ff0 100644 --- a/README.md +++ b/README.md @@ -53,17 +53,18 @@ #### Without Anaconda - Run the following command to install the package requirements for BEAMS (note that you may need to use `python3` instead of `python`, you can use `python --version` to make sure it is referencing the correct version) ```shell -$ python -m pip install -r python_requirements.txt +python -m pip install -r python_requirements.txt ``` #### Anaconda - Run the following command in the anaconda prompt to install requirements. ```shell -$ conda install -c anaconda -c conda-forge --file conda_requirements.txt +conda install -c anaconda -c conda-forge --file conda_requirements.txt +python -m pip install musr2py ``` Start BEAMS for either, once you have navigated to the directory with the following ```shell -$ python beams +python beams ``` ## User Guide From b6fba0c21e2d772576ca6b0d8fe94c0324936697 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 18:23:55 -0400 Subject: [PATCH 03/24] I-252 Update the test workflow to run on all three systems under every supported version of python --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a06de9..c46e1d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,13 +10,17 @@ on: jobs: build: - runs-on: windows-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] + python-version: [ 3.6, 3.7, 3.8, 3.9, 3.10 ] steps: - uses: actions/checkout@v2 - - name: Install Python 3 - uses: actions/setup-python@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip From 4ce89ca94bbf4557787d6add390933e5fd374ff4 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 18:27:40 -0400 Subject: [PATCH 04/24] I-252 Change python versions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c46e1d8..3d5790d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ windows-latest, macos-latest, ubuntu-latest ] - python-version: [ 3.6, 3.7, 3.8, 3.9, 3.10 ] + python-version: [ '3.8', '3.9', '3.10' ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From 75995d8e420132451523b1964a3ca308924b7c55 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 18:29:15 -0400 Subject: [PATCH 05/24] I-252 Update python requirements --- python_requirements.txt | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/python_requirements.txt b/python_requirements.txt index c42a10e..e58d72a 100644 --- a/python_requirements.txt +++ b/python_requirements.txt @@ -1,14 +1,14 @@ -pyqt5==5.15.4 -requests==2.25.1 -numpy==1.22.0 -sympy==1.8 -scipy==1.6.3 -matplotlib==3.4.2 -pytest==6.2.5 -qdarkstyle==3.1 -darkdetect==0.5.1 -h5py==3.6.0 -sentry-sdk==1.5.4 -pyinstaller==4.9 -musr2py==0.0.1 +pyqt +requests +numpy +sympy +scipy +matplotlib +pytest +qdarkstyle +darkdetect +h5py +sentry-sdk +pyinstaller +musr2py regex \ No newline at end of file From eb212cee3ee80a1fdbfe182b097047f7093f0287 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 18:32:34 -0400 Subject: [PATCH 06/24] I-252 Accidentally removed the 5 on pyqt5 --- .github/workflows/ci.yml | 2 +- python_requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d5790d..30bafea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ windows-latest, macos-latest, ubuntu-latest ] - python-version: [ '3.8', '3.9', '3.10' ] + python-version: [ '3.10' ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/python_requirements.txt b/python_requirements.txt index e58d72a..619b818 100644 --- a/python_requirements.txt +++ b/python_requirements.txt @@ -1,4 +1,4 @@ -pyqt +pyqt5 requests numpy sympy From 3428e237e7dcecefd4638ccb8e4fd470e14747fc Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 20:52:51 -0400 Subject: [PATCH 07/24] I-252 Fix broken tests --- beams/app/resources/resources.py | 29 ++++++++++++++++++----------- beams/test/test_files.py | 4 ++-- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/beams/app/resources/resources.py b/beams/app/resources/resources.py index 76f7593..eb1e823 100644 --- a/beams/app/resources/resources.py +++ b/beams/app/resources/resources.py @@ -24,7 +24,14 @@ def resource_path(relative_path, creating=False) -> str: if not creating and not os.path.exists(path): path = os.path.join(os.getcwd(), "beams", relative_path) - return str(Path(path)) + if not os.path.exists(path) and os.getcwd().endswith("test"): + path = os.path.join(os.getcwd().removesuffix("test"), relative_path) + + final_path = str(Path(path)) + if not creating and not os.path.exists(final_path): + raise Exception(f"Could not create a valid resource path for {relative_path} (final was {final_path})") + + return final_path # Using Path from pathlib is an easy way to fix the slash direction issue when switch between windows and unix systems. @@ -48,16 +55,16 @@ def resource_path(relative_path, creating=False) -> str: LIGHT_LOADING_GIF = resource_path('app/resources/icons/light_loading.gif') DARK_LOADING_GIF = resource_path('app/resources/icons/dark_loading.gif') -LATO_BLACK_FONT = resource_path('app/resources/fonts/fonts-Black.ttf') -LATO_BLACK_ITALIC_FONT = resource_path('app/resources/fonts/fonts-BlackItalic.ttf') -LATO_BOLD_FONT = resource_path('app/resources/fonts/fonts-Bold.ttf') -LATO_BOLD_ITALIC_FONT = resource_path('app/resources/fonts/fonts-BoldItalic.ttf') -LATO_ITALIC_FONT = resource_path('app/resources/fonts/fonts-Italic.ttf') -LATO_LIGHT_FONT = resource_path('app/resources/fonts/fonts-Light.ttf') -LATO_LIGHT_ITALIC_FONT = resource_path('app/resources/fonts/fonts-LightItalic.ttf') -LATO_REGULAR_FONT = resource_path('app/resources/fonts/fonts-Regular.ttf') -LATO_THIN_FONT = resource_path('app/resources/fonts/fonts-Thin.ttf') -LATO_THIN_ITALIC_FONT = resource_path('app/resources/fonts/fonts-ThinItalic.ttf') +LATO_BLACK_FONT = resource_path('app/resources/fonts/Lato-Black.ttf') +LATO_BLACK_ITALIC_FONT = resource_path('app/resources/fonts/Lato-BlackItalic.ttf') +LATO_BOLD_FONT = resource_path('app/resources/fonts/Lato-Bold.ttf') +LATO_BOLD_ITALIC_FONT = resource_path('app/resources/fonts/Lato-BoldItalic.ttf') +LATO_ITALIC_FONT = resource_path('app/resources/fonts/Lato-Italic.ttf') +LATO_LIGHT_FONT = resource_path('app/resources/fonts/Lato-Light.ttf') +LATO_LIGHT_ITALIC_FONT = resource_path('app/resources/fonts/Lato-LightItalic.ttf') +LATO_REGULAR_FONT = resource_path('app/resources/fonts/Lato-Regular.ttf') +LATO_THIN_FONT = resource_path('app/resources/fonts/Lato-Thin.ttf') +LATO_THIN_ITALIC_FONT = resource_path('app/resources/fonts/Lato-ThinItalic.ttf') TRIUMF_LINUX_CONVERSION = resource_path('app/resources/binaries/TRIUMF_LINUX') TRIUMF_MAC_CONVERSION = resource_path('app/resources/binaries/TRIUMF_MAC') diff --git a/beams/test/test_files.py b/beams/test/test_files.py index 543378e..a9d0599 100644 --- a/beams/test/test_files.py +++ b/beams/test/test_files.py @@ -114,7 +114,7 @@ def test_convert_on_good_file(self, filename, out_file, expected_out_file): @pytest.mark.skipif(SKIP_EXECUTABLE_TESTS, reason=SKIP_REASON) def test_convert_on_bad_file(self): - msr_file = files.TRIUMFMuonFile(resources.resource_path(r"test/examples/psi_convert_test_1.mdu")) + msr_file = files.TRIUMFMuonFile(resources.resource_path(r"test/examples/psi_convert_test_mdu_1.mdu")) with pytest.raises(files.BeamsFileConversionError): msr_file.convert(r"_triumf_convert_test_2.dat") @@ -238,7 +238,7 @@ def test_convert_on_good_file_with_format(self, filename, starts, ends, names, o def test_convert_on_bad_file(self): msr_file = files.ISISMuonFile(resources.resource_path(r"test/examples/triumf_convert_test_1.msr")) with pytest.raises(files.BeamsFileConversionError): - msr_file.convert(resources.resource_path(r"_triumf_convert_test_2.dat")) + msr_file.convert(r"_triumf_convert_test_1.dat") @pytest.mark.parametrize("filename, histograms", [ From 2c3905599fd47a587cddb18fc80d46a8094c6b96 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 21:49:25 -0400 Subject: [PATCH 08/24] I-254 Skip psi files for mac --- beams/test/test_files.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/beams/test/test_files.py b/beams/test/test_files.py index a9d0599..8fc5c08 100644 --- a/beams/test/test_files.py +++ b/beams/test/test_files.py @@ -1,5 +1,6 @@ import pytest import os +import sys import numpy as np @@ -119,6 +120,7 @@ def test_convert_on_bad_file(self): msr_file.convert(r"_triumf_convert_test_2.dat") +@pytest.mark.skipif(sys.platform == 'darwin') class TestPsiMuonFile: @pytest.mark.parametrize("filename, out_file, expected_out_file", [ From 397196ad04471b649120a88c59d8851da61e7d2c Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 21:53:27 -0400 Subject: [PATCH 09/24] I-254 Skip psi files for mac --- beams/test/test_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beams/test/test_files.py b/beams/test/test_files.py index 8fc5c08..4a1ec7d 100644 --- a/beams/test/test_files.py +++ b/beams/test/test_files.py @@ -120,7 +120,7 @@ def test_convert_on_bad_file(self): msr_file.convert(r"_triumf_convert_test_2.dat") -@pytest.mark.skipif(sys.platform == 'darwin') +@pytest.mark.skipif(sys.platform == 'darwin', reason="PSI file conversion is failing on mac due to a dependency") class TestPsiMuonFile: @pytest.mark.parametrize("filename, out_file, expected_out_file", [ From 62403b674bd4bf86256d31ebe21cb06b8f14ce92 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 21:59:11 -0400 Subject: [PATCH 10/24] I-254 Add additional python versions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30bafea..294a70a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: os: [ windows-latest, macos-latest, ubuntu-latest ] - python-version: [ '3.10' ] + python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} From c502855964eab899ab224ed4d9349f53a2053683 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:20:43 -0400 Subject: [PATCH 11/24] I-254 Add job for anaconda --- .github/workflows/ci.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 294a70a..b1c60cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,12 +9,12 @@ on: - Issue jobs: - build: + build-and-test-python: runs-on: ${{ matrix.os }} strategy: matrix: os: [ windows-latest, macos-latest, ubuntu-latest ] - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] + python-version: [ '3.11' ] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -25,5 +25,27 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -r python_requirements.txt - - name: Run tests with pytest + - name: Run tests + run: cd beams && pytest -ra + + build-and-test-anaconda: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] + python-version: [ '3.11' ] + steps: + - uses: actions/checkout@v2 + - name: Set up Anaconda with Python ${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + activate-environment: true + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + conda install -c anaconda -c conda-forge --file conda_requirements.txt + python -m pip install musr2py + - name: Run tests with PyTest run: cd beams && pytest -ra From be5d1750e3682a2b1a442d2116a3d7c018a996c1 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:25:42 -0400 Subject: [PATCH 12/24] I-254 Possibly fix anaconda pytest --- .github/workflows/ci.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1c60cb..bc6e11c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,30 +9,30 @@ on: - Issue jobs: - build-and-test-python: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ windows-latest, macos-latest, ubuntu-latest ] - python-version: [ '3.11' ] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r python_requirements.txt - - name: Run tests - run: cd beams && pytest -ra +# build-and-test-python: +# runs-on: ${{ matrix.os }} +# strategy: +# matrix: +# os: [ windows-latest, macos-latest, ubuntu-latest ] +# python-version: [ '3.11' ] +# steps: +# - uses: actions/checkout@v2 +# - name: Set up Python ${{ matrix.python-version }} +# uses: actions/setup-python@v2 +# with: +# python-version: ${{ matrix.python-version }} +# - name: Install dependencies +# run: | +# python -m pip install --upgrade pip +# python -m pip install -r python_requirements.txt +# - name: Run tests +# run: cd beams && pytest -ra build-and-test-anaconda: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-latest, macos-latest, ubuntu-latest ] + os: [ ubuntu-latest ] python-version: [ '3.11' ] steps: - uses: actions/checkout@v2 @@ -48,4 +48,4 @@ jobs: conda install -c anaconda -c conda-forge --file conda_requirements.txt python -m pip install musr2py - name: Run tests with PyTest - run: cd beams && pytest -ra + run: cd beams && python -m pytest -ra From 0c178dd3dd89da71c315f4ff478c143bd3fd4ae5 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:42:06 -0400 Subject: [PATCH 13/24] I-254 Manually set up test environment --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc6e11c..2f16ad0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,11 +40,14 @@ jobs: uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true - activate-environment: true python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Setup environment run: | + conda create -n test-env + conda activate test-env python -m pip install --upgrade pip + - name: Install dependencies + run: | conda install -c anaconda -c conda-forge --file conda_requirements.txt python -m pip install musr2py - name: Run tests with PyTest From 58350ed6e55daeb47ae4a7b49112d1be0aeff4db Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:44:20 -0400 Subject: [PATCH 14/24] I-254 Manually set up test environment --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f16ad0..67c0a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,8 +43,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Setup environment run: | - conda create -n test-env - conda activate test-env + conda activate test python -m pip install --upgrade pip - name: Install dependencies run: | From d73e41f7dc5e25212be123ce76bf82894d338efd Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:47:12 -0400 Subject: [PATCH 15/24] I-254 Manually set up test environment --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67c0a0e..b86d31b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,11 @@ jobs: with: auto-update-conda: true python-version: ${{ matrix.python-version }} + - name: Determine shell type + run: echo $SHELL + id: determine_shell + - name: Initialize conda + run: conda init ${{ steps.determine_shell.outputs.stdout }} - name: Setup environment run: | conda activate test From 1bbc535872aa9fcb5cc007f377271913a4ff5ad8 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:49:42 -0400 Subject: [PATCH 16/24] I-254 Manually set up test environment --- .github/workflows/ci.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b86d31b..972abf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,18 +40,11 @@ jobs: uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true + activate-environment: test python-version: ${{ matrix.python-version }} - - name: Determine shell type - run: echo $SHELL - id: determine_shell - - name: Initialize conda - run: conda init ${{ steps.determine_shell.outputs.stdout }} - - name: Setup environment - run: | - conda activate test - python -m pip install --upgrade pip - name: Install dependencies run: | + python -m pip install --upgrade pip conda install -c anaconda -c conda-forge --file conda_requirements.txt python -m pip install musr2py - name: Run tests with PyTest From c5dc37191b8009a3a74f1334fd129406369cc986 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:53:37 -0400 Subject: [PATCH 17/24] I-254 Manually set up test environment --- .github/workflows/ci.yml | 1 + conda_requirements.txt | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 972abf3..33b8f75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,6 +46,7 @@ jobs: run: | python -m pip install --upgrade pip conda install -c anaconda -c conda-forge --file conda_requirements.txt + conda install -c conda-forge pytest python -m pip install musr2py - name: Run tests with PyTest run: cd beams && python -m pytest -ra diff --git a/conda_requirements.txt b/conda_requirements.txt index 671c1b5..983a5da 100644 --- a/conda_requirements.txt +++ b/conda_requirements.txt @@ -10,5 +10,4 @@ darkdetect h5py sentry-sdk pyinstaller -pytest regex \ No newline at end of file From 8105e7c8df0a41f51f39debf9dfb067cb90daa04 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 22:57:23 -0400 Subject: [PATCH 18/24] I-254 i hate conda --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33b8f75..70e3d13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,4 +49,6 @@ jobs: conda install -c conda-forge pytest python -m pip install musr2py - name: Run tests with PyTest - run: cd beams && python -m pytest -ra + run: | + cd beams + pytest -ra From 7e1b337f24c92cea8d653684656654c6a73ba676 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 23:04:31 -0400 Subject: [PATCH 19/24] I-254 i hate conda --- .github/workflows/ci.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70e3d13..4b998d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,10 +44,18 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - conda install -c anaconda -c conda-forge --file conda_requirements.txt +# python -m pip install --upgrade pip +# conda install -c anaconda -c conda-forge --file conda_requirements.txt conda install -c conda-forge pytest - python -m pip install musr2py +# python -m pip install musr2py + - name: Check conda version + run: conda --version + + - name: Check conda prefix + run: echo $CONDA_PREFIX + - name: List conda environment bin directory + run: ls $CONDA_PREFIX/bin + - name: Run tests with PyTest run: | cd beams From 899c94f84a9538a94f02440a4c70d19defeed506 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 23:05:26 -0400 Subject: [PATCH 20/24] I-254 i hate hate conda --- .github/workflows/ci.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b998d5..a2e7275 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,18 +44,16 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | -# python -m pip install --upgrade pip -# conda install -c anaconda -c conda-forge --file conda_requirements.txt conda install -c conda-forge pytest -# python -m pip install musr2py - name: Check conda version - run: conda --version - + run: | + conda --version - name: Check conda prefix - run: echo $CONDA_PREFIX + run: | + echo $CONDA_PREFIX - name: List conda environment bin directory - run: ls $CONDA_PREFIX/bin - + run: | + ls $CONDA_PREFIX/bin - name: Run tests with PyTest run: | cd beams From e2293182f3c5f791efdc75c2310f1d335f9e97a4 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 23:09:15 -0400 Subject: [PATCH 21/24] I-254 i hate hate conda --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2e7275..5cb22ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,18 +43,23 @@ jobs: activate-environment: test python-version: ${{ matrix.python-version }} - name: Install dependencies + shell: bash -el {0} run: | conda install -c conda-forge pytest - name: Check conda version + shell: bash -el {0} run: | conda --version - name: Check conda prefix + shell: bash -el {0} run: | echo $CONDA_PREFIX - name: List conda environment bin directory + shell: bash -el {0} run: | ls $CONDA_PREFIX/bin - name: Run tests with PyTest + shell: bash -el {0} run: | cd beams pytest -ra From a289929cde15e25e6806f890a9d268671188b6fe Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 23:12:02 -0400 Subject: [PATCH 22/24] I-254 i hate hate conda less --- .github/workflows/ci.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cb22ef..2d7c79f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest ] + os: [ windows-latest, macos-latest, ubuntu-latest ] python-version: [ '3.11' ] steps: - uses: actions/checkout@v2 @@ -45,19 +45,10 @@ jobs: - name: Install dependencies shell: bash -el {0} run: | + python -m pip install --upgrade pip + conda install -c anaconda -c conda-forge --file conda_requirements.txt conda install -c conda-forge pytest - - name: Check conda version - shell: bash -el {0} - run: | - conda --version - - name: Check conda prefix - shell: bash -el {0} - run: | - echo $CONDA_PREFIX - - name: List conda environment bin directory - shell: bash -el {0} - run: | - ls $CONDA_PREFIX/bin + python -m pip install musr2py - name: Run tests with PyTest shell: bash -el {0} run: | From d8cb09e575dcebdc09c251974d87f225db046c7c Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 23:21:20 -0400 Subject: [PATCH 23/24] I-254 Separate the workflows so the full action only runs when merging to master --- .github/workflows/ci.yml | 41 +++++++++++++-------------- .github/workflows/ci_main.yml | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/ci_main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d7c79f..0a91996 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,38 +1,35 @@ name: Tests on: - push: - branches: - - master pull_request: branches: - master - Issue jobs: -# build-and-test-python: -# runs-on: ${{ matrix.os }} -# strategy: -# matrix: -# os: [ windows-latest, macos-latest, ubuntu-latest ] -# python-version: [ '3.11' ] -# steps: -# - uses: actions/checkout@v2 -# - name: Set up Python ${{ matrix.python-version }} -# uses: actions/setup-python@v2 -# with: -# python-version: ${{ matrix.python-version }} -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# python -m pip install -r python_requirements.txt -# - name: Run tests -# run: cd beams && pytest -ra + build-and-test-python: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest ] + python-version: [ '3.11' ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r python_requirements.txt + - name: Run tests + run: cd beams && pytest -ra build-and-test-anaconda: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-latest, macos-latest, ubuntu-latest ] + os: [ ubuntu-latest ] python-version: [ '3.11' ] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/ci_main.yml b/.github/workflows/ci_main.yml new file mode 100644 index 0000000..98e13be --- /dev/null +++ b/.github/workflows/ci_main.yml @@ -0,0 +1,52 @@ +name: Tests +on: + push: + branches: + - master + +jobs: + build-and-test-python: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] + python-version: [ '3.11' ] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r python_requirements.txt + - name: Run tests + run: cd beams && pytest -ra + + build-and-test-anaconda: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] + python-version: [ '3.11' ] + steps: + - uses: actions/checkout@v2 + - name: Set up Anaconda with Python ${{ matrix.python-version }} + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + activate-environment: test + python-version: ${{ matrix.python-version }} + - name: Install dependencies + shell: bash -el {0} + run: | + python -m pip install --upgrade pip + conda install -c anaconda -c conda-forge --file conda_requirements.txt + conda install -c conda-forge pytest + python -m pip install musr2py + - name: Run tests with PyTest + shell: bash -el {0} + run: | + cd beams + pytest -ra \ No newline at end of file From eb2b420e7302cd5c7f0a97dc21c5bf70f63b7b85 Mon Sep 17 00:00:00 2001 From: Alec Petersen Date: Thu, 30 Mar 2023 23:22:25 -0400 Subject: [PATCH 24/24] I-254 Update the readme to point to correct action --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c45ff0..3460e3d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ![beams logo](beams/app/resources/icons/logo.png) [![Release](https://img.shields.io/github/release/FrandsenGroup/beams.svg?style=plastic&colorB=68B7EB)](https://github.com/FrandsenGroup/beams/releases) -[![Tests](https://github.com/FrandsenGroup/beams/actions/workflows/ci.yml/badge.svg)](https://github.com/FrandsenGroup/beams/actions/workflows/ci.yml) +[![Tests](https://github.com/FrandsenGroup/beams/actions/workflows/ci.yml/badge.svg)](https://github.com/FrandsenGroup/beams/actions/workflows/ci_main.yml) [![Build](https://github.com/FrandsenGroup/beams/actions/workflows/build.yml/badge.svg)](https://github.com/FrandsenGroup/beams/actions/workflows/build.yml) [![CodeQL](https://github.com/FrandsenGroup/beams/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/FrandsenGroup/beams/actions/workflows/codeql-analysis.yml)