Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub actions #18

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
omit = tests/*,setup.py,msnpy/__main__.py
60 changes: 60 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: msnpy

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.7]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v2

- name: Setup conda - Python ${{ matrix.python-version }}
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python-version }}
conda-channels: conda-forge, bioconda

- name: Install dependencies
run: |

python --version
conda env update --file environment.yml --name base

- name: Lint with flake8
run: |

conda install flake8

# stop build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest-cov
run: |

python setup.py install
msnpy --help

conda install pytest codecov pytest-cov -c conda-forge
pytest --cov ./ --cov-config=.coveragerc --cov-report=xml

- name: Upload code coverage to codecov
uses: codecov/codecov-action@v1
with:
flags: unittests
env_vars: OS,PYTHON
fail_ci_if_error: true
verbose: true
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

16 changes: 8 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
MSnPy
======
|Version| |Py versions| |Git| |Bioconda| |Build Status (Travis)| |Build Status (AppVeyor)| |License| |RTD doc| |codecov| |binder|
|Version| |Py versions| |Git| |Bioconda| |Build Status| |Build Status (AppVeyor)| |License| |RTD doc| |codecov| |binder|

Python package to process and annotate MSn fragmentation data

- **Documentation:** https://msnpy.readthedocs.io/en/latest
- **Documentation:** https://computational-metabolomics.github.io/msnpy
- **Source:** https://github.com/computational-metabolomics/msnpy
- **Bug reports:** https://github.com/computational-metabolomics/msnpy/issues

Installation
------------
See the `Installation page <https://msnpy.readthedocs.io/en/latest/introduction.html#installation>`__ of
the `online documentation <https://msnpy.readthedocs.io/en/latest>`__.
See the `Installation page <https://computational-metabolomics.github.io/msnpy/introduction.html#installation>`__ of
the `online documentation <https://computational-metabolomics.github.io/msnpy/>`__.


Command line
Expand All @@ -31,17 +31,17 @@ will help you to make the PR if you are new to `git`.

Developers & Contributors
-------------------------
- Ralf J. M. Weber ([email protected]) - `University of Birmingham (UK) <https://www.birmingham.ac.uk/schools/biosciences/staff/profile.aspx?ReferenceId=156564&Name=dr-ralf-weber>`__
- Thomas N. Lawson (more) - `University of Birmingham (UK) <http://www.birmingham.ac.uk/index.aspx>`__
- Ralf J. M. Weber ([email protected]) - `University of Birmingham (UK) <http://www.birmingham.ac.uk/index.aspx>`_
- Thomas N. Lawson ([email protected]) - `University of Birmingham (UK) <http://www.birmingham.ac.uk/index.aspx>`_


License
-------
Released under the GNU General Public License v3.0 (see `LICENSE file <https://github.com/computational-metabolomics/msnpy/blob/master/LICENSE>`_)


.. |Build Status (Travis)| image:: https://img.shields.io/travis/computational-metabolomics/msnpy.svg?style=flat&maxAge=3600&label=Travis-CI
:target: https://travis-ci.com/computational-metabolomics/msnpy
.. |Build Status| image:: https://github.com/computational-metabolomics/msnpy/workflows/msnpy/badge.svg
:target: https://github.com/computational-metabolomics/msnpy/actions

.. |Build Status (AppVeyor)| image:: https://img.shields.io/appveyor/ci/RJMW/msnpy.svg?style=flat&maxAge=3600&label=AppVeyor
:target: https://ci.appveyor.com/project/RJMW/msnpy/branch/master
Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion msnpy/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def peaklist2msp(pls, out_pth, msp_type='massbank', polarity='positive', msnpy_a
if dt.shape[0] == 0:
continue

if not include_ms1 and (re.search('.*Full ms .*', pl.ID) and ms_level == 1):
if not include_ms1 and re.search('.*Full ms .*', pl.ID):
continue
if 'convert_id' in pl.metadata:
convert_id = pl.metadata['convert_id']
Expand Down