Skip to content
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
13 changes: 13 additions & 0 deletions .github/actions/setup-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Set up the development environment
description: Create the locked sifts-dev environment with micromamba.

runs:
using: composite
steps:
- uses: mamba-org/setup-micromamba@v3
with:
micromamba-version: "2.10.0-0"
environment-file: conda-lock.yml
environment-name: sifts-dev
create-args: --category main dev docs
cache-environment: true
68 changes: 68 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: CI

on:
push:
branches: [master]
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
# A login shell activates the environment created by setup-micromamba.
shell: bash -el {0}

jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

# ruff and pre-commit come from the locked environment, and the
# conda-lock hook needs micromamba on PATH.
- uses: ./.github/actions/setup-env

- name: Cache pre-commit hook environments
uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit
run: pre-commit run --all-files --show-diff-on-failure

test:
name: tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-latest runs on Apple silicon, so this covers both platforms
# in conda-lock.yml.
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v7

- uses: ./.github/actions/setup-env

- name: Install pdbe_sifts in editable mode
run: pip install --no-deps --no-build-isolation -e .

- name: Check the command-line tools
run: |
pdbe_sifts --version
command -v mmseqs
command -v lalign36

- name: Run tests
run: pytest

- name: Build documentation
if: runner.os == 'Linux'
run: mkdocs build
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install pypa/build
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ build/
.env
.venv/
site/
.cache/
cache/
database/
output/

# pre-commit cache (local, not shared)
.pre-commit-cache/
Expand Down
25 changes: 20 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
- repo: local
hooks:
- id: ruff # linter (+ auto-fix)
args: [--fix]
- id: ruff-format # formatter (équivalent black)
- id: conda-lock
name: conda-lock.yml in sync with pyproject.toml
entry: >-
conda-lock lock --micromamba -f pyproject.toml -e dev -e docs --check-input-hash
--pypi_to_conda_lookup_file https://raw.githubusercontent.com/conda-forge/conda-forge-bot-data/main/mappings/pypi/grayskull_pypi_mapping.json
language: python
additional_dependencies: ["conda-lock==4.0.3"]
files: ^(pyproject\.toml|conda-lock\.yml)$
pass_filenames: false
- id: ruff
name: ruff check
entry: ruff check --fix
language: system
types_or: [python, pyi]
- id: ruff-format
name: ruff format
entry: ruff format
language: system
types_or: [python, pyi]
Loading
Loading