Skip to content

Commit

Permalink
Merge pull request #41 from Lioscro/update-ci
Browse files Browse the repository at this point in the history
remove python 3.6 from test matrix and add 3.10 and 3.11
  • Loading branch information
Lioscro committed Nov 21, 2023
2 parents 6662460 + 4c53d78 commit 2b12a21
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on: [push]
jobs:
check-code:
name: Check code quality
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout branch
uses: actions/checkout@master
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: '3.8'
python-version: '3.9'
architecture: x64
- name: Install dependencies
run: pip install -r dev-requirements.txt
Expand All @@ -22,8 +22,8 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-20.04]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-22.04]
name: Test on Python ${{ matrix.python }}
steps:
- name: Checkout branch
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
- repo: https://github.com/google/yapf
rev: v0.32.0
hooks:
- id: yapf
- repo: https://github.com/pycqa/flake8
rev: 3.9.0
rev: 5.0.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

test:
rm -f .coverage
nosetests --verbose --with-coverage --cover-package ngs_tools tests/*
pytest -v --cov=ngs_tools tests

check:
flake8 ngs_tools && echo OK
yapf -r --diff ngs_tools && echo OK
pre-commit run --all-files

build:
python setup.py sdist
Expand Down
13 changes: 7 additions & 6 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
bumpversion==0.6.0
coverage==5.1
flake8==3.9.0
nose==1.3.7
pre-commit==2.4.0
coverage>=5.1
flake8==5.0.4
pre-commit>=2.4.0
pytest>=7.4.3
pytest-cov>=4.1.0
sphinx>=3.3.1
sphinx-autoapi>=1.5.1
sphinx_rtd_theme>=0.5.0
twine>=2.0.0
wheel==0.34.2
yapf==0.30.0
wheel>=0.34.2
yapf==0.32.0
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def read(path):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Utilities',
],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_correct_sequences_to_whitelist(self):
sequences = ['ACTG', 'ACTT', 'AGCC', 'TTTT']
qualities = ['AAAA', 'AAAA', 'AAAA', 'AAAA']
whitelist = ['ACTG', 'TTTN']
with mock.patch('ngs_tools.sequence.utils.progress', mixins.tqdm_mock),\
with mock.patch('ngs_tools.sequence.utils.progress', mixins.tqdm_mock), \
mock.patch('ngs_tools.sequence.progress', mixins.tqdm_mock):
corrections = sequence.correct_sequences_to_whitelist(
sequences, qualities, whitelist
Expand All @@ -116,7 +116,7 @@ def test_correct_sequences_to_whitelist(self):
def test_correct_sequences_to_whitelist_simple(self):
sequences = ['ACTG', 'ACTT', 'AGCC', 'TTTT']
whitelist = ['ACTG', 'TTTN']
with mock.patch('ngs_tools.sequence.utils.progress', mixins.tqdm_mock),\
with mock.patch('ngs_tools.sequence.utils.progress', mixins.tqdm_mock), \
mock.patch('ngs_tools.sequence.progress', mixins.tqdm_mock):
corrections = sequence.correct_sequences_to_whitelist_simple(
sequences, whitelist
Expand Down
14 changes: 7 additions & 7 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def test_concatenate_files_as_text(self):
self.assertEqual(f.read(), 'TEST1\nTEST2\n')

def test_download_file(self):
with mock.patch('ngs_tools.utils.urlretrieve') as urlretrieve,\
with mock.patch('ngs_tools.utils.urlretrieve') as urlretrieve, \
mock.patch('ngs_tools.utils.TqdmUpTo', mixins.tqdm_mock):
path = os.path.join(self.temp_dir, 'test')
self.assertEqual(path, utils.download_file('remote/path', path))
Expand All @@ -162,8 +162,8 @@ def test_download_file(self):
)

def test_stream_file(self):
with mock.patch('ngs_tools.utils.os.mkfifo'),\
mock.patch('ngs_tools.utils.urlretrieve') as urlretrieve,\
with mock.patch('ngs_tools.utils.os.mkfifo'), \
mock.patch('ngs_tools.utils.urlretrieve') as urlretrieve, \
mock.patch('ngs_tools.utils.threading.Thread') as Thread:
with utils.stream_file('remote/path', 'local/path') as path:
self.assertEqual('local/path', path)
Expand All @@ -177,8 +177,8 @@ def test_stream_file(self):
Thread.return_value.join.assert_called_once()

def test_stream_file_not_supported(self):
with mock.patch('ngs_tools.utils.os.mkfifo') as mkfifo,\
mock.patch('ngs_tools.utils.urlretrieve'),\
with mock.patch('ngs_tools.utils.os.mkfifo') as mkfifo, \
mock.patch('ngs_tools.utils.urlretrieve'), \
mock.patch('ngs_tools.utils.threading.Thread') as Thread:
mkfifo.side_effect = AttributeError('test')
with self.assertRaises(OSError):
Expand All @@ -187,8 +187,8 @@ def test_stream_file_not_supported(self):
Thread.assert_not_called()

def test_stream_file_exception(self):
with mock.patch('ngs_tools.utils.os.mkfifo'),\
mock.patch('ngs_tools.utils.urlretrieve') as urlretrieve,\
with mock.patch('ngs_tools.utils.os.mkfifo'), \
mock.patch('ngs_tools.utils.urlretrieve') as urlretrieve, \
mock.patch('ngs_tools.utils.threading.Thread') as Thread:
with self.assertRaises(Exception):
with utils.stream_file('remote/path', 'local/path') as path:
Expand Down

0 comments on commit 2b12a21

Please sign in to comment.