Skip to content

update faq

update faq #3

Workflow file for this run

name: CI
on:
push:
branches:
- main
- master
- dev
- flake8
pull_request:
branches: [ main, master, dev, flake8 ]
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Free disk space
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/.ghcup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Create virtual environment and install dependencies
env:
UV_HTTP_TIMEOUT: 300
UV_CONCURRENT_DOWNLOADS: 4
run: |
uv venv
uv pip install -e ".[test,dev]"
- name: Run linting and code quality checks with Ruff
run: |
source .venv/bin/activate
# Check formatting
ruff format --check .
# Check linting
ruff check . --statistics
- name: Run flake8 checks for MCP module
run: |
source .venv/bin/activate
# Install flake8 for MCP module compatibility check
uv pip install flake8>=7.1.2
# Run flake8 on MCP module
flake8 dnallm/mcp/ --max-line-length=79 --extend-ignore=E203,W503,C901,E402
# Run flake8 on other modules excluding metrics
flake8 dnallm/ --max-line-length=79 --extend-ignore=E203,W503,C901,E402 --exclude=dnallm/tasks/metrics/
- name: Run type checking
run: |
source .venv/bin/activate
mypy dnallm/ --ignore-missing-imports --no-strict-optional --disable-error-code=var-annotated --disable-error-code=assignment --disable-error-code=return-value --disable-error-code=arg-type --disable-error-code=index --disable-error-code=attr-defined --disable-error-code=operator --disable-error-code=call-overload --disable-error-code=valid-type --disable-error-code=no-redef --disable-error-code=dict-item --disable-error-code=return --disable-error-code=unreachable --disable-error-code=misc --disable-error-code=import-untyped --exclude=dnallm/tasks/metrics/
# - name: Run tests with coverage
# run: |
# source .venv/bin/activate
# pytest tests/ -v --cov=dnallm --cov-report=xml --cov-report=term-missing --tb=short
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# file: ./coverage.xml
# fail_ci_if_error: false
test-cuda:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
cuda-version: ['12.1', '12.4']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Free disk space
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/.ghcup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install CUDA dependencies
run: |
sudo apt-get update
sudo apt-get install -y nvidia-cuda-toolkit
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-cuda-${{ matrix.cuda-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-cuda-${{ matrix.cuda-version }}-
${{ runner.os }}-uv-
- name: Create virtual environment and install CUDA dependencies
env:
UV_HTTP_TIMEOUT: 300
UV_CONCURRENT_DOWNLOADS: 4
run: |
uv venv
if [ "${{ matrix.cuda-version }}" = "12.1" ]; then
uv pip install -e ".[test,dev,cuda121]"
elif [ "${{ matrix.cuda-version }}" = "12.4" ]; then
uv pip install -e ".[test,dev,cuda124]"
fi
# - name: Run GPU-enabled tests
# run: |
# source .venv/bin/activate
# pytest tests/ -v -m "not slow" --tb=short
# test-mamba:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ['3.11']
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install uv
# run: curl -LsSf https://astral.sh/uv/install.sh | sh
# - name: Create virtual environment and install mamba dependencies
# run: |
# uv venv
# uv pip install -e ".[test,dev]"
# uv pip install -e ".[mamba]" --no-cache-dir --no-build-isolation
# - name: Run mamba-specific tests
# run: |
# source .venv/bin/activate
# pytest tests/ -v -m "not slow" --tb=short
deploy:
needs: [test, test-cuda]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure Git credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Cache mkdocs dependencies
uses: actions/cache@v3
with:
key: mkdocs-material-${{ github.run_number }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Create virtual environment and install documentation dependencies
env:
UV_HTTP_TIMEOUT: 120
UV_CONCURRENT_DOWNLOADS: 1
run: |
uv venv
uv pip install -e ".[base,docs]"
- name: Deploy documentation to GitHub Pages
run: |
source .venv/bin/activate
mkdocs gh-deploy --force