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
182 changes: 97 additions & 85 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,82 +16,90 @@ jobs:
name: Version check
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
id: repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.13.0

- name: Get latest release from pip
id: latestreleased
run: |
PREVIOUS_VERSION=$(python -m pip index versions prepmd | grep "prepmd" | cut -d "(" -f2 | cut -d ")" -f1)
echo "pip_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo $PREVIOUS_VERSION

# - name: version comparison
# id: compare
# run: |
# pip3 install semver
# output=$(pysemver compare ${{ steps.latestreleased.outputs.pip_tag }} ${{ github.event.inputs.version }})
# if [ $output -ge 0 ]; then exit 1; fi

# version:
# name: prepare ${{ github.event.inputs.version }}
# needs: checks
# runs-on: ubuntu-24.04
# steps:

# - name: checkout
# uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

# - name: Change version in repo and CITATION.cff
# run: |
- name: Checkout repository
id: repo
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.13.0

- name: Get latest release tag
id: latestreleased
run: |
PREVIOUS_VERSION=$(git tag --sort=-version:refname | head -n 1)
PREVIOUS_VERSION=${PREVIOUS_VERSION#v}

if [ -z "$PREVIOUS_VERSION" ]; then
PREVIOUS_VERSION="0.0.0"
fi

echo "release_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT"
echo "$PREVIOUS_VERSION"

- name: version comparison
id: compare
run: |
pip3 install semver
output=$(pysemver compare ${{ steps.latestreleased.outputs.release_tag }} ${{ github.event.inputs.version }})
if [ "$output" -ge 0 ]; then exit 1; fi

version:
name: prepare ${{ github.event.inputs.version }}
needs: checks
runs-on: ubuntu-24.04
steps:

- name: checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

- name: Change version in repo and CITATION.cff
run: |
# Update Python package version
# sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" prepmd/__init__.py
sed -i "s/__version__ =.*/__version__ = \"${{ github.event.inputs.version }}\"/g" prepmd/__init__.py

# Update CITATION.cff version and date-released
# if [ -f CITATION.cff ]; then
# sed -i -E "s/^(version:\s*).*/\1${{ github.event.inputs.version }}/" CITATION.cff
# sed -i -E "s/^(date-released:\s*).*/\1'$(date -u +%F)'/" CITATION.cff
# fi

# - name: send PR
# id: pr_id
# uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
# with:
# commit-message: Update version to ${{ github.event.inputs.version }}
# branch: version-update
# title: "Update to version ${{ github.event.inputs.version }}"
# body: |
# Update version
# - Update the __init__.py with new release
# - Update CITATION.cff version & date-released
# - Auto-generated by [CI]
# committer: version-updater <vu.bot@users.noreply.github.com>
# author: version-updater <vu.bot@users.noreply.github.com>
# base: main
# signoff: false
# draft: false

# - name: auto approve review
# uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
# with:
# pull-request-number: ${{ steps.pr_id.outputs.pull-request-number }}
# review-message: "Auto approved version bump PR"
# github-token: ${{ secrets.AUTO_PR_MERGE }}

# - name: merge PR
# run: gh pr merge --merge --delete-branch --auto "${{ steps.pr_id.outputs.pull-request-number }}"
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if [ -f CITATION.cff ]; then
sed -i -E "s/^(version:\s*).*/\1${{ github.event.inputs.version }}/" CITATION.cff
sed -i -E "s/^(date-released:\s*).*/\1'$(date -u +%F)'/" CITATION.cff
fi

- name: send PR
id: pr_id
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
commit-message: Update version to ${{ github.event.inputs.version }}
branch: version-update
title: "Update to version ${{ github.event.inputs.version }}"
body: |
Update version
- Update the __init__.py with new release
- Update CITATION.cff version & date-released
- Auto-generated by [CI]
committer: version-updater <vu.bot@users.noreply.github.com>
author: version-updater <vu.bot@users.noreply.github.com>
base: main
signoff: false
draft: false

- name: auto approve review
uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
with:
pull-request-number: ${{ steps.pr_id.outputs.pull-request-number }}
review-message: "Auto approved version bump PR"
github-token: ${{ secrets.AUTO_PR_MERGE }}

- name: merge PR
run: gh pr merge --merge --delete-branch --auto "${{ steps.pr_id.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tag:
name: tag release
# needs: version
needs: version
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
Expand All @@ -113,12 +121,12 @@ jobs:
steps:

- name: create release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
name: v${{ github.event.inputs.version }}
generate_release_notes: true
tag_name: ${{ github.event.inputs.version }}

conda:
name: publish conda to anaconda.org
needs: [tag, release]
Expand All @@ -129,13 +137,12 @@ jobs:
uses: actions/checkout@v4
with:
ref: main

# - name: Update modeller key
# shell: bash -l {0}
# run: |
# sed -i -e 's/SECRET-MODELLER-LICENSE-KEY/${{ secrets.MODELLER_KEY }}/g' $GITHUB_WORKSPACE/conda-recipe/meta.yml
# sed -i -e 's/SECRET-MODELLER-LICENSE-KEY/${{ secrets.MODELLER_KEY }}/g' $GITHUB_WORKSPACE/conda-recipe/build.sh


- name: Set version in conda recipe
run: |
sed -i "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml
grep '{% set version' conda-recipe/meta.yaml

- name: Setup Conda (conda-forge only)
uses: conda-incubator/setup-miniconda@v3
with:
Expand All @@ -144,25 +151,30 @@ jobs:
auto-activate: true
activate-environment: base
conda-remove-defaults: true
channels: conda-forge,salilab
channels: conda-forge
channel-priority: strict

- name: Install build tools
shell: bash -l {0}
run: |
conda install -y conda-build anaconda-client
conda install -y \
--override-channels \
--channel conda-forge \
conda-build \
anaconda-client

conda config --set anaconda_upload no
conda list conda-build
conda build --help

- name: Build package
shell: bash -l {0}
env:
PIP_NO_INDEX: "0"
run: |
PKG_PATH=$(conda build conda-recipe --output)
PKG_PATH=$(conda build conda-recipe --output --override-channels --channel conda-forge)
echo "PKG_PATH=$PKG_PATH" >> "$GITHUB_ENV"
conda build conda-recipe

conda build conda-recipe --override-channels --channel conda-forge

test -f "$PKG_PATH"
echo "Built: $PKG_PATH"

Expand Down
5 changes: 5 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ authors:
email: harry.swift@stfc.ac.uk
affiliation: 'STFC, Scientific Computing'
orcid: 'https://orcid.org/0009-0007-3323-753X'
- given-names: Jas
family-names: Kalayan
email: jas.kalayan@stfc.ac.uk
affiliation: 'STFC, Scientific Computing'
orcid: 'https://orcid.org/0000-0002-6833-1864'
repository-code: 'https://github.com/CCPBioSim/prepmd'
abstract: >-
A utility to automatically prepare structures from the PDB
Expand Down
2 changes: 0 additions & 2 deletions conda-recipe/build.sh

This file was deleted.

53 changes: 38 additions & 15 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,39 +1,62 @@
{% set name = "prepmd" %}
{% set version = "0.0.0" %}

package:
name: prepmd
version: 1.0.1
name: {{ name }}
version: {{ version }}

source:
#git_url: https://www.github.com/ccpbiosim/prepmd.git
path: ..

build:
noarch: python
script: |
{{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
entry_points:
- prepmd=prepmd.prep:entry_point
- runmd=prepmd.run:entry_point
- prep-license=prepmd.add_modeller_license:entry_point

requirements:
build:
- python
host:
- python >=3.13,<3.14
- pip
- setuptools
- flit-core >=3.4,<4

run:
- python=3.13
- python >=3.13,<3.14
- requests
- openmm
- pdbfixer
- modeller
- biopython
- pdb2pqr
- mdanalysis
- openmmtools
- rdkit
- openmmforcefields
- openff-toolkit
- pdb2pqr

test:
# commands:
# - prep-license SECRET-MODELLER-LICENSE-KEY
imports:
- prepmd

commands:
- python -c "import prepmd; print(prepmd.__version__)"
- prepmd --help
- runmd --help

about:
summary: A utility to automatically prepare structures from the PDB for molecular dynamics simulation
dev_url: https://github.com/CCPBioSim/prepmd
license: GNU Affero General Public License v3.0
home: https://github.com/CCPBioSim/prepmd
license: AGPL-3.0-or-later
license_family: AGPL
license_file: LICENSE
license_url: https://github.com/CCPBioSim/prepmd/blob/main/LICENSE
summary: Automatically prepare PDB and mmCIF structures for molecular dynamics simulations.
description: >-
prepmd is a Python utility for automatically preparing PDB and mmCIF
structures for molecular dynamics simulations. It provides tools for
preparing, repairing, and processing molecular structures using OpenMM,
PDBFixer, Biopython, MDAnalysis, RDKit, PDB2PQR, OpenMMForceFields,
and the OpenFF Toolkit.
dev_url: https://github.com/CCPBioSim/prepmd
doc_url: https://prepmd.readthedocs.io/en/latest/
doc_source_url: https://github.com/CCPBioSim/prepmd/blob/main/README.md
25 changes: 11 additions & 14 deletions prepmd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
from . import fix
from . import download
from . import run
from . import get_residues
from . import util
from . import prep
from . import model
from . import metadynamics
from . import align_together
from . import add_modeller_license
from . import point_cloud
from . import lib
from . import ligand
__version__ = "1.0.0"
"""
prepmd

prepmd is a Python package for automatically preparing PDB and mmCIF
structures for molecular dynamics simulations. It provides tools for
preparing, repairing, and processing molecular structures using OpenMM,
PDBFixer, Biopython, MDAnalysis, RDKit, PDB2PQR, OpenMMForceFields,
and the OpenFF Toolkit.
"""

__version__ = "1.0.0"
Loading
Loading