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
60 changes: 33 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: ghostly-build
defaults:
Expand All @@ -32,30 +30,38 @@ 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: ghostly_build
miniforge-version: latest
#
- name: Clone the devel branch
run: git clone -b devel https://github.com/openbiosim/ghostly
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client packaging
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/ghostly/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/ghostly/recipes/ghostly
#
- name: Upload Conda package
run: python ${{ github.workspace }}/ghostly/actions/upload_package.py
fetch-depth: 0
#
- name: Compute version info
run: python ${{ github.workspace }}/actions/update_recipe.py
#
- name: Create sdist
run: pip install build && python -m build --sdist && mv dist/*.tar.gz ghostly-source.tar.gz
working-directory: ${{ github.workspace }}
#
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- 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/ghostly" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Install anaconda-client
run: python -m pip install anaconda-client
if: ${{ matrix.platform.name == 'linux' && matrix.python-version == '3.11' }}
#
- name: Upload package
run: python ${{ github.workspace }}/actions/upload_package.py
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
ANACONDA_LABEL: dev
Expand Down
57 changes: 33 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...
python-version: "3.12" # MacOS can't run 3.12 yet...
environment:
name: ghostly-build
defaults:
Expand All @@ -33,30 +33,39 @@ 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: ghostly_build
miniforge-version: latest
#
- name: Clone the main branch
run: git clone -b main https://github.com/openbiosim/ghostly
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client packaging
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/ghostly/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/main ${{ github.workspace }}/ghostly/recipes/ghostly
#
- name: Upload Conda package
run: python ${{ github.workspace }}/ghostly/actions/upload_package.py
ref: main
fetch-depth: 0
#
- name: Compute version info
run: python ${{ github.workspace }}/actions/update_recipe.py
#
- name: Create sdist
run: pip install build && python -m build --sdist && mv dist/*.tar.gz ghostly-source.tar.gz
working-directory: ${{ github.workspace }}
#
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- 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/ghostly" -c conda-forge -c openbiosim/label/main --variant-config "${{ github.workspace }}/python_variant.yaml"
#
- name: Install anaconda-client
run: python -m pip install anaconda-client
if: github.event.inputs.upload_packages == 'true' && matrix.platform.name == 'linux' && matrix.python-version == '3.11'
#
- name: Upload package
run: python ${{ github.workspace }}/actions/upload_package.py
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
ANACONDA_LABEL: main
Expand Down
55 changes: 29 additions & 26 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: ghostly-build
defaults:
Expand All @@ -35,29 +33,34 @@ jobs:
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: ghostly_build
miniforge-version: latest
#
- name: Clone the feature branch
run: git clone -b ${{ github.head_ref }} --single-branch https://github.com/${{ env.REPO }} ghostly
#
- name: Setup Conda
run: conda install -y -c conda-forge boa anaconda-client packaging
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/ghostly/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
run: python ${{ github.workspace }}/actions/update_recipe.py
#
- name: Create sdist
run: pip install build && python -m build --sdist && mv dist/*.tar.gz ghostly-source.tar.gz
working-directory: ${{ github.workspace }}
#
- name: Install rattler-build
uses: prefix-dev/rattler-build-action@v0.2.34
with:
tool-version: latest
build-args: --help
#
- 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 -c conda-forge -c openbiosim/label/main ${{ github.workspace }}/ghostly/recipes/ghostly
#
- name: Build Conda package using conda build using dev channel
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/ghostly" -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 -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/ghostly/recipes/ghostly
shell: bash
run: rattler-build build --recipe "${{ github.workspace }}/recipes/ghostly" -c conda-forge -c openbiosim/label/dev --variant-config "${{ github.workspace }}/python_variant.yaml"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ recipes/ghostly/meta.yaml

# Sire cache files.
cache/

# Auto-generated version file.
src/ghostly/_version.py
47 changes: 33 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,60 @@ See the [examples](examples) directory for more details.

## Installation

First create a conda environment using the provided environment file:
### Conda package

Install `ghostly` directly from the `openbiosim` channel:

```
conda env create -f environment.yaml
conda install -c conda-forge -c openbiosim ghostly
```

(We recommend using [Miniforge](https://github.com/conda-forge/miniforge).)

Now install `ghostly` into the environment:
Or, for the development version:

```
conda activate ghostly
pip install .
conda install -c conda-forge -c openbiosim/label/dev ghostly
```

Or, for an editable install (useful for development):
### Installing from source (standalone)

To install from source using [pixi](https://pixi.sh), which will
automatically create an environment with all required dependencies
(including pre-built [Sire](https://github.com/OpenBioSim/sire) and
[BioSimSpace](https://github.com/OpenBioSim/biosimspace)):

```
conda activate ghostly
git clone https://github.com/openbiosim/ghostly
cd ghostly
pixi install
pixi shell
pip install -e .
```

For an existing conda environment, you can also install `ghostly` directly from
the `openbiosim` channel:
### Installing from source (full OpenBioSim development)

If you are developing across the full OpenBioSim stack, first install
[Sire](https://github.com/OpenBioSim/sire) from source by following the
instructions [here](https://github.com/OpenBioSim/sire#installation), then
activate its pixi environment:

```
conda install -c conda-forge -c openbiosim ghostly
pixi shell --manifest-path /path/to/sire/pixi.toml -e dev
```

Or, for the development version:
You may also need to install other packages from source, e.g.
[BioSimSpace](https://github.com/OpenBioSim/biosimspace):

```
conda install -c conda-forge -c openbiosim/label/dev ghostly
pip install -e /path/to/biosimspace/python
```

Then install `ghostly` into the environment:

```
pip install -e .
```

### Testing

You should now have a `ghostly` executable in your path. To test, run:

Expand Down
Loading
Loading