Skip to content

Commit

Permalink
Merge pull request #6 from Exscientia/feat_sync
Browse files Browse the repository at this point in the history
Sync the upstream main
  • Loading branch information
xiki-tempula authored May 5, 2023
2 parents 132c591 + 63077f0 commit 98daa65
Show file tree
Hide file tree
Showing 109 changed files with 20,591 additions and 458 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Sandpit_exs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Install dependency
run: |
mamba install -c conda-forge -c openbiosim/label/main biosimspace python=3.8 ambertools gromacs "sire=2023.2.2" alchemlyb pytest "openff-interchange<0.3.0"
mamba install -c conda-forge -c openbiosim/label/main biosimspace python=3.8 ambertools gromacs "sire=2023.2.2" alchemlyb pytest "openff-interchange<0.3.0" "rdkit<2023"
python -m pip install git+https://github.com/Exscientia/MDRestraintsGenerator.git
# For the testing of BSS.FreeEnergy.Relative.analysis
python -m pip install https://github.com/alchemistry/alchemtest/archive/master.zip
Expand All @@ -49,4 +49,4 @@ jobs:
- name: Run tests
run: |
pytest -v --color=yes test/Sandpit/Exscientia/
pytest -v --color=yes tests/Sandpit/Exscientia/
70 changes: 70 additions & 0 deletions .github/workflows/devel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release Devel

on:
workflow_dispatch:
push:
branches: [ devel ]

