From f3665f6b5336b0c3db390c7c1146354d0b9f2694 Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 20:12:07 +0100 Subject: [PATCH 01/11] Update tests.yml --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3fbfdda55..2221a85d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -106,7 +106,7 @@ jobs: shell: bash -l {0} - name: Set up R - uses: r-lib/actions/setup-r@v1 + uses: r-lib/actions/setup-r@v2 with: r-version: ${{ steps.R.outputs.version}} @@ -153,6 +153,7 @@ jobs: remotes::install_cran("BiocManager") BiocManager::install(version = ${{ steps.R.outputs.biocversion}}, ask = FALSE) BiocManager::install(c('Biostrings', 'GenomicAlignments', 'IRanges')) + install.packages('matrixStats') install.packages(c('shazam', 'alakazam', 'tigger', 'airr', 'optparse')) shell: Rscript {0} From b66ef695dab4a4cfe7cc6d54a419e854d879cec5 Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 21:56:21 +0100 Subject: [PATCH 02/11] Update tests.yml does this work? --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2221a85d1..cbd56c0b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,8 +25,8 @@ jobs: - { python-version: 3.7, os: ubuntu-latest } - { python-version: 3.8, os: ubuntu-latest } - { python-version: 3.9, os: ubuntu-latest } - - { python-version: 3.7, os: macos-latest } - - { python-version: 3.8, os: macos-latest } + - { python-version: 3.7, os: macOS-11/20220419.3 } + - { python-version: 3.8, os: macOS-11/20220419.3 } # - { python-version: 3.9, os: macos-latest } # segmentation fault due to missing py3.9 macOSX wheel https://github.com/rpy2/rpy2/issues/846 # disabled until it's fixed. runs-on: ${{ matrix.config.os }} From e829ccd04019aac5e03044b09432c53a3830bcba Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:04:51 +0100 Subject: [PATCH 03/11] Update test_preprocessing.py maybe this is the issue? --- tests/test_preprocessing.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index ea7db2dfb..acd7693ca 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -8,13 +8,12 @@ from fixtures import (fasta_10x, annotation_10x, create_testfolder, database_paths, dummy_adata, processed_files) -try: - os.environ.pop('IGDATA') - os.environ.pop('GERMLINE') - os.environ.pop('BLASTDB') -except: - pass - +if 'IGDATA' in os.environ: + del os.environ["IGDATA"] +if 'GERMLINE' in os.environ: + del os.environ["GERMLINE"] +if 'GERMLINE' in os.environ: + del os.environ["GERMLINE"] @pytest.mark.parametrize("filename,expected", [pytest.param('filtered', 1), From 610d7fc076a8337c0ce71be9fc0371872a8c0aa0 Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:04:58 +0100 Subject: [PATCH 04/11] Revert "Update tests.yml" This reverts commit b66ef695dab4a4cfe7cc6d54a419e854d879cec5. --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cbd56c0b2..2221a85d1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -25,8 +25,8 @@ jobs: - { python-version: 3.7, os: ubuntu-latest } - { python-version: 3.8, os: ubuntu-latest } - { python-version: 3.9, os: ubuntu-latest } - - { python-version: 3.7, os: macOS-11/20220419.3 } - - { python-version: 3.8, os: macOS-11/20220419.3 } + - { python-version: 3.7, os: macos-latest } + - { python-version: 3.8, os: macos-latest } # - { python-version: 3.9, os: macos-latest } # segmentation fault due to missing py3.9 macOSX wheel https://github.com/rpy2/rpy2/issues/846 # disabled until it's fixed. runs-on: ${{ matrix.config.os }} From 81d69908114e9ebaaaa034eb79ec762e3ee5bc44 Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:40:58 +0100 Subject: [PATCH 05/11] does this work? --- tests/test_preprocessing.py | 34 ++++++++++++++++++++-------------- tests/test_rpy2.py | 2 ++ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index acd7693ca..44e74fd37 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -1,5 +1,6 @@ #!/usr/bin/env python import pytest +import sys import os import pandas as pd import dandelion as ddl @@ -8,12 +9,13 @@ from fixtures import (fasta_10x, annotation_10x, create_testfolder, database_paths, dummy_adata, processed_files) -if 'IGDATA' in os.environ: - del os.environ["IGDATA"] -if 'GERMLINE' in os.environ: - del os.environ["GERMLINE"] -if 'GERMLINE' in os.environ: - del os.environ["GERMLINE"] +try: + os.environ.pop('IGDATA') + os.environ.pop('GERMLINE') + os.environ.pop('BLASTDB') +except: + pass + @pytest.mark.parametrize("filename,expected", [pytest.param('filtered', 1), @@ -64,9 +66,10 @@ def test_reannotate_fails(create_testfolder, database_paths): filename_prefix='filtered') -@pytest.mark.parametrize("filename,expected", - [pytest.param('filtered', 5), - pytest.param('all', 10)]) +@pytest.mark.parametrize( + "filename,expected", + [pytest.param('filtered', 5), + pytest.param('all', 10)]) def test_reannotategenes(create_testfolder, database_paths, filename, expected): ddl.pp.reannotate_genes(str(create_testfolder), @@ -158,11 +161,13 @@ def test_update_germlines(create_testfolder, processed_files, database_paths): assert len(vdj.germline) > 0 -@pytest.mark.parametrize( - "freq,colname,dtype", - [pytest.param(True, 'mu_freq', float), - pytest.param(False, 'mu_count', int)]) -def test_quantify_mut(create_testfolder, processed_files, freq, colname, dtype): +@pytest.mark.parametrize("freq,colname,dtype", [ + pytest.param(True, 'mu_freq', float), + pytest.param(False, 'mu_count', int) +]) +@pytest.mark.skipif(sys.platform == 'darwin') +def test_quantify_mut(create_testfolder, processed_files, freq, colname, + dtype): f = create_testfolder / str('dandelion/' + processed_files['filtered']) ddl.pp.quantify_mutations(f, frequency=freq) dat = pd.read_csv(f, sep='\t') @@ -174,6 +179,7 @@ def test_quantify_mut(create_testfolder, processed_files, freq, colname, dtype): "freq,colname", [pytest.param(True, 'mu_freq'), pytest.param(False, 'mu_count')]) +@pytest.mark.skipif(sys.platform == 'darwin') def test_quantify_mut_2(create_testfolder, processed_files, freq, colname): f = create_testfolder / str('dandelion/' + processed_files['filtered']) vdj = ddl.Dandelion(f) diff --git a/tests/test_rpy2.py b/tests/test_rpy2.py index bcc85b111..cef9df712 100644 --- a/tests/test_rpy2.py +++ b/tests/test_rpy2.py @@ -15,6 +15,7 @@ def test_importrpy2(): assert sh.__module__ == 'rpy2.robjects.packages' +@pytest.mark.skipif(sys.platform == 'darwin') def test_mutation(create_testfolder, airr_reannotated): f = create_testfolder / "test.tsv" airr_reannotated.to_csv(f, sep='\t', index=False) @@ -34,6 +35,7 @@ def test_create_germlines(create_testfolder, database_paths): assert not vdj.data.germline_alignment_d_mask.empty +@pytest.mark.skipif(sys.platform == 'darwin') def test_manual_threshold_and_define_clones(create_testfolder): f = create_testfolder / "test.tsv" out = pd.read_csv(f, sep='\t') From 1abd68371b2a2d3769bec6bda5e44c953f64b89e Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:47:57 +0100 Subject: [PATCH 06/11] oops --- tests/test_preprocessing.py | 4 ++-- tests/test_rpy2.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_preprocessing.py b/tests/test_preprocessing.py index 44e74fd37..130c71b64 100644 --- a/tests/test_preprocessing.py +++ b/tests/test_preprocessing.py @@ -165,7 +165,7 @@ def test_update_germlines(create_testfolder, processed_files, database_paths): pytest.param(True, 'mu_freq', float), pytest.param(False, 'mu_count', int) ]) -@pytest.mark.skipif(sys.platform == 'darwin') +@pytest.mark.skipif(sys.platform == 'darwin', reason="macos CI stalls.") def test_quantify_mut(create_testfolder, processed_files, freq, colname, dtype): f = create_testfolder / str('dandelion/' + processed_files['filtered']) @@ -179,7 +179,7 @@ def test_quantify_mut(create_testfolder, processed_files, freq, colname, "freq,colname", [pytest.param(True, 'mu_freq'), pytest.param(False, 'mu_count')]) -@pytest.mark.skipif(sys.platform == 'darwin') +@pytest.mark.skipif(sys.platform == 'darwin', reason="macos CI stalls.") def test_quantify_mut_2(create_testfolder, processed_files, freq, colname): f = create_testfolder / str('dandelion/' + processed_files['filtered']) vdj = ddl.Dandelion(f) diff --git a/tests/test_rpy2.py b/tests/test_rpy2.py index cef9df712..1a317d285 100644 --- a/tests/test_rpy2.py +++ b/tests/test_rpy2.py @@ -15,7 +15,7 @@ def test_importrpy2(): assert sh.__module__ == 'rpy2.robjects.packages' -@pytest.mark.skipif(sys.platform == 'darwin') +@pytest.mark.skipif(sys.platform == 'darwin', reason="macos CI stalls.") def test_mutation(create_testfolder, airr_reannotated): f = create_testfolder / "test.tsv" airr_reannotated.to_csv(f, sep='\t', index=False) @@ -35,7 +35,7 @@ def test_create_germlines(create_testfolder, database_paths): assert not vdj.data.germline_alignment_d_mask.empty -@pytest.mark.skipif(sys.platform == 'darwin') +@pytest.mark.skipif(sys.platform == 'darwin', reason="macos CI stalls.") def test_manual_threshold_and_define_clones(create_testfolder): f = create_testfolder / "test.tsv" out = pd.read_csv(f, sep='\t') From cb5116afd2a78df35f94e57bca7d515559df701e Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 22:53:38 +0100 Subject: [PATCH 07/11] Update test_rpy2.py --- tests/test_rpy2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_rpy2.py b/tests/test_rpy2.py index 1a317d285..805a4cb54 100644 --- a/tests/test_rpy2.py +++ b/tests/test_rpy2.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import pandas as pd import dandelion as ddl +import pytest from fixtures import (airr_reannotated, create_testfolder, database_paths) From 25d3cd9ef122fd5643008e96002e2ad0b54806df Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 23:06:39 +0100 Subject: [PATCH 08/11] Update test_rpy2.py --- tests/test_rpy2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_rpy2.py b/tests/test_rpy2.py index 805a4cb54..8d2a31003 100644 --- a/tests/test_rpy2.py +++ b/tests/test_rpy2.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import pandas as pd import dandelion as ddl +import sys import pytest from fixtures import (airr_reannotated, create_testfolder, database_paths) From ae81d979093834140da64275f024b5acd3b3bcce Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Thu, 21 Apr 2022 23:46:43 +0100 Subject: [PATCH 09/11] Update test_rpy2.py --- tests/test_rpy2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_rpy2.py b/tests/test_rpy2.py index 8d2a31003..7cd68ce5a 100644 --- a/tests/test_rpy2.py +++ b/tests/test_rpy2.py @@ -7,6 +7,7 @@ from fixtures import (airr_reannotated, create_testfolder, database_paths) +@pytest.mark.skipif(sys.platform == 'darwin', reason="macos CI stalls.") def test_importrpy2(): from rpy2.robjects.packages import importr From 46df801bee2917e5eef2ae26bc9c8d3a1c8f1683 Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Fri, 22 Apr 2022 06:09:56 +0100 Subject: [PATCH 10/11] Update test_rpy2.py --- tests/test_rpy2.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_rpy2.py b/tests/test_rpy2.py index 7cd68ce5a..5fe9b93cf 100644 --- a/tests/test_rpy2.py +++ b/tests/test_rpy2.py @@ -30,6 +30,7 @@ def test_mutation(create_testfolder, airr_reannotated): assert not vdj.data.mu_freq.empty +@pytest.mark.skipif(sys.platform == 'darwin', reason="macos CI stalls.") def test_create_germlines(create_testfolder, database_paths): f = create_testfolder / "test.tsv" out = pd.read_csv(f, sep='\t') From 6e53c0ddb392682a811685354d62c9a83fbc7120 Mon Sep 17 00:00:00 2001 From: Kelvin <26215587+zktuong@users.noreply.github.com> Date: Fri, 22 Apr 2022 08:52:14 +0100 Subject: [PATCH 11/11] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2221a85d1..407b739d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: - { python-version: 3.9, os: ubuntu-latest } - { python-version: 3.7, os: macos-latest } - { python-version: 3.8, os: macos-latest } - # - { python-version: 3.9, os: macos-latest } # segmentation fault due to missing py3.9 macOSX wheel https://github.com/rpy2/rpy2/issues/846 + - { python-version: 3.9, os: macos-latest } # segmentation fault due to missing py3.9 macOSX wheel https://github.com/rpy2/rpy2/issues/846 # disabled until it's fixed. runs-on: ${{ matrix.config.os }} env: