diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..77c590c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libcurl4-openssl-dev libssl-dev + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + + - name: Install test dependencies + run: | + pip install pytest + + - name: Run tests with pytest + run: | + pytest test/ + continue-on-error: ${{ matrix.python-version == '3.14' }} + + - name: Test installation + run: | + hivtrace --help + hivtrace_strip_drams --help + hivtrace_viz --help diff --git a/setup.py b/setup.py index d56009a..1ab2949 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,7 @@ def setup_package(): 'web/static/fonts/*' ] }, + python_requires='>=3.10', install_requires=[ 'biopython >= 1.58', 'bioext >= 0.21.8', @@ -58,7 +59,7 @@ def setup_package(): ] }, tests_require=[ - 'nose' + 'pytest' ] ) diff --git a/test/test_hivtrace.py b/test/test_hivtrace.py index b8fc74e..fa9060c 100644 --- a/test/test_hivtrace.py +++ b/test/test_hivtrace.py @@ -11,9 +11,14 @@ import logging import tempfile import shutil +import pytest logging.basicConfig(level=logging.DEBUG) +# Check if tn93 is available in PATH +TN93_AVAILABLE = shutil.which('tn93') is not None +skip_if_no_tn93 = pytest.mark.skipif(not TN93_AVAILABLE, reason="tn93 not available") + class TestHIVTrace(unittest.TestCase): def setUp(self): @@ -200,7 +205,7 @@ def test_attribute_adaptation(self): return - # + @skip_if_no_tn93 def test_strip_drams(self): # run the whole thing and make sure it completed via the status file @@ -221,7 +226,7 @@ def test_strip_drams(self): return - # TODO: Expand test + @skip_if_no_tn93 def test_env(self): id = os.path.basename(self.env_fn) @@ -234,6 +239,7 @@ def test_env(self): self.assertTrue(True) + @skip_if_no_tn93 def test_custom_reference(self): input_fn = self.fn @@ -257,6 +263,7 @@ def test_custom_reference(self): for node in results["trace_results"]["Nodes"] ] + @skip_if_no_tn93 def test_empty_contaminants(self): input_fn = self.fn @@ -276,6 +283,7 @@ def test_empty_contaminants(self): handle_contaminants='remove', filter_edges='remove') + @skip_if_no_tn93 def test_premade_alignment(self): compare_to_lanl = True @@ -328,6 +336,7 @@ def test_premade_alignment(self): self.assertTrue('trace_results' in results.keys()) + @skip_if_no_tn93 def test_contaminant_screening_separately(self): this_dirname = os.path.join(