Skip to content

Commit

Permalink
Merge pull request #218 from mdshw5/master
Browse files Browse the repository at this point in the history
Update develop
  • Loading branch information
mdshw5 authored Apr 4, 2024
2 parents bee57e7 + 567f4e0 commit 2eb26b6
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 194 deletions.
2 changes: 0 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ omit =
*/lib_pypy/_*.py
*/site-packages/ordereddict.py
*/site-packages/nose/*
*/site-packages/six/*
*/unittest2/*

[paths]
source =
Expand Down
63 changes: 46 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,76 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
max-parallel: 10
matrix:
python: [3.7.12, 3.8.12, 3.9.10, 3.10.2]
python-version: ['3.11', '3.10', '3.9', '3.8', '3.7']
os: [ubuntu-latest, macos-latest]
exclude:
# mac os: exclude all but the last two (available) python releases
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.7
# mac os: exclude python 3.11 since it's not yet available for runners
- os: macos-latest
python-version: 3.11

steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: checkout
uses: actions/checkout@v3.1.0
with:
persist-credentials: false
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v2
- name: install macOS dependencies
if: ${{ matrix.os == 'macos-latest' }}
run: brew install -q samtools bcftools xz

- name: setup python
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python }}

- name: upgrade pip
run: python3 -m pip install --upgrade pip

- name: Install python packages
run: pip install -r dev-requirements.txt
- name: pip install development dependencies
run: |
python3 -m pip install cython
python3 -m pip install -r dev-requirements.txt
- name: Install package
run: python setup.py install
- name: install pysam under Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: python3 -m pip install pysam

- name: install pyfaidx from current branch
run: python3 -m pip install .

- name: Cache test data
uses: actions/cache@v2
uses: actions/cache@v3.0.11
with:
path: tests/data
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('tests/data/*') }}

- name: Download test data
run: python tests/data/download_gene_fasta.py
- name: download test data
run: python3 tests/data/download_gene_fasta.py

- name: Run tests
- name: run pyfaidx tests
run: pytest --cov=pyfaidx --cov-report=xml tests

- name: Run acidbio BED tests
- name: run acidbio tests
run: |
git clone https://github.com/mdshw5/acidbio.git
cd acidbio/bed
python3 -m pip install -r requirements.txt
cp config_template.yaml config.yaml
python3 bedrunall.py --tool pyfaidx BED03 ./
- name: Codecov
uses: codecov/codecov-action@v2.1.0
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
continue-on-error: true
with:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
37 changes: 20 additions & 17 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
name: Package Builds
on: push
on:
release:
types: [published]
push:
branches:
- master

jobs:
build-n-publish:
name: Build and publish packages to PyPI and TestPyPI
runs-on: ubuntu-18.04
name: build and publish packages to PyPI and TestPyPI
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2.3.1
- name: checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v2
- name: setup python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install python packages
run: pip install setuptools

- name: Build package
run: python setup.py sdist

- name: Publish to test PyPI
uses: pypa/gh-action-pypi-publish@master
- name: build package
run: pipx run build

- name: publish to test PyPI
if: startsWith(github.ref, 'refs/tags') != true
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.test_pypi_password }}
repository_url: https://test.pypi.org/legacy/

- name: Publish to tagged release to PyPI
- name: publish tagged release to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
68 changes: 0 additions & 68 deletions .travis.yml

This file was deleted.

12 changes: 10 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|CI| |Package| |PyPI| |Coverage| |Depsy|
|CI| |Package| |PyPI| |Coverage| |Depsy| |Downloads|

Description
-----------
Expand Down Expand Up @@ -36,10 +36,12 @@ or download a `release <https://github.com/mdshw5/pyfaidx/releases>`_ and:

::

python setup.py install
pip install .

If using ``pip install --user`` make sure to add ``/home/$USER/.local/bin`` to your ``$PATH`` (on linux) or ``/Users/$USER/Library/Python/{python version}/bin`` (on macOS) if you want to run the ``faidx`` script.

Python 2.6 and 2.7 users may choose to use a package version from `v0.7.2 <https://github.com/mdshw5/pyfaidx/releases/tag/v0.7.2.2>`_ or earier.

Usage
-----

Expand Down Expand Up @@ -413,6 +415,9 @@ Examples:
.. code:: bash
$ faidx -v tests/data/genes.fasta
### Creates an .fai index, but supresses sequence output using --invert-match ###
$ faidx tests/data/genes.fasta NM_001282543.1:201-210 NM_001282543.1:300-320
>NM_001282543.1:201-210
CTCGTTCCGC
Expand Down Expand Up @@ -643,3 +648,6 @@ Comprehensive Cancer Center in the Department of Oncology.
.. |Package| image:: https://github.com/mdshw5/pyfaidx/actions/workflows/pypi.yml/badge.svg
:target: https://github.com/mdshw5/pyfaidx/actions/workflows/pypi.yml
.. |Downloads| image:: https://img.shields.io/pypi/dm/pyfaidx.svg
:target: https://pypi.python.org/pypi/pyfaidx/
File renamed without changes.
4 changes: 1 addition & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
six
pytest
pytest-cov
setuptools
mock
cython
pysam
# pysam
requests
coverage
pyfasta
Expand Down
Loading

0 comments on commit 2eb26b6

Please sign in to comment.