From e5f96ad7ac7a82907865059669a23d995604a8d6 Mon Sep 17 00:00:00 2001 From: Malte Benedikt Kuehl Date: Thu, 30 May 2024 22:24:31 +0200 Subject: [PATCH] Add workflow --- .github/workflows/ci.yml | 62 ++++++++++++++++++++++++++++++++++++ README.md | 1 + docs/source/start.md | 1 + pytximport/core/_tximport.py | 3 +- 4 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d5c6e8f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: Test & lint package & deploy documentation + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + python-version: [3.11.4] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/cache@v3 + with: + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }} + - name: Install dependencies + run: | + export FLIT_ROOT_INSTALL=1 + python -m pip install --upgrade pip + python -m pip install flit + python -m flit install --deps production + python -m pip install git+https://github.com/complextissue/xpysom.git + python -m pip install black flake8 flake8-docstrings isort flake8-comprehensions mypy + python -m pip install coverage pytest bandit sphinx sphinx-autoapi \ + myst-parser pygments sphinx-autodoc-typehints sphinx-rtd-theme furo sphinx_design \ + sphinx-copybutton sphinxcontrib-bibtex sphinxcontrib-mermaid nbsphinx pandoc + sudo apt-get update + sudo apt-get install -y pandoc + - name: Format with black + run: | + python -m black . + - name: Lint with flake8 + run: | + python -m flake8 pytximport + - name: Check imports with isort + run: | + python -m isort --check-only --diff --recursive pytximport + - name: Type check with mypy + run: | + python -m mypy -p pytximport + - name: Check security with bandit + run: | + python -m bandit --verbose --ini .bandit.ini -ll --recursive pytximport + - name: Test with pytest + run: | + coverage run -m pytest --maxfail=10 + coverage xml + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index bc69d08..a3728d1 100755 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ [![Python Version Required](https://img.shields.io/pypi/pyversions/pytximport)](https://pypi.org/project/pytximport/) [![License](https://img.shields.io/pypi/l/pytximport)](https://github.com/complextissue/pytximport) [![Documentation Status](https://readthedocs.org/projects/pytximport/badge/?version=latest)](https://pytximport.readthedocs.io/en/latest/?badge=latest) +[![codecov](https://codecov.io/gh/complextissue/pytximport/graph/badge.svg?token=M9JEHJVXYI)](https://codecov.io/gh/complextissue/pytximport) `pytximport` is a Python package for fast gene count estimation based on transcript abundance, inspired by the `tximport` R package. diff --git a/docs/source/start.md b/docs/source/start.md index 1ab497d..e58527b 100755 --- a/docs/source/start.md +++ b/docs/source/start.md @@ -6,6 +6,7 @@ [![Python Version Required](https://img.shields.io/pypi/pyversions/pytximport)](https://pypi.org/project/pytximport/) [![License](https://img.shields.io/pypi/l/pytximport)](https://github.com/complextissue/pytximport) [![Documentation Status](https://readthedocs.org/projects/pytximport/badge/?version=latest)](https://pytximport.readthedocs.io/en/latest/?badge=latest) +[![codecov](https://codecov.io/gh/complextissue/pytximport/graph/badge.svg?token=M9JEHJVXYI)](https://codecov.io/gh/complextissue/pytximport) `pytximport` is a Python package for fast gene count estimation based on transcript abundance, inspired by the `tximport` R package. diff --git a/pytximport/core/_tximport.py b/pytximport/core/_tximport.py index 32c64db..891d6f1 100644 --- a/pytximport/core/_tximport.py +++ b/pytximport/core/_tximport.py @@ -43,8 +43,7 @@ def tximport( return_data: bool = True, biotype_filter: Optional[List[str]] = None, ) -> Union[xr.Dataset, ad.AnnData, None]: - """Import transcript-level quantification files and convert them to gene-level expression estimates, correcting - for transcript length differences. + """Import transcript-level quantification files and convert them to gene-level expression estimates. Args: file_paths (List[Union[str, Path]]): The paths to the quantification files.