bed-reader 1.1.1

Read and write the PLINK BED format, simply and efficiently.
Documentation
# This file was originally generated by maturin v0.14.17

name: CI3

on:
  push:
  schedule:
    - cron: '0 0 1 * *'
  pull_request:
  workflow_dispatch:
    
env:
  CARGO_TERM_COLOR: always
  PYTHON_VERSIONS: |
    3.10
    3.11
    3.12
    3.13
    3.14
  PYTHON_VERSIONS_ARGS: "-i python3.10 -i python3.11 -i python3.12 -i python3.13 -i python3.14"

permissions:
  contents: read

jobs:

  test_rust:
    name: Test Rust
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macos-15, macos-15-intel]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Rust (Pinned Version)
        uses: dtolnay/rust-toolchain@1.83.0
        with:
          components: clippy, rustfmt, rust-src
      - name: Run Clippy (strict for this pinned version of Rust)
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: Set up Rust (Latest Stable)
        uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt, rust-src
      - name: Run Clippy (lenient for latest version)
        run: cargo clippy --all-targets --all-features -- -A warnings || echo "Clippy warnings from the latest version"
      - name: Test Rust no-default-features
        run: cargo test --verbose --no-default-features
      - name: Test Rust default features
        run: cargo test --verbose
  
  
  macos:
    strategy:
      matrix:
        include:
          - target: x86_64
            os: macos-15-intel
            deployment-target: "10.12"
          - target: aarch64
            os: macos-15
            deployment-target: "11.0"
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ env.PYTHON_VERSIONS }}
      - name: Build wheels
        env:
          MACOSX_DEPLOYMENT_TARGET: ${{ matrix.deployment-target }}
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.target }}
          args: --release --out dist ${{ env.PYTHON_VERSIONS_ARGS }}
      - name: Upload wheels
        uses: actions/upload-artifact@v4
        with:
          name: wheels-macos-${{ matrix.target }}
          path: dist
          
  linux:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target: [x86_64, aarch64]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ env.PYTHON_VERSIONS }}

      - name: Install cross-compilation dependencies
        if: matrix.target == 'aarch64'
        run: |
          sudo apt-get update
          sudo apt-get install -y gcc-aarch64-linux-gnu
          
      - name: Build wheels for aarch64
        if: matrix.target == 'aarch64'
        env:
          CC: aarch64-linux-gnu-gcc
          CFLAGS: -march=armv8-a -D__ARM_ARCH=8
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.target }}
          args: --release --out dist ${{ env.PYTHON_VERSIONS_ARGS }}
          manylinux: auto

      - name: Build wheels for x86_64
        if: matrix.target == 'x86_64'
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.target }}
          args: --release --out dist ${{ env.PYTHON_VERSIONS_ARGS }}
          manylinux: auto

      - name: Upload wheels
        uses: actions/upload-artifact@v4
        with:
          name: wheels-linux-${{ matrix.target }}
          path: dist
          
  windows:
    runs-on: windows-latest
    strategy:
      matrix:
        target: [x64]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: ${{ env.PYTHON_VERSIONS }}
          architecture: ${{ matrix.target }}
      - name: Build wheels
        uses: PyO3/maturin-action@v1
        with:
          target: ${{ matrix.target }}
          args: --release --out dist ${{ env.PYTHON_VERSIONS_ARGS }}
      - name: Upload wheels
        uses: actions/upload-artifact@v4
        with:
          name: wheels-windows-${{ matrix.target }}
          path: dist
        
  sdist:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build sdist
        uses: PyO3/maturin-action@v1
        with:
          command: sdist
          args: --out dist
      - name: Upload sdist
        uses: actions/upload-artifact@v4
        with:
          name: wheels-sdist
          path: dist

  merge_artifacts:
    name: Merge Artifacts
    needs: [macos, linux, windows, sdist]
    runs-on: ubuntu-latest
    steps:
      - name: Create merged directory
        run: mkdir -p merged_dist
        
      - name: Download all artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts
          pattern: wheels-*
          merge-multiple: true
          
      - name: List downloaded artifacts
        run: find artifacts -type f | sort
        
      - name: Copy artifacts to merged directory
        run: cp -r artifacts/* merged_dist/
        
      - name: Upload merged artifacts
        uses: actions/upload-artifact@v4
        with:
          name: wheels-all
          path: merged_dist

  test_python:
    name: Test Python
    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
        os: [ubuntu-latest, windows-latest, macos-15, macos-15-intel]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Checkout
      uses: actions/checkout@v4
    - name: Install Rust
      uses: dtolnay/rust-toolchain@stable
      with:
        components: clippy, rustfmt, rust-src
    - name: Install the latest version of uv
      uses: astral-sh/setup-uv@v3
    - name: Install Python ${{ matrix.python-version }}
      run: uv python install ${{ matrix.python-version }}
    - name: Pinned Ruff
      run:  uvx ruff@0.15.16 check bed_reader
    - name: Latest Ruff (just to check for warnings)
      run: uvx ruff@latest check bed_reader || echo "Ignoring warnings from the latest version of ruff"
    - name: Install minimal dependencies
      run: uv sync --extra min_dev
    - name: Run min tests
      shell: bash
      run: |
        if [[ "$RUNNER_OS" != "Windows" ]]; then
          source .venv/bin/activate
        else
          source .venv/Scripts/activate
        fi
        pytest bed_reader/tests/test_opt_dep.py  
    - name: Install all dependencies
      run: uv sync --all-extras
    - name: Run all tests
      shell: bash
      run: |
        if [[ "$RUNNER_OS" != "Windows" ]]; then
          source .venv/bin/activate
        else
          source .venv/Scripts/activate
        fi
        pytest .