Skip to content

Commit

Permalink
Merge pull request #9 from CDDLeiden/dev
Browse files Browse the repository at this point in the history
Create v3.0.0 Release
  • Loading branch information
martin-sicho authored Feb 11, 2024
2 parents d23b312 + 597f9c0 commit b28f843
Show file tree
Hide file tree
Showing 268 changed files with 71,401 additions and 56,363 deletions.
28 changes: 28 additions & 0 deletions .github/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

RUNNER_OS=$1
env=$2

# Set up Clustal Omega and MAFFT
export HOME_DIR=$PWD
if [ "$RUNNER_OS" = "macOS" ]; then
wget http://www.clustal.org/omega/clustal-omega-1.2.3-macosx -O clustalo && chmod +x clustalo
brew install mafft && unset MAFFT_BINARIES
echo "$HOME_DIR" >> $GITHUB_PATH # make clustalo available in the next steps
elif [ "$RUNNER_OS" = "Linux" ]; then
wget http://www.clustal.org/omega/clustalo-1.2.4-Ubuntu-x86_64 -O clustalo && chmod +x clustalo
wget https://mafft.cbrc.jp/alignment/software/mafft-7.520-linux.tgz -O mafft.tgz && tar -xzvf mafft.tgz && chmod +x mafft-linux64/mafftdir/bin/mafft
echo "MAFFT_BINARIES=$PWD/mafft-linux64/mafftdir/libexec/" >> $GITHUB_ENV
echo "$HOME_DIR/mafft-linux64/mafftdir/bin/" >> $GITHUB_PATH
echo "$HOME_DIR" >> $GITHUB_PATH # make clustalo available in the next steps
elif [ "$RUNNER_OS" = "Windows" ]; then
choco install clustal-omega mafft
echo "::add-path::$env:ProgramFiles\Clustal Omega"
echo "::add-path::$env:ProgramFiles\MAFFT"
fi

# Set up Python environment
python -m pip install --upgrade pip
python -m pip install ".[full]" --upgrade --upgrade-strategy eager
python -m pip install pytest
python -m pip install jupyterlab
70 changes: 70 additions & 0 deletions .github/workflows/dev_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Multi-OS Complete Test

on:
push:
branches:
- dev
- main
pull_request:
branches:
- dev
- main

env:
QSPPRED_TEST_EXTRAS: true
QSPRPRED_VERBOSE_LOGGING: true

jobs:
tests-all:
runs-on: ${{ matrix.os }}
timeout-minutes: 120
strategy:
matrix:
os: [ ubuntu-latest ] # FIXME: add macos-latest and windows-latest (removed for now due to limited debugging options)
python-version: [ '3.10' ]
fail-fast: false
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Set Up Dependencies
run: |
python -m pip cache purge
source .github/setup.sh ${{ runner.os }} $env
- name: Check Environment Info
run: |
echo "Clustal Omega version: $(clustalo --version)"
echo "MAFFT version: $(mafft --version)"
python -m pip freeze
python -c "print('Python version: ' + '$(python --version)')"
python -c "import platform; print('System info: ', platform.system(), platform.release())"
python -c "import qsprpred; print('QSPRpred version:', qsprpred.__version__)"
- name: Run pytest
run: cd testing/test_pytest && ./run.sh

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'testing/test_pytest/test_report.xml'

- name: Test CLI
run: cd testing/test_cli && ./run.sh

- name: Test Consistency
run: cd testing/test_consistency && ./run.sh

- name: Test Tutorials
run: cd testing/test_tutorial && ./run.sh
46 changes: 46 additions & 0 deletions .github/workflows/docs_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Deploy Documentation

on:
push:
branches:
- dev
- main

env:
CI_COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
CI_COMMIT_EMAIL: ${{ github.event.head_commit.author.email }}

jobs:
docs-build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Cache Python Environment
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}

- name: Set Up Dependencies
run: |
source .github/setup.sh ${{ runner.os }} $env
python -m pip install -r docs/requirements.txt
- name: Build and Deploy Documentation
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
cd docs && ./make.sh && REPO_URL=https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}.git ./upload.sh
67 changes: 67 additions & 0 deletions .github/workflows/pre_merge_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Python3.10 CI with Basic Tests

on:
push:
branches:
- '**' # all branches
- '!dev' # except dev
- '!main' # except main
- '!gh_pages' # except gh_pages

env:
QSPPRED_TEST_EXTRAS: false
QSPRPRED_VERBOSE_LOGGING: true

jobs:
tests-basic:
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
shell: bash

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Cache Python Environment
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/pyproject.toml') }}
# restore-keys: |
# ${{ runner.os }}-pip-