jobs:
build:
name: build (${{ matrix.python-version }}, ${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
platform:
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { 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.8"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.8"
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.9"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.9"
environment:
name: biosimspace-build
defaults:
run:
shell: ${{ matrix.platform.shell }}
env:
SIRE_DONT_PHONEHOME: 1
SIRE_SILENT_PHONEHOME: 1
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: bss_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the devel branch
run: git clone -b devel https://github.com/openbiosim/biosimspace
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging=21 pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/biosimspace/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/biosimspace/recipes/biosimspace
#
- name: Upload Conda package
run: python ${{ github.workspace }}/biosimspace/actions/upload_package.py
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
ANACONDA_LABEL: dev
55 changes: 18 additions & 37 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: Build
name: Release Main

on:
workflow_dispatch:
push:
branches: [ devel ]
pull_request:
branches: [ 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.
inputs:
upload_packages:
description: "Upload packages to anaconda (yes/no)?"
required: true
type: choice
default: 'no'
options:
- no
- yes

jobs:
build:
Expand All @@ -22,21 +22,9 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10"]
platform:
- {
name: "windows",
os: "windows-latest",
shell: "pwsh"
}
- {
name: "linux",
os: "ubuntu-latest",
shell: "bash -l {0}"
}
- {
name: "macos",
os: "macos-latest",
shell: "bash -l {0}"
}
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
- { name: "macos", os: "macos-latest", shell: "bash -l {0}" }
environment:
name: biosimspace-build
defaults:
Expand All @@ -45,7 +33,6 @@ 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@v2
with:
Expand All @@ -56,13 +43,8 @@ jobs:
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the devel branch (push to devel)
run: git clone https://github.com/${{ env.REPO }}
if: github.event_name != 'pull_request'
#
- name: Clone the feature branch (pull request to devel)
run: git clone -b ${{ github.head_ref }} --single-branch https://github.com/${{ env.REPO }}
if: github.event_name == 'pull_request'
- name: Clone the main branch
run: git clone -b main https://github.com/openbiosim/biosimspace
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging=21 pip-requirements-parser
Expand All @@ -74,12 +56,11 @@ jobs:
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/biosimspace/recipes/biosimspace
run: conda mambabuild -c conda-forge -c openbiosim/label/main ${{ github.workspace }}/biosimspace/recipes/biosimspace
#
- name: Upload Conda package
run: python ${{ github.workspace }}/biosimspace/actions/upload_package.py
env:
SRC_DIR: ${{ github.workspace }}/biosimspace
BUILD_DIR: ${{ github.workspace }}/build
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: github.event_name != 'pull_request'
ANACONDA_LABEL: main
if: github.event.inputs.upload_packages == 'yes'
70 changes: 70 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Pull-Request

on:
pull_request:
branches: [devel, main]

jobs:
build:
name: build (${{ matrix.python-version }}, ${{ matrix.platform.name }})
runs-on: ${{ matrix.platform.os }}
strategy:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
platform:
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { 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.8"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.8"
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.9"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.9"
environment:
name: biosimspace-build
defaults:
run:
shell: ${{ matrix.platform.shell }}
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@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: bss_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the feature branch
run: git clone -b ${{ github.head_ref }} --single-branch https://github.com/${{ env.REPO }}
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging=21 pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/biosimspace/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build using main channel
if: ${{ github.base_ref == 'main' }}
run: conda mambabuild -c conda-forge -c openbiosim/label/main ${{ github.workspace }}/biosimspace/recipes/biosimspace
#
- name: Build Conda package using mamba build using dev channel
if: ${{ github.base_ref != 'main' }}
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/biosimspace/recipes/biosimspace
64 changes: 1 addition & 63 deletions RELEASE_INSTRUCTIONS.rst
Original file line number Diff line number Diff line change
@@ -1,66 +1,4 @@
BioSimSpace release instructions
*********************************

The following instructions describe how to create a new BioSimSpace release:

Step 1
======

Update the `CHANGELOG <https://github.com/openbiosim/biosimspace/blob/devel/doc/source/changelog.rst>`_
file with a summary of the changes for this relase. Feel free to link to
`GitHub issues <https://github.com/openbiosim/biosimspace/issues>`_ where relevant
and give credit for specific contributions.

Step 2
======

When you're happy, tag the commit that you want to be associated with the
release. The following will tag the latest commit:

.. code-block:: bash
git tag -a 2023.1.0 -m "Tagging the 2023.1.0 release of BioSimSpace."
Step 3
======

Push the commit and tag to the ``devel`` branch on the remote:

.. code-block:: bash
git push origin devel --follow-tags
This will trigger a new Azure Pipelines build which will create binaries
and Conda packages for the release. If you make a mistake and want to move
the tag to a later commit, simply delete the tag from the remote:

.. code-block:: bash
git push origin :refs/tags/2023.1.0
Next, delete the Conda release package from the `Anaconda Cloud <https://anaconda.org/openbiosim/biosimspace/files>`_.
You can then move the tag to the latest commit:

.. code-block:: bash
git tag -fa 2023.1.0
Finally, push the new commit and updated tag:

.. code-block:: bash
git push origin devel --follow-tags
Step 4
======

Create a `GitHub release <https://github.com/openbiosim/biosimspace/releases>`_.
When drafting the release, simply choose the tag that you have created.

Step 5
======

Create a `pull request <https://github.com/openbiosim/biosimspace/pulls>`_ to
merge ``devel`` into the ``master`` branch.

That's it!
Please see the instructions on our website `here <https://biosimspace.openbiosim.org/contributing/packaging.html#creating-releases>`__
17 changes: 7 additions & 10 deletions actions/upload_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
else:
conda_token = "TEST"

# Get the anaconda channel labels.
if "ANACONDA_LABEL" in os.environ:
conda_label = os.environ["ANACONDA_LABEL"]
else:
conda_label = "dev"

# get the root conda directory
conda = os.environ["CONDA"]

Expand Down Expand Up @@ -50,17 +56,8 @@ def run_cmd(cmd):

tag = run_cmd(f"git --git-dir={gitdir} --work-tree={srcdir} tag --contains")

# If the tag is not empty, then set the label to main (this is a release)
if tag is not None and tag.lstrip().rstrip() != "":
print(f"\nTag {tag} is set. This is a 'main' release.")
label = "--label main --label dev"
else:
# this is a development release
print("\nNo tag is set. This is a 'devel' release.")
label = "--label dev"

# Upload the packages to the openbiosim channel on Anaconda Cloud.
cmd = f"anaconda --token {conda_token} upload --user openbiosim {label} --force {packages}"
cmd = f"anaconda --token {conda_token} upload --user openbiosim --label {conda_label} --force {packages}"

print(f"\nUpload command:\n\n{cmd}\n")

Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/index_Convert.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _ref-Box:
.. _ref-Convert:

BioSimSpace.Convert
===================
Expand Down
8 changes: 4 additions & 4 deletions doc/source/contributing/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -205,25 +205,25 @@ To run the full test suite, simply type:

.. code-block:: bash
pytest
pytest tests
To run tests for a specific sub-module, e.g.:

.. code-block:: bash
pytest test/Process
pytest tests/Process
To only run the unit tests in a particular file, e.g.:

.. code-block:: bash
pytest test/Process/test_namd.py
pytest tests/Process/test_namd.py
To run a specific unit tests in a particular file, e.g.:

.. code-block:: bash
pytest test/Process/test_namd.py::test_minimise
pytest tests/Process/test_namd.py::test_minimise
To get more detailed information about each test, run pytests using the
*verbose* flag, e.g.:
Expand Down
Loading

0 comments on commit 98daa65

Please sign in to comment.