From 8dec88e04fd6b0c3e873fca4682297e8a1e0f221 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Mon, 13 May 2024 23:45:13 +0200 Subject: [PATCH 01/20] trigger action execution --- .github/workflows/sepp_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index cefe888..bf292de 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -40,7 +40,7 @@ jobs: shell: bash -el {0} run: | coverage lcov - - name: send coverage report + - name: send coverage report. uses: coverallsapp/github-action@master with: github-token: ${{ secrets.GITHUB_TOKEN }} From fce1094da118c5fd7e0e8f65a486a9547251808c Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Mon, 13 May 2024 23:48:47 +0200 Subject: [PATCH 02/20] move env file --- sepp/environment.yml => environment.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sepp/environment.yml => environment.yml (100%) diff --git a/sepp/environment.yml b/environment.yml similarity index 100% rename from sepp/environment.yml rename to environment.yml From d2314ff6c7df90123a1257b18954617cc22bab3b Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Mon, 13 May 2024 23:50:43 +0200 Subject: [PATCH 03/20] adding bioconda channel --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 2f20419..7987352 100644 --- a/environment.yml +++ b/environment.yml @@ -1,5 +1,6 @@ name: sepp channels: + - bioconda - conda-forge - defaults dependencies: From ad5dc1de3e4cf06a5f3a60c2572cbf40f88c9c8f Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Mon, 13 May 2024 23:53:40 +0200 Subject: [PATCH 04/20] enforcing py3.9 --- .github/workflows/sepp_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 622f9c0..723c5f8 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -15,6 +15,8 @@ jobs: uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v3 + with: + python-version: '3.9' - name: setup conda uses: conda-incubator/setup-miniconda@v2 with: From f64d6386d4b468402e9eca65f3740e46e2df5950 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Mon, 13 May 2024 23:55:05 +0200 Subject: [PATCH 05/20] adding setuptools --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 7987352..8e543d5 100644 --- a/environment.yml +++ b/environment.yml @@ -9,3 +9,4 @@ dependencies: - coverage >= 6 # to ensure lcov option is available - java-jdk - pep8 + - setuptools From e03daa6dd65c85ae6460d5c0466c0be4e01a6f88 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 09:04:40 +0200 Subject: [PATCH 06/20] add -w --- .github/workflows/sepp_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 723c5f8..085b2ed 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.9' + python-version: '3.9' - name: setup conda uses: conda-incubator/setup-miniconda@v2 with: @@ -37,7 +37,7 @@ jobs: - name: run python tests shell: bash -el {0} run: | - nosetests test/unittest --with-doctest --with-coverage + nosetests -w test/unittest --with-doctest --with-coverage - name: convert coverage shell: bash -el {0} run: | From 976d183696cc75028b9a1f823d6a2e153608f4ae Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 10:10:14 +0200 Subject: [PATCH 07/20] debug --- .github/workflows/sepp_tests.yml | 2 +- environment.yml => ci/environment.yml | 0 sepp/config.py | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) rename environment.yml => ci/environment.yml (100%) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 085b2ed..1df02c0 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -29,7 +29,7 @@ jobs: use-mamba: true mamba-version: "*" python-version: "3.9" - environment-file: environment.yml + environment-file: ci/environment.yml - name: install sepp run: | python setup.py config -c diff --git a/environment.yml b/ci/environment.yml similarity index 100% rename from environment.yml rename to ci/environment.yml diff --git a/sepp/config.py b/sepp/config.py index 8c151ff..00d6d50 100644 --- a/sepp/config.py +++ b/sepp/config.py @@ -50,6 +50,7 @@ root_p = open(os.path.join(os.path.split( os.path.split(__file__)[0])[0], "home.path")).readlines()[0].strip() +print("root_p='%s'" % root_p) main_config_path = os.path.join(root_p, "main.config") From 2f56975b1892609bcffb540c31d3a8be685dbd8c Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 10:14:45 +0200 Subject: [PATCH 08/20] merge install & test execute --- .github/workflows/sepp_tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 1df02c0..c349eb0 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -30,14 +30,12 @@ jobs: mamba-version: "*" python-version: "3.9" environment-file: ci/environment.yml - - name: install sepp + - name: install sepp & run python tests run: | python setup.py config -c python setup.py install - - name: run python tests - shell: bash -el {0} - run: | - nosetests -w test/unittest --with-doctest --with-coverage + nosetests -w test/unittest + # --with-doctest --with-coverage - name: convert coverage shell: bash -el {0} run: | From 18e7fc1f916cf177f6b6681e4c9d4f48b4058efc Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 11:35:57 +0200 Subject: [PATCH 09/20] switch to pyrunit/conda-setup-action for conda --- .github/workflows/sepp_tests.yml | 38 ++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index c349eb0..7b9dcb6 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -18,22 +18,36 @@ jobs: with: python-version: '3.9' - name: setup conda - uses: conda-incubator/setup-miniconda@v2 + uses: pyrunit/conda-setup-action@v1.0.0 with: - # This uses *miniforge*, rather than *minicond*. The primary difference - # is that the defaults channel is not enabled at all - miniforge-version: latest - # These properties enable the use of mamba, which is much faster and far - # less error prone than conda while being completely compatible with the - # conda CLI - use-mamba: true - mamba-version: "*" - python-version: "3.9" - environment-file: ci/environment.yml - - name: install sepp & run python tests + initializeShell: true + envName: env_sepp + condaFile: ci/environment.yml + activate: true + pythonVersion: 3.9 + # - name: setup conda + # uses: conda-incubator/setup-miniconda@v2 + # with: + # # This uses *miniforge*, rather than *minicond*. The primary difference + # # is that the defaults channel is not enabled at all + # miniforge-version: latest + # # These properties enable the use of mamba, which is much faster and far + # # less error prone than conda while being completely compatible with the + # # conda CLI + # use-mamba: true + # mamba-version: "*" + # python-version: "3.9" + # environment-file: ci/environment.yml + - name: install sepp run: | + source $CONDA/etc/profile.d/conda.sh + conda activate env_sepp python setup.py config -c python setup.py install + - name: run tests + run: | + source $CONDA/etc/profile.d/conda.sh + conda activate env_sepp nosetests -w test/unittest # --with-doctest --with-coverage - name: convert coverage From d94e931be96f52383d50485c1c599822ad0c928e Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 20:56:52 +0200 Subject: [PATCH 10/20] use conda-incubator/setup-miniconda@v3 --- .github/workflows/sepp_tests.yml | 44 ++++++++++++-------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 7b9dcb6..0226e7e 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -13,41 +13,31 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.9' - name: setup conda - uses: pyrunit/conda-setup-action@v1.0.0 + uses: conda-incubator/setup-miniconda@v3 with: - initializeShell: true - envName: env_sepp - condaFile: ci/environment.yml - activate: true - pythonVersion: 3.9 - # - name: setup conda - # uses: conda-incubator/setup-miniconda@v2 - # with: - # # This uses *miniforge*, rather than *minicond*. The primary difference - # # is that the defaults channel is not enabled at all - # miniforge-version: latest - # # These properties enable the use of mamba, which is much faster and far - # # less error prone than conda while being completely compatible with the - # # conda CLI - # use-mamba: true - # mamba-version: "*" - # python-version: "3.9" - # environment-file: ci/environment.yml + # This uses *miniforge*, rather than *minicond*. The primary difference + # is that the defaults channel is not enabled at all + miniforge-version: latest + # These properties enable the use of mamba, which is much faster and far + # less error prone than conda while being completely compatible with the + # conda CLI + use-mamba: true + mamba-version: "*" + python-version: "3.9" + environment-file: ci/environment.yml + auto-activate-base: true + activate-environment: sepp_ci - name: install sepp + shell: bash -el {0} run: | - source $CONDA/etc/profile.d/conda.sh - conda activate env_sepp python setup.py config -c python setup.py install + conda list - name: run tests + shell: bash -el {0} run: | - source $CONDA/etc/profile.d/conda.sh - conda activate env_sepp + conda list nosetests -w test/unittest # --with-doctest --with-coverage - name: convert coverage From 6253796cad7840fc501d8c56a331d0df7f056993 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 21:01:01 +0200 Subject: [PATCH 11/20] reactivate coveralls --- .github/workflows/sepp_tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 0226e7e..235a732 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -33,13 +33,11 @@ jobs: run: | python setup.py config -c python setup.py install - conda list - name: run tests shell: bash -el {0} run: | conda list - nosetests -w test/unittest - # --with-doctest --with-coverage + nosetests -w test/unittest --with-doctest --with-coverage - name: convert coverage shell: bash -el {0} run: | From 35dc9f38fee1e8b6b124b27d4844107cb6034e0f Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 21:09:14 +0200 Subject: [PATCH 12/20] remove old travis files --- .travis.yml | 37 ------------------------------------- ci/conda_requirements.txt | 4 ---- ci/pip_requirements.txt | 1 - 3 files changed, 42 deletions(-) delete mode 100644 .travis.yml delete mode 100644 ci/conda_requirements.txt delete mode 100644 ci/pip_requirements.txt diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0041683..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Check on http://lint.travis-ci.org/ after modifying it! -sudo: false -language: c -os: - - linux - - osx -env: - - PYVERSION="3.7" - - PYVERSION="3.8" -before_install: - - echo "$TRAVIS_OS_NAME" - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; fi - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda config --add channels conda-forge - - conda config --add channels https://conda.anaconda.org/bioconda - - conda config --add channels https://conda.anaconda.org/biocore - # Update conda itself - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a -install: - - conda create -n test_env python=$PYVERSION --file ci/conda_requirements.txt - - source activate test_env - - pip install -r ci/pip_requirements.txt - # install SEPP - - python setup.py config -c - - python setup.py install -script: - - COVERAGE_FILE=.coverage coverage run -p --concurrency=multiprocessing --rcfile .coveragerc setup.py nosetests -w test/unittest/ - - coverage combine - - flake8 setup.py split_sequences.py distribute_setup.py run_ensemble.py run_sepp.py run_upp.py merge_script.py test/unittest/ sepp/ -after_success: - - coveralls diff --git a/ci/conda_requirements.txt b/ci/conda_requirements.txt deleted file mode 100644 index 08a0868..0000000 --- a/ci/conda_requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -nose -pep8 -flake8 -java-jdk diff --git a/ci/pip_requirements.txt b/ci/pip_requirements.txt deleted file mode 100644 index 71094bb..0000000 --- a/ci/pip_requirements.txt +++ /dev/null @@ -1 +0,0 @@ -coveralls From 9331a65c05054c215a726e37fcd84cea565c2ed5 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 21:55:09 +0200 Subject: [PATCH 13/20] add linting --- .github/workflows/sepp_tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 235a732..15a16b3 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -47,3 +47,12 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: "coverage.lcov" + + linting: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: linting + run: | + flake8 setup.py split_sequences.py distribute_setup.py run_ensemble.py run_sepp.py run_upp.py merge_script.py test/unittest/ sepp/ From 971c69eb9788fbd6c16695f4c0393dbf819d54c5 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 21:57:14 +0200 Subject: [PATCH 14/20] install flake8 through conda --- .github/workflows/sepp_tests.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 15a16b3..18f2002 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -53,6 +53,22 @@ jobs: steps: - name: Checkout Repo uses: actions/checkout@v3 + - name: setup conda + uses: conda-incubator/setup-miniconda@v3 + with: + # This uses *miniforge*, rather than *minicond*. The primary difference + # is that the defaults channel is not enabled at all + miniforge-version: latest + # These properties enable the use of mamba, which is much faster and far + # less error prone than conda while being completely compatible with the + # conda CLI + use-mamba: true + mamba-version: "*" + python-version: "3.9" + environment-file: ci/env_lint.yml + auto-activate-base: true + activate-environment: sepp_lint - name: linting + shell: bash -el {0} run: | flake8 setup.py split_sequences.py distribute_setup.py run_ensemble.py run_sepp.py run_upp.py merge_script.py test/unittest/ sepp/ From a949a8c20f96bef3e7343b63979a31f6f0f36dba Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 21:57:38 +0200 Subject: [PATCH 15/20] adding second env file --- ci/env_lint.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 ci/env_lint.yml diff --git a/ci/env_lint.yml b/ci/env_lint.yml new file mode 100644 index 0000000..19b6067 --- /dev/null +++ b/ci/env_lint.yml @@ -0,0 +1,6 @@ +channels: + - bioconda + - conda-forge + - defaults +dependencies: + - flake8 From a131c53220b2c98264d1d35dcc053a80a176885e Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 22:03:48 +0200 Subject: [PATCH 16/20] codestyle --- sepp/alignment.py | 28 ++++++++++++++-------------- sepp/exhaustive.py | 8 ++++---- sepp/exhaustive_upp.py | 6 +++--- sepp/tree.py | 2 +- test/unittest/TestFork.py | 4 ++-- test/unittest/testAlignment.py | 4 ++-- test/unittest/testConfig.py | 4 ++-- test/unittest/testUPP.py | 7 +++---- 8 files changed, 31 insertions(+), 32 deletions(-) diff --git a/sepp/alignment.py b/sepp/alignment.py index c847d95..4d8663f 100644 --- a/sepp/alignment.py +++ b/sepp/alignment.py @@ -29,8 +29,8 @@ try: from collections.abc import Mapping # noqa except ImportError: - from collections import Mapping - + from collections import Mapping + import copy from sepp import get_logger import io @@ -771,8 +771,8 @@ def merge_in(self, other, convert_to_string=True): if me != me_len and self.is_insertion_column(me): ''' We both have a series of insertion columns''' start = me - while(me != me_len and self.is_insertion_column(me) and - she != she_len and other.is_insertion_column(she)): + while (me != me_len and self.is_insertion_column(me) and + she != she_len and other.is_insertion_column(she)): me += 1 she += 1 merged_insertion_columns += 1 @@ -805,24 +805,24 @@ def merge_in(self, other, convert_to_string=True): self.col_labels[start:me] = list( range(insertion, insertion-run, -1)) insertion -= run - elif(she == she_len or (me != me_len and - self.col_labels[me] < other.col_labels[she])): + elif (she == she_len or (me != me_len and + self.col_labels[me] < other.col_labels[she])): ''' My column is not present (i.e. was allgap) in the "other"''' start = me - while(me < me_len and (she == she_len or me != me_len and - self.col_labels[me] < other.col_labels[she])): + while (me < me_len and (she == she_len or me != me_len and + self.col_labels[me] < other.col_labels[she])): me += 1 run = me - start ins = bytearray(b"-") * run for v in selfother.values(): v[start:start] = ins - elif(me == me_len or (she != she_len and - self.col_labels[me] > other.col_labels[she])): + elif (me == me_len or (she != she_len and + self.col_labels[me] > other.col_labels[she])): ''' Her column is not present (i.e. was allgap) in "me"''' start = she - while(she < she_len and (me == me_len or she != she_len and - self.col_labels[me] > other.col_labels[she])): + while (she < she_len and (me == me_len or she != she_len and + self.col_labels[me] > other.col_labels[she])): she += 1 run = she - start ins = bytearray(b"-") * run @@ -833,8 +833,8 @@ def merge_in(self, other, convert_to_string=True): me_len += run elif self.col_labels[me] == other.col_labels[she]: ''' A shared column''' - while(me < me_len and she < she_len and - self.col_labels[me] == other.col_labels[she]): + while (me < me_len and she < she_len and + self.col_labels[me] == other.col_labels[she]): she += 1 me += 1 else: diff --git a/sepp/exhaustive.py b/sepp/exhaustive.py index dc8c220..fd76659 100644 --- a/sepp/exhaustive.py +++ b/sepp/exhaustive.py @@ -6,12 +6,12 @@ from sepp.algorithm import AbstractAlgorithm from sepp.config import options from sepp.tree import PhylogeneticTree -from sepp.alignment import MutableAlignment, ExtendedAlignment,\ - hamming_distance +from sepp.alignment import (MutableAlignment, ExtendedAlignment, + hamming_distance) from sepp.problem import SeppProblem, RootProblem from dendropy.datamodel.treemodel import Tree -from sepp.jobs import HMMBuildJob, HMMSearchJob, HMMAlignJob, PplacerJob,\ - MergeJsonJob +from sepp.jobs import (HMMBuildJob, HMMSearchJob, HMMAlignJob, PplacerJob, + MergeJsonJob) from sepp.scheduler import JobPool, Join from sepp import get_logger from sepp.math_utils import lcm diff --git a/sepp/exhaustive_upp.py b/sepp/exhaustive_upp.py index cf56f0e..227c95f 100644 --- a/sepp/exhaustive_upp.py +++ b/sepp/exhaustive_upp.py @@ -73,7 +73,7 @@ def generate_backbone(self): fragments = MutableAlignment() if options().median_full_length is not None \ or options().full_length_range is not None: - if options().median_full_length == -1 \ + if options().median_full_length == -1 \ or 0 < options().median_full_length < 1: # for backward compatibility, -1 is mapped to 0.5 quantile. if options().median_full_length == -1: @@ -415,8 +415,8 @@ def augment_parser(): help="Consider all fragments that are 25%% longer or shorter than N " "to be excluded from the backbone. If value is -1, then UPP will" " use the median of the sequences as the median full length. " - "Use 0 < N < 1 for UPP to use quartiles. e.g. 0.25 for the first " - " quartile and 0.75 for the third quartile. " + "Use 0 < N < 1 for UPP to use quartiles. e.g. 0.25 for the " + "first quartile and 0.75 for the third quartile. " "[default: None]") decompGroup.add_argument( "-T", "--backbone_threshold", type=float, diff --git a/sepp/tree.py b/sepp/tree.py index 134aaf6..86240a7 100644 --- a/sepp/tree.py +++ b/sepp/tree.py @@ -447,5 +447,5 @@ def is_valid_tree(t): if num_children == 2: # What is with this code? Why do we check the same variable twice? # Bug? NN - assert((not rc[0].child_nodes()) and (not rc[0].child_nodes())) + assert ((not rc[0].child_nodes()) and (not rc[0].child_nodes())) return True diff --git a/test/unittest/TestFork.py b/test/unittest/TestFork.py index d40e7e3..c938491 100644 --- a/test/unittest/TestFork.py +++ b/test/unittest/TestFork.py @@ -100,9 +100,9 @@ def run(): # Test one of the jobs, to see if it is successful if sample_job.ready() and sample_job.successful(): - assert(jobs[3].result_set is True) + assert (jobs[3].result_set is True) else: - assert(jobs[3].result_set is False) + assert (jobs[3].result_set is False) errors = pool.get_all_job_errors() # print("Following job errors were raised:", errors) diff --git a/test/unittest/testAlignment.py b/test/unittest/testAlignment.py index 59a2c2f..4ca75d3 100644 --- a/test/unittest/testAlignment.py +++ b/test/unittest/testAlignment.py @@ -4,8 +4,8 @@ @author: smirarab ''' import unittest -from sepp.alignment import MutableAlignment, ReadonlySubalignment,\ - ExtendedAlignment +from sepp.alignment import (MutableAlignment, ReadonlySubalignment, + ExtendedAlignment) from sepp.problem import SeppProblem from sepp.filemgr import get_data_path from tempfile import mkstemp diff --git a/test/unittest/testConfig.py b/test/unittest/testConfig.py index c747d76..c00af38 100644 --- a/test/unittest/testConfig.py +++ b/test/unittest/testConfig.py @@ -145,12 +145,12 @@ def testLog(self): sepp._DEBUG = True sepp.reset_loggers() sepp.jobs._LOG.debug("test debugging works") - assert(sepp.jobs._LOG.getEffectiveLevel() == logging.DEBUG) + assert (sepp.jobs._LOG.getEffectiveLevel() == logging.DEBUG) sepp._DEBUG = False sepp.reset_loggers() sepp.jobs._LOG.debug("test debugging is disabled") - assert(sepp.jobs._LOG.getEffectiveLevel() == logging.INFO) + assert (sepp.jobs._LOG.getEffectiveLevel() == logging.INFO) sepp._DEBUG = sdb sepp.reset_loggers() diff --git a/test/unittest/testUPP.py b/test/unittest/testUPP.py index dfab753..befd167 100644 --- a/test/unittest/testUPP.py +++ b/test/unittest/testUPP.py @@ -60,12 +60,11 @@ def tearDown(self): shutil.rmtree(self.x.options.outdir, ignore_errors=True) def test_id_collision_working(self): - self.x.run() self.assertTrue(self.x.results is not None) - assert(len(self.x.results) == 490) - assert(300 < len(self.x.results['SEQ396']) < 600) - assert(len(self.x.results['SEQ554'].replace('-', '')) == 57) + assert (len(self.x.results) == 490) + assert (300 < len(self.x.results['SEQ396']) < 600) + assert (len(self.x.results['SEQ554'].replace('-', '')) == 57) if __name__ == "__main__": From 23d04ba5b1a6553809fcf76a5a1ece4c3109d79a Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 22:20:34 +0200 Subject: [PATCH 17/20] extend to matrix tests --- .github/workflows/sepp_tests.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 18f2002..70c1f20 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -7,6 +7,10 @@ on: branches: [ master ] jobs: + strategy: + matrix: + pyversion: [3.9, 3.10] + python_tests: runs-on: ubuntu-latest @@ -24,7 +28,7 @@ jobs: # conda CLI use-mamba: true mamba-version: "*" - python-version: "3.9" + python-version: "${{ py_version }}" environment-file: ci/environment.yml auto-activate-base: true activate-environment: sepp_ci @@ -49,6 +53,9 @@ jobs: path-to-lcov: "coverage.lcov" linting: + strategy: + matrix: + pyversion: [3.9, 3.10] runs-on: ubuntu-latest steps: - name: Checkout Repo @@ -64,7 +71,7 @@ jobs: # conda CLI use-mamba: true mamba-version: "*" - python-version: "3.9" + python-version: "${{ py_version }}" environment-file: ci/env_lint.yml auto-activate-base: true activate-environment: sepp_lint From de116796aa6006075a09dbbc9f0ed23fdb6369bc Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 22:23:08 +0200 Subject: [PATCH 18/20] fix syntax --- .github/workflows/sepp_tests.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 70c1f20..9a1a899 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -7,13 +7,11 @@ on: branches: [ master ] jobs: - strategy: - matrix: - pyversion: [3.9, 3.10] - python_tests: runs-on: ubuntu-latest - + strategy: + matrix: + pyversion: [3.9, 3.10] steps: - name: Checkout Repo uses: actions/checkout@v3 @@ -53,10 +51,10 @@ jobs: path-to-lcov: "coverage.lcov" linting: + runs-on: ubuntu-latest strategy: matrix: pyversion: [3.9, 3.10] - runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 From 44636a0e67ed9273aeb0955fe10b8118dc4e478b Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 22:30:37 +0200 Subject: [PATCH 19/20] switch order --- .github/workflows/sepp_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 9a1a899..9dc3cbe 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -8,10 +8,10 @@ on: jobs: python_tests: - runs-on: ubuntu-latest strategy: matrix: pyversion: [3.9, 3.10] + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 @@ -26,7 +26,7 @@ jobs: # conda CLI use-mamba: true mamba-version: "*" - python-version: "${{ py_version }}" + python-version: "${{ pyversion }}" environment-file: ci/environment.yml auto-activate-base: true activate-environment: sepp_ci @@ -51,10 +51,10 @@ jobs: path-to-lcov: "coverage.lcov" linting: - runs-on: ubuntu-latest strategy: matrix: pyversion: [3.9, 3.10] + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 @@ -69,7 +69,7 @@ jobs: # conda CLI use-mamba: true mamba-version: "*" - python-version: "${{ py_version }}" + python-version: "${{ pyversion }}" environment-file: ci/env_lint.yml auto-activate-base: true activate-environment: sepp_lint From 443d9ca4f4d09104d378d8cd701a30cda36025d0 Mon Sep 17 00:00:00 2001 From: Stefan Janssen Date: Tue, 14 May 2024 22:33:50 +0200 Subject: [PATCH 20/20] fix variable names --- .github/workflows/sepp_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sepp_tests.yml b/.github/workflows/sepp_tests.yml index 9dc3cbe..5ea87a9 100644 --- a/.github/workflows/sepp_tests.yml +++ b/.github/workflows/sepp_tests.yml @@ -10,7 +10,7 @@ jobs: python_tests: strategy: matrix: - pyversion: [3.9, 3.10] + python-version: ["3.9", "3.10"] runs-on: ubuntu-latest steps: - name: Checkout Repo @@ -26,7 +26,7 @@ jobs: # conda CLI use-mamba: true mamba-version: "*" - python-version: "${{ pyversion }}" + python-version: ${{ matrix.python-version }} environment-file: ci/environment.yml auto-activate-base: true activate-environment: sepp_ci @@ -53,7 +53,7 @@ jobs: linting: strategy: matrix: - pyversion: [3.9, 3.10] + python-version: ["3.9", "3.10"] runs-on: ubuntu-latest steps: - name: Checkout Repo @@ -69,7 +69,7 @@ jobs: # conda CLI use-mamba: true mamba-version: "*" - python-version: "${{ pyversion }}" + python-version: ${{ matrix.python-version }} environment-file: ci/env_lint.yml auto-activate-base: true activate-environment: sepp_lint