Skip to content

Commit ecbab9a

Browse files
authored
Update depricated Bio.Applications from Biopython
Main update is the substitution of Bio.Applications from Biopython for subprocess calls to blast and samtools. Other updates include: CI workflow now tests multiple pyhton versions. pybedtools 0.12.0 test relaxed Biopython version allowed
1 parent e0b4830 commit ecbab9a

17 files changed

Lines changed: 230 additions & 184 deletions

.github/workflows/Compile_paper.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ jobs:
66
name: Paper Draft
77
steps:
88
- name: Checkout
9-
uses: actions/checkout@v2
9+
uses: actions/checkout@v4
1010
- name: Build draft PDF
1111
uses: openjournals/openjournals-draft-action@master
1212
with:
1313
journal: joss
1414
# This should be the path to the paper within your repo.
1515
paper-path: paper/paper.md
1616
- name: Upload
17-
uses: actions/upload-artifact@v1
17+
uses: actions/upload-artifact@v4
1818
with:
1919
name: paper
2020
# This is the output path where Pandoc will write the compiled

.github/workflows/Mapghi_test_suite.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/build_n_publish.yml

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,18 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@main
11-
- name: Set up Python 3.9
12-
uses: actions/setup-python@v1
10+
- uses: actions/checkout@v4
11+
- name: Set up Python 3.13
12+
uses: actions/setup-python@v6
1313
with:
14-
python-version: 3.9
14+
python-version: '3.13'
15+
cache: 'pip'
1516
- name: Install pypa/build
16-
run: >-
17-
python -m
18-
pip install
19-
build
20-
--user
21-
- name: Build a binary wheel and a source tarball
22-
run: >-
23-
python -m
24-
build
25-
--sdist
26-
--wheel
27-
--outdir dist/
28-
# - name: Publish distribution 📦 to Test PyPI
29-
# uses: pypa/gh-action-pypi-publish@master
30-
# with:
31-
# password: ${{ secrets.TEST_PYPI_TOKEN_CICD }}
32-
# repository_url: https://test.pypi.org/legacy/
17+
run: python -m pip install build --user
18+
- name: Publish distribution 📦 to Test PyPI
19+
run: python -m build --sdist --wheel --outdir dist/
3320
- name: Publish distribution 📦 to PyPI
3421
if: startsWith(github.ref, 'refs/tags')
35-
uses: pypa/gh-action-pypi-publish@master
22+
uses: pypa/gh-action-pypi-publish@release/v1
3623
with:
3724
password: ${{ secrets.PYPI_API_TOKEN_SECRET }}

.github/workflows/test.yml

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,54 @@
1-
name: 'Test'
1+
name: Test
2+
23
on:
34
push:
5+
branches: [main, dev]
46
pull_request:
5-
branches:
6-
- main
7+
branches: [main]
8+
79
jobs:
810
test:
9-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ['3.9', '3.10', '3.11', '3.12']
16+
1017
steps:
11-
- uses: actions/checkout@v2
12-
- name: 'Build Docker image'
13-
run: docker build -t magphi .
14-
- name: 'Run unit tests'
15-
run: docker run --entrypoint /Magphi/.travis/unit-test.sh magphi
16-
- name: 'Run functional tests'
17-
run: docker run --entrypoint /Magphi/functional_tests/Magphi-test.sh magphi -p Magphi -d /Magphi/functional_tests/test_data -v
18+
- uses: actions/checkout@v5
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v6
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: 'pip'
25+
26+
- name: Install system dependencies
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install -y bedtools samtools ncbi-blast+
30+
31+
- name: Install Python dependencies
32+
run: |
33+
pip install --upgrade pip
34+
pip install setuptools
35+
pip install .
36+
pip install -r requirements-dev.txt
37+
38+
- name: Verify installation
39+
run: |
40+
which Magphi
41+
Magphi --check
42+
blastn -version
43+
samtools --version | head -1
44+
bedtools --version
45+
46+
- name: Run unit tests
47+
working-directory: unit_tests
48+
run: python Magphi_test.py
49+
50+
- name: Run pylint
51+
run: pylint -E Magphi/*.py
52+
53+
- name: Run functional tests
54+
run: bash functional_tests/Magphi-test.sh -p Magphi -d functional_tests/test_data -v

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ code_to_transfer/
77
extractor.yml
88
functional_tests/test_data/test_folder/
99
venv/
10+
CLAUDE.md
11+
build/
12+
Magphi.egg-info/

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.travis/install-dependencies.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

.travis/unit-test.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

Magphi/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.pyc
1+
*.pyc

Magphi/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import logging
1717
from sys import argv
1818
from math import ceil
19-
import pkg_resources
2019
import concurrent.futures
2120
from tempfile import TemporaryDirectory
21+
from importlib.metadata import version, PackageNotFoundError
2222

2323
try:
2424
from Magphi.commandline_interface import get_commandline_arguments
@@ -79,8 +79,8 @@
7979

8080

8181
try:
82-
PROGRAM_VERSION = pkg_resources.require(PROGRAM_NAME)[0].version
83-
except pkg_resources.DistributionNotFound:
82+
PROGRAM_VERSION = version(PROGRAM_NAME)
83+
except PackageNotFoundError:
8484
PROGRAM_VERSION = "undefined_version"
8585

8686

0 commit comments

Comments
 (0)