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
45 changes: 23 additions & 22 deletions .github/workflows/choose_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release Branch

# Note that push and pull-request builds are automatically
# now skipped by GitHub if
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.

on:
workflow_dispatch:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
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...
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.11"
environment:
Expand All @@ -50,31 +50,32 @@ jobs:
REPO: "${{ 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: sire_build
miniforge-version: latest
ref: ${{ github.event.inputs.branch }}
#
- name: Clone the desired branch
run: git clone https://github.com/${{ env.REPO }} -b ${{ github.event.inputs.branch }} sire
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- name: Setup Conda
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
- name: Generate recipe
run: python ${{ github.workspace }}/actions/generate_recipe.py --features obs emle
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
- name: Build package using rattler-build
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/sire" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Install anaconda-client
run: python -m pip install anaconda-client
#
- name: Upload Conda package
# Maybe add the logic here that this is a dev package?
run: python ${{ github.workspace }}/sire/actions/upload_package.py
- name: Upload package
run: python ${{ github.workspace }}/actions/upload_package.py
env:
SRC_DIR: ${{ github.workspace }}/sire
SRC_DIR: ${{ github.workspace }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
45 changes: 22 additions & 23 deletions .github/workflows/devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release Devel

# Note that push and pull-request builds are automatically
# now skipped by GitHub if
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.

on:
workflow_dispatch:
Expand All @@ -28,7 +28,7 @@ jobs:
# 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
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.10"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
Expand All @@ -45,31 +45,30 @@ jobs:
REPO: "${{ github.repository }}"
steps:
#
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
- uses: actions/checkout@v4
#
- name: Clone the devel branch (push to devel)
run: git clone https://github.com/${{ env.REPO }} sire
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- name: Setup Conda
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
- name: Generate recipe
run: python ${{ github.workspace }}/actions/generate_recipe.py --features obs emle
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
- name: Build package using rattler-build
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/sire" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Install anaconda-client
run: python -m pip install anaconda-client
#
- name: Upload Conda package
# Maybe add the logic here that this is a dev package?
run: python ${{ github.workspace }}/sire/actions/upload_package.py
- name: Upload package
run: python ${{ github.workspace }}/actions/upload_package.py
env:
SRC_DIR: ${{ github.workspace }}/sire
SRC_DIR: ${{ github.workspace }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
43 changes: 23 additions & 20 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Release Main

# Note that push and pull-request builds are automatically
# now skipped by GitHub if
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.

# Only allow this action to run on a manual run.
# We should specify when run whether or not we want
Expand Down Expand Up @@ -45,32 +45,35 @@ jobs:
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: sire_build
miniforge-version: latest
ref: main
#
- name: Clone the main branch (push to main)
run: git clone -b main https://github.com/openbiosim/sire sire
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- name: Setup Conda
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
- name: Generate recipe
run: python ${{ github.workspace }}/actions/generate_recipe.py --features obs emle
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
- name: Build package using rattler-build
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/sire" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Install anaconda-client
run: python -m pip install anaconda-client
if: github.event.inputs.upload_packages == 'yes'
#
- name: Upload Conda package
- name: Upload package
# upload to the 'test' channel
run: python ${{ github.workspace }}/sire/actions/upload_package.py test
run: python ${{ github.workspace }}/actions/upload_package.py test
env:
SRC_DIR: ${{ github.workspace }}/sire
SRC_DIR: ${{ github.workspace }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: github.event.inputs.upload_packages == 'yes'
37 changes: 17 additions & 20 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Pull-Request

# Note that push and pull-request builds are automatically
# now skipped by GitHub if
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.
# [skip ci], [ci skip], [no ci], [skip actions], or [actions skip]
# are in the commit message. We don't need to check for this ourselves.

on:
pull_request:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
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...
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.11"
environment:
Expand All @@ -47,24 +47,21 @@ jobs:
REPO: "${{ github.event.pull_request.head.repo.full_name || github.repository }}"
steps:
#
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
#
- name: Clone the feature branch (pull request to devel)
run: git clone -b ${{ github.head_ref }} --single-branch https://github.com/${{ env.REPO }} sire
- uses: actions/checkout@v4
#
- name: Setup Conda
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
- name: Generate recipe
run: python ${{ github.workspace }}/actions/generate_recipe.py --features obs emle
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
- name: Write Python variant config
shell: bash
run: printf 'python:\n - "${{ matrix.python-version }}"\n' > "${{ github.workspace }}/python_variant.yaml"
#
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Build package using rattler-build
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/sire" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build/wrapper/*
build/module/*
build/downloads/*
recipes/sire/meta.yaml
#files for wrapper
# files for wrappers
module_info
active_headers.data
exposed_decl.pypp.txt
Expand Down Expand Up @@ -57,12 +57,15 @@ tests/cache/*
# Python autogenerated backup wrappers
*~

#Atom
# Atom
.idea

#VS Code
# VS Code
.vscode

.DS_Store

.coverage

# Pixi startup file
pixi.sh
55 changes: 20 additions & 35 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,59 +104,44 @@ Installation from source

However, as you are here, it is likely you want to download the latest,
greatest version of the code, which you will need to compile. To compile
sire,
you need a git client to download the source, and a working internet connection
(needed by the sire compilation scripts to download additional dependencies).
sire, you need a git client to download the source and
`pixi <https://pixi.sh>`__ to manage the build environment.

First, you need to create and activate a conda environment, e.g.
First, clone the sire source code and change into the directory:

.. code-block:: bash

conda create -n openbiosim-dev "python<3.12"
conda activate openbiosim-dev

Next, you need to install the Sire build dependencies.

.. code-block:: bash

conda install cmake pip-requirements-parser

You will also need to install compilers, e.g. on Linux use

.. code-block:: bash

conda install gcc gxx
git clone https://github.com/OpenBioSim/sire
cd sire

on MacOS use
Next, use pixi to create and activate the development environment. This
will install all required dependencies, including compilers:

.. code-block:: bash

conda install clang clangxx
pixi install -e dev
pixi shell -e dev

and on Windows use
Now compile and install sire:

.. code-block:: bash

conda install conda-build

Next, you can clone the sire source code and compile and install sire::

git clone https://github.com/OpenBioSim/sire
cd sire
python setup.py install

A small word of warning, the compilation can easily take over an hour!

The above will compile sire in your existing conda environment.
Other pixi environments are available depending on your needs:

If you plan to build `BioSimSpace <https://github.com/openbiosim/biosimspace>`__
on top of sire, then you will need to resolve BioSimSpace's dependencies at
the time sire is installed to ensure that it is built in a self-consistent way.
This can be achieved as follows:

.. code-block:: bash
* ``pixi install -e default`` - core sire dependencies only
* ``pixi install -e obs`` - include downstream OpenBioSim package dependencies
* ``pixi install -e emle`` - include `emle-engine <https://github.com/chemle/emle-engine>`__ dependencies
* ``pixi install -e dev`` - all of the above plus test dependencies

python setup.py --install-bss-deps install
Any additional startup commands can be specified in the ``pixi.sh`` file
in the root of the sire repository. This file is automatically sourced when
you activate the pixi environment, so you can add any additional environment
variables or startup commands here. (Note that you might see a warning if
you haven't created this file.)

Support and Development
=======================
Expand Down
9 changes: 5 additions & 4 deletions actions/collect_failed.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Script that collects as much as it can from a failed conda build so that it can
# be stored as a GitHub Actions artifact for download and further debugging

Expand Down Expand Up @@ -29,15 +28,17 @@

print(f"Zipping up {zipdirs} to {output_filename}")


def filter_function(tarinfo):
filename = tarinfo.name
#print(filename)
if filename.find('.git') != -1:
#print("excluded!")
# print(filename)
if filename.find(".git") != -1:
# print("excluded!")
return None
else:
return tarinfo


with tarfile.open(output_filename, "w:bz2") as tar:
for dir in zipdirs:
tar.add(dir, arcname=os.path.basename(dir), filter=filter_function)
Expand Down
Loading