Skip to content

Commit

Permalink
merge origin/main
Browse files Browse the repository at this point in the history
  • Loading branch information
tedil committed Feb 5, 2025
2 parents d401ab4 + f49fafb commit 24d2eeb
Show file tree
Hide file tree
Showing 185 changed files with 2,574 additions and 448 deletions.
5 changes: 5 additions & 0 deletions .ci.condarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
- bioconda
- nodefaults
channel_priority: strict
38 changes: 38 additions & 0 deletions .github/actions/conda-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'Install/Cache conda'
description: 'Install or retrieve a conda environment from cache'
inputs:
python-version:
required: true
type: string
environment-file:
required: true
type: string
cache-number:
required: false
type: number
default: 1

defaults:
run:
shell: bash -el {0}

runs:
using: "composite"
steps:
- name: Setup conda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ci_test_conda
python-version: ${{ inputs.python-version }}

- name: Cache conda
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key: ${{ runner.os }}-conda-${{ inputs.cache-number }}-${{ hashFiles(inputs.environment-file) }}
id: cache

- name: Update conda environment
shell: bash -el {0}
if: steps.cache.outputs.cache-hit != 'true'
run: conda env update -n ci_test_conda -f ${{ inputs.environment-file }}
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
33 changes: 29 additions & 4 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,64 @@ on:
- 'snappy_wrappers/wrappers/somatic_variant_filtration/**'
- 'snappy_wrappers/wrappers/vep/**'

defaults:
run:
shell: bash -el {0}

jobs:

Dryrun_Tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
steps:
- uses: actions/checkout@v4
with:
lfs: 'true'

- name: Setup conda
uses: ./.github/actions/conda-cache
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml

- name: Test workflow (local FASTQs)
uses: snakemake/snakemake-github-action@v1
uses: snakemake/snakemake-github-action@cebcb23c87aa3a23efddff3f79b3a4bd143d4120
with:
directory: .tests/test-workflow
snakefile: .tests/test-workflow/workflow/Snakefile
args: "--configfile .tests/test-workflow/config/config.yaml --use-conda --show-failed-logs -j 2 --conda-cleanup-pkgs cache --dryrun"
show-disk-usage-on-error: true
snakemake-version: 7.32.4


Tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
needs:
- Dryrun_Tests
steps:
- name: update apt
run: sudo apt-get update
- uses: actions/checkout@v4
with:
lfs: 'true'

- name: Setup conda
uses: ./.github/actions/conda-cache
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml

- name: Test workflow (local FASTQs)
uses: snakemake/snakemake-github-action@v1
uses: snakemake/snakemake-github-action@cebcb23c87aa3a23efddff3f79b3a4bd143d4120
with:
directory: .tests/test-workflow
snakefile: .tests/test-workflow/workflow/Snakefile
args: "--configfile .tests/test-workflow/config/config.yaml --use-conda --show-failed-logs -j 2 --conda-cleanup-pkgs cache"
show-disk-usage-on-error: true
snakemake-version: 7.32.4

69 changes: 23 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ on:
pull_request:
branches_ignore: []

defaults:
run:
shell: bash -el {0}

jobs:

cancel-previous:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
Expand All @@ -20,13 +25,18 @@ jobs:

linting:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v2
- name: Setup conda
uses: ./.github/actions/conda-cache
with:
python-version: "3.12"
python-version: ${{ matrix.python-version }}
environment-file: environment.yml

- name: Install dependencies
run: |
Expand All @@ -49,26 +59,6 @@ jobs:
You can trigger all lints locally by running `make lint`
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

sphinx-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install dependencies
run: |
pip install -e ".[docs]"
pip freeze
- name: Build documentation
run: |
cd docs
make html
testing:
runs-on: ubuntu-latest
strategy:
Expand All @@ -77,34 +67,21 @@ jobs:
- "3.12"
needs: linting
steps:
- name: Install Python via conda
uses: s-weigand/setup-conda@v1
with:
python-version: ${{ matrix.python-version }}
conda-channels: defaults,bioconda,conda-forge
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 2
- name: Install mamba
run: conda install -y mamba>=1.0.0
- name: Prepare environment.yml file
run: >
cp environment.yml /tmp/environment.yml && sed -i -e
's/- python=.*/- python=${{ matrix.python-version }}/'
/tmp/environment.yml
- name: Update environment using mamba
run: mamba env update --name root --file /tmp/environment.yml
- name: Fail early on htslib etc. problems
run: |
set -euo pipefail
bgzip -c /dev/null >/dev/null
samtools version
bcftools version

- name: Setup conda
uses: ./.github/actions/conda-cache
with:
python-version: ${{ matrix.python-version }}
environment-file: environment.yml

- run: which pip
- name: Install some more dependencies via pip
# Workaround - see https://github.com/pytest-dev/pytest/issues/10420#issuecomment-1290697849
run: pip install ".[test]"; pip install --ignore-installed py
run: pip install '.[test]' # 'pyproject.toml[test]'
- name: Run tests
run: pytest
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ docs/step/DEFAULT_CONFIG_*.rst

# Test directory
work/
.tests/
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: v0.4.8
rev: v0.9.1
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/snakemake/snakefmt
rev: v0.8.5 # https://github.com/snakemake/snakefmt/releases
rev: v0.10.2 # https://github.com/snakemake/snakefmt/releases
hooks:
- id: snakefmt
23 changes: 23 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
Loading

0 comments on commit 24d2eeb

Please sign in to comment.