-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
552 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow will lint python and cython files using pylint and cython, respectively | ||
# adapted from https://github.com/actions/starter-workflows/blob/main/ci/pylint.yml | ||
# Linting can be configured in pyproject.toml | ||
|
||
name: "Lint using pylint and cython-lint" | ||
|
||
on: | ||
push: | ||
branches: ["main", "dev"] | ||
pull_request: | ||
branches: ["main", "dev"] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: "Set up Python 3.12" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: pip | ||
- name: Install linters | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pylint cython-lint | ||
- name: Run lint | ||
run: | | ||
pylint $(git ls-files 'msyd/*.py') | ||
cython-lint --no-pycodestyle $(git ls-files '*.pyx') |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
|
||
# hacky way to hopefully alias the calls | ||
# normal alias does not seem to work in GitHub CI | ||
# necessary, as the hacky git install does not install the CLI entrypoints | ||
#echo "#!/bin/python" > syri | ||
#echo "import syri.scripts.syri;syri.scripts.syri.main()" >> syri | ||
#chmod +x ./syri | ||
#echo "minimap2.py" > ./minimap2 | ||
#chmod +x ./minimap2 | ||
#PATH=$PATH:./ | ||
#syri --version | ||
#minimap2 | ||
## run using source to preserve alias | ||
#source ./example/example_workflow.sh | ||
|
||
#$CONDA/bin/conda activate msyd | ||
$(tail -n +2 ./example/example_workflow.sh | sed -e 's/^syri/python <(echo "import syri.scripts.syri;syri.scripts.syri.main()")/' -e 's/^minimap2/.\/minimap2/' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This workflow will use the build action to build the msyd python package, and call the CLI interface to check the install worked | ||
name: Test build | ||
|
||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
|
||
# Cancel if a newer run is started | ||
# taken from https://github.com/nf-core/modules/blob/master/.github/workflows/nf-test.yml | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
# use old install manually | ||
# since switching to conda no longer supports different python version | ||
# - name: Build msyd | ||
# uses: schneebergerlab/msyd@main | ||
# # with: | ||
# # python-version: ${{ matrix.python-version }} | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: pip | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip setuptools | ||
shell: bash | ||
- name: Install SyRI manually | ||
run: | | ||
# manually install syris dependencies | ||
# the python version spoofing requires the --no-deps flag, so this is necessary | ||
pip install Cython numpy pandas scipy psutil igraph longestrunsubsequence pysam pulp | ||
# manually use pip to install syri from github, as it isn't on pypi | ||
# spoof python version to get around bounds check | ||
pip install 'git+https://github.com/schneebergerlab/syri.git' --python-version '3.10' --no-deps --no-warn-conflicts --target $(python -m site --user-site) | ||
shell: bash | ||
- name: Install other dependencies | ||
run: pip install -r requirements.txt | ||
shell: bash | ||
- name: Build msyd | ||
run: pip install . | ||
shell: bash | ||
- name: Test installation | ||
run: | | ||
msyd --version | ||
msyd -h | ||
msyd call -h | ||
msyd view -h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test example.sh | ||
|
||
on: | ||
# do not run, as the conda package is currently broken, | ||
# making getting the right environment not possible. | ||
# push: | ||
# branches: [ "main", "dev" ] | ||
# pull_request: | ||
# branches: [ "main", "dev" ] | ||
|
||
# Cancel if a newer run is started | ||
# taken from https://github.com/nf-core/modules/blob/master/.github/workflows/nf-test.yml | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build msyd | ||
uses: schneebergerlab/msyd@main | ||
# with: | ||
# python-version: "3.12" | ||
# - name: Install minimap2 manually # conda doesn't seem to work | ||
# run: | | ||
# curl -L https://github.com/lh3/minimap2/releases/download/v2.28/minimap2-2.28_x64-linux.tar.bz2 | tar -jxvf - | ||
# mv minimap2-2.28_x64-linux\/minimap2 ./ | ||
# ./minimap2 -h # test it worked & is callable | ||
- name: Test example_run.sh | ||
run: ./.github/workflows/run_test_example.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# adapted from https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Build msyd | ||
description: "Checks out, installs dependencies and builds the msyd package. Formulated as a composite action to reduce code duplication in testing. Composite workflows cannot perserve state. Currently broken b/c of a version bound in the SyRI conda package." | ||
|
||
#inputs: | ||
# python-version: | ||
# description: 'Python version to use' | ||
# required: true | ||
# default: '3.12' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Set up Python ${{ inputs.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
cache: pip | ||
# - name: Update pip | ||
# run: python -m pip install --upgrade pip setuptools | ||
# shell: bash | ||
# - name: Install SyRI manually | ||
# run: | | ||
# # manually install syris dependencies | ||
# # the python version spoofing requires the --no-deps flag, so this is necessary | ||
# pip install Cython numpy pandas scipy psutil igraph longestrunsubsequence pysam pulp | ||
# # manually use pip to install syri from github, as it isn't on pypi | ||
# # spoof python version to get around bounds check | ||
# pip install 'git+https://github.com/schneebergerlab/syri.git' --python-version '3.10' --no-deps --no-warn-conflicts --target $(python -m site --user-site) | ||
# shell: bash | ||
# - name: Install other dependencies | ||
# run: pip install -r requirements.txt | ||
# shell: bash | ||
- name: Setup conda env, install msyd | ||
run: | | ||
#$CONDA/bin/conda init | ||
#source ~/.bashrc | ||
#$CONDA/bin/conda env create -n msyd --file ./environment.yml | ||
#$CONDA/bin/conda activate msyd | ||
conda env update -n base --file ./environment.yml | ||
shell: bash | ||
# python -m pip install mappy | ||
- name: Build msyd | ||
run: pip install . | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
channels: | ||
- conda-forge | ||
- bioconda | ||
dependencies: | ||
- bioconda::syri=1.7.0 | ||
- bioconda::minimap2=2.1.1 | ||
- bioconda::mappy=2.28 | ||
- conda-forge::cython=3.0.11 | ||
- conda-forge::intervaltree=3.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.