Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adapt to new alphabase #82

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
16 changes: 7 additions & 9 deletions .github/workflows/_run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
required: true
type: string
jobs:
pre-commit:
run-tests:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -32,18 +32,16 @@ jobs:
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Perform pip installation
- name: Install mono
if: ${{ !contains(inputs.os, 'windows') }}
shell: bash -l {0}
run: |
cd misc
. ./${{ inputs.install-script }}
- name: Install additional dependencies required for testing
conda install mono
- name: Perform pip installation
shell: bash -l {0}
run: |
conda activate alpharaw
pip install matplotlib
pip install pytest nbmake==1.5.3
conda deactivate
cd misc
. ./${{ inputs.install-script }} alpharaw ${{ inputs.python-version }} ${{ !contains(inputs.os, 'windows') }}
- name: Run tests
shell: bash -l {0}
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/branch-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
uses: ./.github/workflows/_run_tests.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}
install-script: "loose_pip_install.sh"
install-script: pip_install.sh loose,tests
4 changes: 2 additions & 2 deletions .github/workflows/pip_installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
install-script: "stable_pip_install.sh"
install-script: pip_install.sh stable

loose_installation:
name: Test loose pip installation on ${{ matrix.os }}
Expand All @@ -37,4 +37,4 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
install-script: "loose_pip_install.sh"
install-script: pip_install.sh loose
1 change: 1 addition & 0 deletions alpharaw/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ def register_all_readers():
]
__extra_requirements__ = {
"development": "extra_requirements/development.txt",
"tests": "extra_requirements/tests.txt",
}
2 changes: 1 addition & 1 deletion docs/tutorials/ms_methods.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"\n",
"from alpharaw import thermo\n",
"import tempfile\n",
"from alphabase.test_data_downloader import DataShareDownloader\n",
"from alphabase.tools.data_downloader import DataShareDownloader\n",
"import os\n",
"import pandas as pd\n",
"import numpy as np\n",
Expand Down
13 changes: 0 additions & 13 deletions extra_requirements/development.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
pywin32; sys_platform=='win32'
pythonnet; sys_platform=='win32'

jupyter
twine
bumpversion
pipdeptree
ipykernel
tqdm
psutil
h5py
numba
pandas
numpy

# sphinx
autodocsumm
Expand All @@ -22,9 +14,4 @@ jinja2
contextfilter
furo

alphabase>=1.1.0
alphatims

pytest
pre-commit==3.7.0
nbmake==1.5.3
4 changes: 4 additions & 0 deletions extra_requirements/tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
matplotlib
pytest
nbmake==1.5.3
requests
5 changes: 0 additions & 5 deletions misc/loose_pip_install.sh

This file was deleted.

31 changes: 31 additions & 0 deletions misc/pip_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
### Install the package with a given type in a defined conda environment with a define python version,
### and call it to check if it works
### example usage:
### ./pip_install.sh stable my_env 3.9
set -e -u

INSTALL_TYPE=$1 # stable, loose, etc..
ENV_NAME=${2:-alpharaw}
PYTHON_VERSION=${3:-3.9}
INSTALL_MONO=${4:-false}


if [ "$INSTALL_MONO" = "true" ]; then
conda create -n $ENV_NAME python=$PYTHON_VERSION mono -y
else
conda create -n $ENV_NAME python=$PYTHON_VERSION -y
fi

if [ "$INSTALL_TYPE" = "loose" ]; then
INSTALL_STRING=""
else
INSTALL_STRING="[${INSTALL_TYPE}]"
fi

# print pip environment for reproducibility
conda run -n $ENV_NAME --no-capture-output pip freeze

# conda 'run' vs. 'activate', cf. https://stackoverflow.com/a/72395091
conda run -n $ENV_NAME --no-capture-output pip install -e "../.$INSTALL_STRING"
conda run -n $ENV_NAME --no-capture-output python -c "import alpharaw"
5 changes: 0 additions & 5 deletions misc/stable_pip_install.sh

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ sqlalchemy
pyteomics
lxml

alphabase>=1.1.0
alphabase>=1.5.0
alphatims
plotly
Empty file modified tests/run_tests.sh
100644 → 100755
Empty file.
Loading