diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a1e0da..864c1c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,10 @@ jobs: fail-fast: false matrix: python-version: ['3.12'] - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] + # Windows runners can take way too long to be available + # and the setup-conda action isn't compatible with macOS and python 3.12 + # os: [ubuntu-latest, windows-latest, macos-latest] include: - python-version: '3.11' os: ubuntu-latest @@ -85,17 +88,9 @@ jobs: - name: Install Dependencies run: pip install black - # test_align.py includes tests that have weird formatting because we want to be able to line - # up the expected and actual alignments in the test output. I've found it's really easy to - # run 'black .' and forget about it, so I'm including this check to make sure it FAILS the - # formatting check. If this trips you up, probably just revert the changes to that file. - name: Lint Code Base run: | - black --check --exclude="test_align.py" . - - if black --check --include="test_align.py" . ; then - exit 1 - fi + black --check . codacy-analysis-cli: name: Codacy Analysis CLI diff --git a/reformat.sh b/reformat.sh deleted file mode 100644 index a8b53d7..0000000 --- a/reformat.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -black --exclude="test_align.py" . \ No newline at end of file diff --git a/tests/unit/test_align.py b/tests/unit/test_align.py index b16446c..3f90154 100644 --- a/tests/unit/test_align.py +++ b/tests/unit/test_align.py @@ -19,43 +19,55 @@ def test_no_endgaps(self): self.assertEqual(align_semiglobal(qseq, sseq), (qseq, sseq)) def test_endgaps_both_sides_query(self): + # fmt: off qseq = "GATGAACGCTAGCTTCAGGCTTAAC" sseq = "CTCAGGATGAACGCTAGCTACAGGCTTAACACATGCAAGT" + # fmt: on aligned_qseq, aligned_sseq = align_semiglobal(qseq, sseq) self.assertEqual(aligned_qseq, "-----" + qseq + "----------") self.assertEqual(aligned_sseq, sseq) def test_endgaps_left_query(self): + # fmt: off qseq = "GATGAACGCTAGCTTCAGGCTTAAC" sseq = "CTCAGGATGAACGCTAGCTACAGGCTTAAC" + # fmt: on aligned_qseq, aligned_sseq = align_semiglobal(qseq, sseq) self.assertEqual(aligned_qseq, "-----" + qseq) self.assertEqual(aligned_sseq, sseq) def test_endgaps_right_query(self): + # fmt: off qseq = "GATGAACGCTAGCTTCAGGCTTAAC" sseq = "GATGAACGCTAGCTACAGGCTTAACACATGCAAGT" + # fmt: on aligned_qseq, aligned_sseq = align_semiglobal(qseq, sseq) self.assertEqual(aligned_qseq, qseq + "----------") self.assertEqual(aligned_sseq, sseq) def test_ragged_left_subject(self): + # fmt: off qseq = "CTCAGGATGAACGCTAGCTACAGGCTTAAC" sseq = "GATGAACGCTAGCTTCAGGCTTAACACATG" + # fmt: on aligned_qseq, aligned_sseq = align_semiglobal(qseq, sseq) self.assertEqual(aligned_qseq, qseq + "-----") self.assertEqual(aligned_sseq, "-----" + sseq) def test_ragged_right_subject(self): + # fmt: off qseq = "GATGAACGCTAGCTACAGGCTTAACACATG" sseq = "CTCAGGATGAACGCTAGCTTCAGGCTTAAC" + # fmt: on aligned_qseq, aligned_sseq = align_semiglobal(qseq, sseq) self.assertEqual(aligned_qseq, "-----" + qseq) self.assertEqual(aligned_sseq, sseq + "-----") def test_funky_query_left(self): + # fmt: off qseq = "TTTTGATGAACGCTAGCTACAGGCTTA" sseq = "CTCAGGATGAACGCTAGCTTCAGGCTTAAC" + # fmt: on aligned_qseq, aligned_sseq = align_semiglobal(qseq, sseq) self.assertEqual(aligned_qseq, "-" + qseq + "--") self.assertEqual(aligned_sseq, sseq)