- name: Set Up Dependencies
run: |
source .github/setup.sh ${{ runner.os }} $env
- name: Check Environment Info
run: |
echo "Clustal Omega version: $(clustalo --version)"
echo "MAFFT version: $(mafft --version)"
python -m pip freeze
python -c "print('Python version: ' + '$(python --version)')"
python -c "import platform; print('System info: ', platform.system(), platform.release())"
python -c "import qsprpred; print('QSPRpred version:', qsprpred.__version__)"
- name: Run pytest
run: cd testing/test_pytest && ./run.sh

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'testing/test_pytest/test_report.xml'

- name: Test CLI
run: cd testing/test_cli && ./run.sh

- name: Test Consistency
run: cd testing/test_consistency && ./run.sh
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### QSPRpred Specific
/.*
!.github
!.gitignore
!.gitlab-ci.yml
!.pre-commit-config.yaml
Expand All @@ -11,9 +12,13 @@
*.gzip
*.tar.gz
*.out
/**/test_files/generated/
/**/tutorial/test_files/
/**/tutorial/cli_tutorial/
/**/tutorials/tutorial_data/papyrus/
/**/tutorials/tutorial_data/A2A_LIGANDS.tsv
/**/tutorials/tutorial_data/AR_LIGANDS.tsv
/**/tutorials/tutorial_data/AR_LIGANDS_pivot.tsv
/**/tutorials/tutorial_output

### Python template
# Byte-compiled / optimized / DLL files
Expand Down
62 changes: 22 additions & 40 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# This workflow will install Python dependencies, run tests, and write documentation

variables:
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
GIT_DEPTH: "0" # avoid shallow clone to give sonar all the info it needs
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
GIT_DEPTH: "0" # avoid shallow clone to give sonar all the info it needs

stages:
- test
- deploy
- test
- deploy

# Install python dependencies and run python tests with pytest and the CLI test script
.test:
stage: test
before_script:
- python --version # For debugging python version
- wget http://www.clustal.org/omega/clustalo-1.2.4-Ubuntu-x86_64 -O clustalo && chmod +x clustalo
- wget https://mafft.cbrc.jp/alignment/software/mafft-7.520-linux.tgz -O mafft.tgz && tar -xzvf mafft.tgz && chmod +x mafft-linux64/mafftdir/bin/mafft
- export PATH=$PATH:$PWD/mafft-linux64/mafftdir/bin/:$PWD
- export MAFFT_BINARIES=$PWD/mafft-linux64/mafftdir/libexec/
- clustalo --version # For debugging clustalo version
- mafft --version # For debugging mafft version
- python -m pip install ".[full]" --no-cache-dir
- python -c "import qsprpred; print(qsprpred.__version__)" # For debugging package version
- python -m pip install pytest
- python -m pip install jupyterlab
- python -m pip freeze # For debugging environment
script:
- pytest qsprpred
- cd clitest && ./run.sh
- cd ../tutorial && ./run_all.sh
stage: test
before_script:
- python --version # For debugging python version
- wget http://www.clustal.org/omega/clustalo-1.2.4-Ubuntu-x86_64 -O clustalo && chmod +x clustalo
- wget https://mafft.cbrc.jp/alignment/software/mafft-7.520-linux.tgz -O mafft.tgz && tar -xzvf mafft.tgz && chmod +x mafft-linux64/mafftdir/bin/mafft
- export PATH=$PATH:$PWD/mafft-linux64/mafftdir/bin/:$PWD
- export MAFFT_BINARIES=$PWD/mafft-linux64/mafftdir/libexec/
- clustalo --version # For debugging clustalo version
- mafft --version # For debugging mafft version
- pip install ".[full]" --no-cache-dir
- python -c "import qsprpred; print(qsprpred.__version__)" # For debugging package version
- pip install pytest
- pip install jupyterlab
- pip freeze # For debugging environment
script:
- cd testing && QSPPRED_TEST_SPLIT_UNITS=true QSPRPRED_VERBOSE_LOGGING=true ./run.sh

# # Run tests on Python version 11 (linux image)
# test:python3.11:
Expand All @@ -36,21 +34,5 @@ stages:

# Run tests on Python version 10 (linux image)
test:python3.10:
extends: .test
image: python:3.10

# Write documentation on main branch
pages:
stage: deploy
image: python:3.10
before_script:
- python -m pip install -U sphinx
- python -m pip install sphinx-rtd-theme
script:
- mkdir public
- sphinx-build -b html ./docs public
artifacts:
paths:
- public
only:
- main
extends: .test
image: python:3.10
Loading

0 comments on commit b28f843

Please sign in to comment.