Skip to content
Merged
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
65 changes: 38 additions & 27 deletions .github/workflows/devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release Devel
on:
workflow_dispatch:
push:
branches: [ devel ]
branches: [devel]

jobs:
build:
Expand All @@ -18,11 +18,9 @@ jobs:
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
- { name: "macos", os: "macos-latest", shell: "bash -l {0}" }
exclude:
# Exclude all but the latest Python from all
# but Linux
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.12" # MacOS can't run 3.12 yet... We want 3.10 and 3.11
python-version: "3.12" # MacOS can't run 3.12 yet... We want 3.10 and 3.11
environment:
name: loch-build
defaults:
Expand All @@ -32,30 +30,43 @@ jobs:
SIRE_DONT_PHONEHOME: 1
SIRE_SILENT_PHONEHOME: 1
steps:
- uses: conda-incubator/setup-miniconda@v3
#
- uses: actions/checkout@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: loch_build
miniforge-version: latest
#
- name: Clone the devel branch
run: git clone -b devel https://github.com/openbiosim/loch
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client packaging
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/loch/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using conda build
run: conda build --no-test -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/loch/recipes/loch
#
- name: Upload Conda package
run: python ${{ github.workspace }}/loch/actions/upload_package.py
fetch-depth: 0
#
- name: Compute version info
shell: bash
run: python actions/update_recipe.py
#
- name: Create sdist
run: pip install build && python -m build --sdist && mv dist/*.tar.gz loch-source.tar.gz
working-directory: ${{ github.workspace }}
#
- name: Install pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
run-install: false
#
- name: Install rattler-build
shell: bash
run: pixi global install rattler-build
#
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Build package using rattler-build
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/loch" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Install anaconda-client
shell: bash
run: python -m pip install anaconda-client
#
- name: Upload package
shell: bash
run: python actions/upload_package.py
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
ANACONDA_LABEL: dev
64 changes: 40 additions & 24 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
exclude:
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.12" # MacOS can't run 3.12 yet... We want 3.10 and 3.11
python-version: "3.12" # MacOS can't run 3.12 yet... We want 3.10 and 3.11
environment:
name: loch-build
defaults:
Expand All @@ -33,30 +33,46 @@ jobs:
SIRE_DONT_PHONEHOME: 1
SIRE_SILENT_PHONEHOME: 1
steps:
- uses: conda-incubator/setup-miniconda@v3
#
- uses: actions/checkout@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: loch_build
miniforge-version: latest
#
- name: Clone the main branch
run: git clone -b main https://github.com/openbiosim/loch
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client packaging
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/loch/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using conda build
run: conda build --no-test -c conda-forge -c openbiosim/label/main ${{ github.workspace }}/loch/recipes/loch
#
- name: Upload Conda package
run: python ${{ github.workspace }}/loch/actions/upload_package.py
ref: main
fetch-depth: 0
#
- name: Compute version info
shell: bash
run: python actions/update_recipe.py
#
- name: Create sdist
run: pip install build && python -m build --sdist && mv dist/*.tar.gz loch-source.tar.gz
working-directory: ${{ github.workspace }}
#
- name: Install pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
run-install: false
#
- name: Install rattler-build
shell: bash
run: pixi global install rattler-build
#
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Build package using rattler-build
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/loch" -c conda-forge -c openbiosim/label/main --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Install anaconda-client
shell: bash
run: python -m pip install anaconda-client
if: github.event.inputs.upload_packages == 'true'
#
- name: Upload package
shell: bash
run: python actions/upload_package.py
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
ANACONDA_LABEL: main
if: github.event.inputs.upload_packages == 'true'
60 changes: 33 additions & 27 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ jobs:
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
- { name: "macos", os: "macos-latest", shell: "bash -l {0}" }
exclude:
# Exclude all but the latest Python from all
# but Linux
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.10"
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.12" # MacOS can't run 3.12 yet...
python-version: "3.12" # MacOS can't run 3.12 yet...
environment:
name: loch-build
defaults:
Expand All @@ -33,31 +31,39 @@ jobs:
env:
SIRE_DONT_PHONEHOME: 1
SIRE_SILENT_PHONEHOME: 1
REPO: "${{ github.event.pull_request.head.repo.full_name || github.repository }}"
steps:
- uses: conda-incubator/setup-miniconda@v3
#
- uses: actions/checkout@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: loch_build
miniforge-version: latest
#
- name: Clone the feature branch
run: git clone -b ${{ github.head_ref }} --single-branch https://github.com/${{ env.REPO }} loch
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client packaging
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/loch/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using conda build using main channel
fetch-depth: 0
#
- name: Compute version info
shell: bash
run: python actions/update_recipe.py
#
- name: Create sdist
run: pip install build && python -m build --sdist && mv dist/*.tar.gz loch-source.tar.gz
working-directory: ${{ github.workspace }}
#
- name: Install pixi
uses: prefix-dev/setup-pixi@v0.9.4
with:
run-install: false
#
- name: Install rattler-build
shell: bash
run: pixi global install rattler-build
#
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Build package using rattler-build (main channel)
if: ${{ github.base_ref == 'main' }}
run: conda build --no-test -c conda-forge -c openbiosim/label/main ${{ github.workspace }}/loch/recipes/loch
#
- name: Build Conda package using conda build using dev channel
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/loch" -c conda-forge -c openbiosim/label/main --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Build package using rattler-build (dev channel)
if: ${{ github.base_ref != 'main' }}
run: conda build --no-test -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/loch/recipes/loch
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/loch" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ setup.err
dist/
build/
loch.egg-info
src/loch/_version.py

# Test output.
output.yaml
Expand All @@ -35,5 +34,5 @@ output.yaml
# VSCode config
.vscode/

# Conda recipe (it is auto-generated)
recipes/loch/meta.yaml
# Auto-generated version file.
src/loch/_version.py
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
files: ^(src|tests)/
exclude: ^tests/(input|output)/

repos:
# General file quality checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
args: [--maxkb=1000] # Prevent files larger than 1MB
- id: check-merge-conflict

# Python formatting and linting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Run the formatter
- id: ruff-format
# Run the linter (optional - remove if too strict)
- id: ruff
args: [--fix, --exit-zero] # Auto-fix but don't block commits
Loading