From 610ad3f1a9399ad48f5bdf46da927c467660806c Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:47:15 +0100 Subject: [PATCH 01/29] move to .bumpversion.toml --- .bumpversion.toml | 54 +++++++++++++++++++++++ .pre-commit-config.yaml | 2 - misc/.bumpversion.cfg | 36 --------------- pyproject.toml | 2 +- requirements/requirements_development.txt | 2 +- 5 files changed, 56 insertions(+), 40 deletions(-) create mode 100644 .bumpversion.toml delete mode 100644 misc/.bumpversion.cfg diff --git a/.bumpversion.toml b/.bumpversion.toml new file mode 100644 index 00000000..988c36f0 --- /dev/null +++ b/.bumpversion.toml @@ -0,0 +1,54 @@ +[tool.bumpversion] +current_version = "1.9.2" +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" +serialize = ["{major}.{minor}.{patch}"] +search = "{current_version}" +replace = "{new_version}" +regex = false +ignore_missing_version = false +ignore_missing_files = false +tag = false +sign_tags = false +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = true +message = "Bump version: {current_version} → {new_version}" +commit_args = "" +setup_hooks = [] +pre_commit_hooks = [] +post_commit_hooks = [] + + +[[tool.bumpversion.files]] +filename = "./alphadia/__init__.py" + +[[tool.bumpversion.files]] +filename = "./gui/src/main/modules/profile.js" + +[[tool.bumpversion.files]] +filename = "./gui/package.json" + +[[tool.bumpversion.files]] +filename = "./release/macos/info.plist" + +[[tool.bumpversion.files]] +filename = "./release/linux/build_installer_linux.sh" + +[[tool.bumpversion.files]] +filename = "./release/linux/control" + +[[tool.bumpversion.files]] +filename = "./release/macos/build_installer_macos.sh" + +[[tool.bumpversion.files]] +filename = "./release/macos/build_package_macos.sh" + +[[tool.bumpversion.files]] +filename = "./release/macos/distribution.xml" + +[[tool.bumpversion.files]] +filename = "./release/windows/alphadia_innoinstaller.iss" + +[[tool.bumpversion.files]] +filename = "./release/windows/build_installer_windows.ps1" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b64f17a2..cfefafb7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,5 +13,3 @@ repos: - id: ruff-format - id: ruff args: [ '--fix' ] - -exclude: .bumpversion.cfg diff --git a/misc/.bumpversion.cfg b/misc/.bumpversion.cfg deleted file mode 100644 index 1aa88e0f..00000000 --- a/misc/.bumpversion.cfg +++ /dev/null @@ -1,36 +0,0 @@ -[bumpversion] -current_version = 1.9.2 -commit = True -tag = True -parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? -serialize = - {major}.{minor}.{patch} - {major}.{minor}.{patch} - -[bumpversion:part:release] - -[bumpversion:part:build] - -[bumpversion:file:../alphadia/__init__.py] - -[bumpversion:file:../gui/src/main/modules/profile.js] - -[bumpversion:file:../gui/package.json] - -[bumpversion:file:../release/macos/info.plist] - -[bumpversion:file:../release/linux/build_installer_linux.sh] - -[bumpversion:file:../release/linux/control] - -[bumpversion:file:../release/macos/build_installer_macos.sh] - -[bumpversion:file:../release/macos/build_package_macos.sh] - -[bumpversion:file:../release/macos/distribution.xml] - -[bumpversion:file:../release/windows/alphadia_innoinstaller.iss] - -[bumpversion:file:../release/windows/build_installer_windows.ps1] -search = {current_version} -replace = {new_version} diff --git a/pyproject.toml b/pyproject.toml index 711b3bf1..2a687c89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,7 +60,7 @@ version = {attr = "alphadia.__version__"} alphadia = "alphadia.cli:run" [tool.ruff] -extend-exclude = ["misc/.bumpversion.cfg", "tests"] +extend-exclude = ["tests"] [tool.ruff.lint] select = [ diff --git a/requirements/requirements_development.txt b/requirements/requirements_development.txt index 9c13e1b2..9e6c618d 100644 --- a/requirements/requirements_development.txt +++ b/requirements/requirements_development.txt @@ -5,7 +5,7 @@ jupyter_contrib_nbextensions pyinstaller twine -bumpversion +bump-my-version pipdeptree ipykernel psutil From e6d6cd577c9b17be190f2ab195f888beb6beb6fb Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:17:46 +0100 Subject: [PATCH 02/29] include dev versions --- .bumpversion.toml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index 988c36f0..92364c61 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,7 +1,19 @@ [tool.bumpversion] current_version = "1.9.2" -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" -serialize = ["{major}.{minor}.{patch}"] +parse = """(?x) + (?P0|[1-9]\\d*)\\. + (?P0|[1-9]\\d*)\\. + (?P0|[1-9]\\d*) + (?: + - # dash separator for pre-release section + (?P[a-zA-Z-]+) # pre_l: pre-release label + (?P0|[1-9]\\d*) # pre_n: pre-release version number + )? # pre-release section is optional +""" +serialize = [ + "{major}.{minor}.{patch}-{pre_l}{pre_n}", + "{major}.{minor}.{patch}", +] search = "{current_version}" replace = "{new_version}" regex = false @@ -19,6 +31,9 @@ setup_hooks = [] pre_commit_hooks = [] post_commit_hooks = [] +[tool.bumpversion.parts.pre_l] +values = ["dev", "final"] +optional_value = "final" [[tool.bumpversion.files]] filename = "./alphadia/__init__.py" From 3cc33d54ef3c2eb733bb2d3f703461fbdc338be2 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:19:34 +0100 Subject: [PATCH 03/29] add bump version workflow --- .github/workflows/bump_version.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/bump_version.yml diff --git a/.github/workflows/bump_version.yml b/.github/workflows/bump_version.yml new file mode 100644 index 00000000..03035f8e --- /dev/null +++ b/.github/workflows/bump_version.yml @@ -0,0 +1,24 @@ +# Bump the version for releases +# Requires a .bumpversion.toml file in the root of the repository +name: Bump version + +on: + workflow_dispatch: + inputs: + bump_type: + description: 'Bump type' + required: true + default: 'patch' + type: choice + options: + - prerelease + - patch + - minor + - major + +jobs: + bump-version: + uses: MannLabs/alphashared/.github/workflows/bump_version.yml@v1 + secrets: inherit + with: + bump_type: ${{inputs.bump_type}} From 4931b5dfedc8aa152eba3d11c93f1132c039de56 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 14 Jan 2025 12:29:07 +0100 Subject: [PATCH 04/29] adapt to latest workflow --- .github/workflows/publish_on_pypi.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish_on_pypi.yml b/.github/workflows/publish_on_pypi.yml index 4a538d6f..91fb072f 100644 --- a/.github/workflows/publish_on_pypi.yml +++ b/.github/workflows/publish_on_pypi.yml @@ -16,6 +16,7 @@ jobs: # see the documentation of the workflow for more information on the parameters package_name: alphadia tag_to_release: ${{ inputs.tag_to_release }} + test_stable: true secrets: test_pypi_api_token: ${{ secrets.TEST_PYPI_API_TOKEN }} pypi_api_token: ${{ secrets.PYPI_API_TOKEN }} From 187647424d14919fb9ee4f0fb3578f2f51d2744f Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:47:21 +0100 Subject: [PATCH 05/29] improve docs --- .bumpversion.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.bumpversion.toml b/.bumpversion.toml index 92364c61..f18e425a 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -32,6 +32,7 @@ pre_commit_hooks = [] post_commit_hooks = [] [tool.bumpversion.parts.pre_l] +# 'final' is just a dummy, but required to have the versioning compatible with the reusable alphashared workflow values = ["dev", "final"] optional_value = "final" From a5a4a0522ee9ea001874657d755d37d28de0dcbb Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:58:58 +0100 Subject: [PATCH 06/29] fix building wheels for prereleases --- release/linux/build_installer_linux.sh | 4 +++- release/macos/build_installer_macos.sh | 5 ++++- release/windows/build_installer_windows.ps1 | 5 ++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/release/linux/build_installer_linux.sh b/release/linux/build_installer_linux.sh index 35703bad..151131fd 100755 --- a/release/linux/build_installer_linux.sh +++ b/release/linux/build_installer_linux.sh @@ -10,7 +10,9 @@ rm -rf dist build *.egg-info rm -rf dist_pyinstaller build_pyinstaller python -m build -pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" +# substitute X.Y.Z-devN with X.Y.Z.devN +WHL_NAME=$(echo "alphadia-1.9.2-py3-none-any.whl" | sed 's/\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)-dev\([0-9][0-9]*\)/\1.dev\2/g') +pip install "dist/${WHL_NAME}[stable]" if [ "${CPU_OR_GPU}" != "GPU" ]; then pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu diff --git a/release/macos/build_installer_macos.sh b/release/macos/build_installer_macos.sh index 0fd02708..33ab0170 100755 --- a/release/macos/build_installer_macos.sh +++ b/release/macos/build_installer_macos.sh @@ -10,7 +10,10 @@ rm -rf dist_pyinstaller build_pyinstaller export EAGER_IMPORT=true # TODO check if this can be removed with newset peptdeep version w/out transformer dependenc python -m build -pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" + +# substitute X.Y.Z-devN with X.Y.Z.devN +WHL_NAME=$(echo "alphadia-1.9.2-py3-none-any.whl" | sed 's/\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)-dev\([0-9][0-9]*\)/\1.dev\2/g') +pip install "dist/${WHL_NAME}[stable]" # Creating the stand-alone pyinstaller folder pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/windows/build_installer_windows.ps1 b/release/windows/build_installer_windows.ps1 index 1123d75f..08ed15b2 100644 --- a/release/windows/build_installer_windows.ps1 +++ b/release/windows/build_installer_windows.ps1 @@ -5,7 +5,10 @@ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist python -m build -pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" + +# substitute X.Y.Z-devN with X.Y.Z.devN +$WHL_NAME = "alphadia-1.9.2-py3-none-any.whl" -replace '(\d+\.\d+\.\d+)-dev(\d+)', '$1.dev$2' +pip install "dist/$WHL_NAME[stable]" # Creating the stand-alone pyinstaller folder pip install tbb==2021.13.1 From e3d497de5e1ecef3224affc9ac05c5e67f34b59e Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:09:43 +0100 Subject: [PATCH 07/29] rename requirements: tests -> tests --- .github/workflows/branch-checks.yaml | 2 +- .github/workflows/fdr_performance.yml | 2 +- .github/workflows/pip_installation.yml | 2 +- pyproject.toml | 12 ++++++++---- requirements/requirements_development.txt | 2 +- ...{requirements_test.txt => requirements_tests.txt} | 0 6 files changed, 12 insertions(+), 8 deletions(-) rename requirements/{requirements_test.txt => requirements_tests.txt} (100%) diff --git a/.github/workflows/branch-checks.yaml b/.github/workflows/branch-checks.yaml index 90677094..fb87725b 100644 --- a/.github/workflows/branch-checks.yaml +++ b/.github/workflows/branch-checks.yaml @@ -25,7 +25,7 @@ jobs: with: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} - install-script: ./pip_install.sh stable,test + install-script: ./pip_install.sh stable,tests test-script: ./run_unit_tests.sh get-code-review-input: diff --git a/.github/workflows/fdr_performance.yml b/.github/workflows/fdr_performance.yml index 33d7a98d..b1574fec 100644 --- a/.github/workflows/fdr_performance.yml +++ b/.github/workflows/fdr_performance.yml @@ -35,7 +35,7 @@ jobs: shell: bash -l {0} run: | cd misc - . ./pip_install.sh stable,test + . ./pip_install.sh stable,tests - name: Run legacy classifier env: # Or as an environment variable NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_FDR_TOKEN }} diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 4f7711f4..b82f9f26 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -30,7 +30,7 @@ jobs: with: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} - install-script: ./pip_install.sh stable,test + install-script: ./pip_install.sh stable,tests test-script: ./run_unit_tests.sh run-unit-tests-loose: diff --git a/pyproject.toml b/pyproject.toml index 794d7fd2..e87a1cfe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,10 +50,14 @@ find = {} [tool.setuptools.dynamic] # https://stackoverflow.com/a/73600610 dependencies = {file = ["requirements/requirements_loose.txt"]} -optional-dependencies = { stable = { file = ["requirements/requirements.txt", -] }, test = { file = [ "requirements/requirements_test.txt", -] }, development = { file = ["requirements/requirements_development.txt", "requirements/requirements_test.txt", "requirements/requirements_docs.txt" -] }} +optional-dependencies.stable = { file = ["requirements/requirements.txt"] } +optional-dependencies.tests = { file = ["requirements/requirements_test.txt"] } +optional-dependencies.docs = { file = ["requirements/requirements_docs.txt"] } +optional-dependencies.development = { file = [ + "requirements/requirements_development.txt", + "requirements/requirements_test.txt", + "requirements/requirements_docs.txt"] } + version = {attr = "alphadia.__version__"} [project.scripts] diff --git a/requirements/requirements_development.txt b/requirements/requirements_development.txt index 9c13e1b2..0b4bc8c7 100644 --- a/requirements/requirements_development.txt +++ b/requirements/requirements_development.txt @@ -1,5 +1,5 @@ # Dependencies required for developing alphaDIA -# Also, `requirements_test.txt` and `requirements_docs.txt` are required for developing +# Also, `requirements_tests.txt` and `requirements_docs.txt` are required for developing jupyter jupyter_contrib_nbextensions pyinstaller diff --git a/requirements/requirements_test.txt b/requirements/requirements_tests.txt similarity index 100% rename from requirements/requirements_test.txt rename to requirements/requirements_tests.txt From 59a20b4e6bf174b179d670ef882d3510aeaa278b Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:09:55 +0100 Subject: [PATCH 08/29] fix readthedocs --- .readthedocs.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index c3b9ee8f..2ec64484 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -12,4 +12,7 @@ sphinx: # Explicitly set the version of Python and its requirements python: install: - - requirements: requirements/requirements_docs.txt + - method: pip + path: . + extra_requirements: + - docs From ad1a90ae791f13c31cce13d7ba1f74d327c66f18 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:10:23 +0100 Subject: [PATCH 09/29] update Readme --- docs/installation.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 6fada45c..6afe58cf 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -69,18 +69,14 @@ See also the [developer guide](developer_guide.md) for more information on how t ### 1. Setting up the repository -Navigate to a folder where you would like to install alphaDIA and - download the alphaDIA repository. This creates a subfolder `alphadia` in your current directory +Navigate to a folder where you would like to set up the repository and execute ```bash -cd ~/work/search_engines -git clone git@github.com:MannLabs/alphadia.git -cd alphadia +git clone git@github.com:MannLabs/alphadia.git && cd alphadia ``` -Optionally, to get the latest features, switch to the `development` branch and pull the most recent version +Optionally, get the code version of the latest tag (corresponding to the latest (pre)release): ```bash -git switch development -git pull +git fetch --tags && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) ``` ### 2. Installation: backend From 36ca9b5f741774274eca4376e45dfd08d49bb91c Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:25:26 +0100 Subject: [PATCH 10/29] add build_wheel.sh --- release/common/build_wheel.sh | 12 ++++++++++++ release/linux/build_installer_linux.sh | 6 +++--- release/macos/build_installer_macos.sh | 8 ++++---- release/windows/build_installer_windows.ps1 | 11 ++++++----- 4 files changed, 25 insertions(+), 12 deletions(-) create mode 100755 release/common/build_wheel.sh diff --git a/release/common/build_wheel.sh b/release/common/build_wheel.sh new file mode 100755 index 00000000..46192117 --- /dev/null +++ b/release/common/build_wheel.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -e -u + +# Build the wheel for all os (on a linux runner). +# This script must be run from the root of the repository. +# If you want OS-specific wheels, add the respective scripts to the OS-specific folders, +# the alphashared workflow will use those then: +# e.g. release/linux/build_wheel_linux.sh + +rm -rf dist ./*.egg-info + +python -m build diff --git a/release/linux/build_installer_linux.sh b/release/linux/build_installer_linux.sh index 35703bad..66a661e6 100755 --- a/release/linux/build_installer_linux.sh +++ b/release/linux/build_installer_linux.sh @@ -5,12 +5,12 @@ CPU_OR_GPU=${1:-CPU} # Build the installer for Linux. # This script must be run from the root of the repository. +# Prerequisites: wheel has been build, e.g. using build_wheel.sh -rm -rf dist build *.egg-info rm -rf dist_pyinstaller build_pyinstaller -python -m build -pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" +WHL_NAME=$(cd dist && ls ./*.whl && cd ..) +pip install "dist/${WHL_NAME}[stable]" if [ "${CPU_OR_GPU}" != "GPU" ]; then pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu diff --git a/release/macos/build_installer_macos.sh b/release/macos/build_installer_macos.sh index 0fd02708..eb4a8b8e 100755 --- a/release/macos/build_installer_macos.sh +++ b/release/macos/build_installer_macos.sh @@ -3,14 +3,14 @@ set -e -u # Build the installer for MacOS. # This script needs to be run from the root of the repository. +# Prerequisites: wheel has been build, e.g. using build_wheel.sh -rm -rf dist build *.egg-info rm -rf dist_pyinstaller build_pyinstaller -export EAGER_IMPORT=true # TODO check if this can be removed with newset peptdeep version w/out transformer dependenc +export EAGER_IMPORT=true # TODO check if this can be removed with newest peptdeep version w/out transformer dependency -python -m build -pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" +WHL_NAME=$(cd dist && ls ./*.whl && cd ..) +pip install "dist/${WHL_NAME}[stable]" # Creating the stand-alone pyinstaller folder pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y diff --git a/release/windows/build_installer_windows.ps1 b/release/windows/build_installer_windows.ps1 index 1123d75f..6b019f46 100644 --- a/release/windows/build_installer_windows.ps1 +++ b/release/windows/build_installer_windows.ps1 @@ -1,12 +1,13 @@ # Build the installer for Windows. # This script must be run from the root of the repository. +# Prerequisites: wheel has been build, e.g. using build_wheel.sh -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build -Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build_pyinstaller +Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist_pyinstaller -python -m build -pip install "dist/alphadia-1.9.2-py3-none-any.whl[stable]" +$WHL_NAME = (Get-ChildItem -Path "dist" -Filter "*.whl").Name +pip install "dist/$WHL_NAME[stable]" # Creating the stand-alone pyinstaller folder -pip install tbb==2021.13.1 +pip install tbb==2021.13.1 # TODO check if this is necessary pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y From e24bbacabfe0a452210c5c0376557595a7699838 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:28:52 +0100 Subject: [PATCH 11/29] remove development branch --- .github/workflows/e2e_testing.yml | 2 +- .github/workflows/fdr_performance.yml | 2 +- .github/workflows/pip_installation.yml | 2 +- tests/e2e_tests/e2e_slurm.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 0ab2bd0d..1e1a6743 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -2,7 +2,7 @@ on: pull_request: types: [ labeled ] push: - branches: [ main, development ] + branches: [ main ] workflow_dispatch: name: End to end testing diff --git a/.github/workflows/fdr_performance.yml b/.github/workflows/fdr_performance.yml index b1574fec..801a31b4 100644 --- a/.github/workflows/fdr_performance.yml +++ b/.github/workflows/fdr_performance.yml @@ -2,7 +2,7 @@ on: pull_request: types: [ labeled ] push: - branches: [ main, development ] + branches: [ main ] workflow_dispatch: name: FDR performance test diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index b82f9f26..ac66e262 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -8,7 +8,7 @@ on: push: - branches: [ main, development ] + branches: [ main ] pull_request: branches: [ main ] workflow_dispatch: diff --git a/tests/e2e_tests/e2e_slurm.sh b/tests/e2e_tests/e2e_slurm.sh index ee4db7e8..34f17828 100644 --- a/tests/e2e_tests/e2e_slurm.sh +++ b/tests/e2e_tests/e2e_slurm.sh @@ -13,7 +13,7 @@ # input parameters: CONDA_ENV=alphadia -BRANCH=development # branch to take test cases from +BRANCH=main # branch to take test cases from TEST_CASE=basic # From f39f7a45c31b276a121d0dd3ef66614e3dc92bd5 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:35:48 +0100 Subject: [PATCH 12/29] allow to run e2e cases manually --- .github/workflows/e2e_testing.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 1e1a6743..f367c9cd 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -1,3 +1,5 @@ +name: End to end testing + on: pull_request: types: [ labeled ] @@ -5,7 +7,11 @@ on: branches: [ main ] workflow_dispatch: -name: End to end testing +inputs: + test_case: + description: 'Test case to run (see e2e_test_cases.yaml for available cases), "all" to run all test cases.' + required: false + default: 'all' jobs: end2end_testing: @@ -28,23 +34,24 @@ jobs: TQDM_MININTERVAL: 10 # avoid lots of tqdm outputs steps: - uses: actions/checkout@v4 - - name: Conda info - shell: bash -el {0} - run: conda info + if: ${{ inputs.test_case == 'all' || matrix.test_case == inputs.test_case }} - name: Pip installation with stable dependencies id: pip_installation + if: ${{ inputs.test_case == 'all' || matrix.test_case == inputs.test_case }} shell: bash -el {0} run: | + conda info cd misc . ./pip_install.sh stable $RUN_NAME - name: Run e2e tests + if: ${{ inputs.test_case == 'all' || matrix.test_case == inputs.test_case }} shell: bash -el {0} run: | cd tests . ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME True ${GITHUB_SHA::7} $BRANCH_NAME - name: Cleanup if: always() - shell: bash -el {0} + shell: bash -l {0} run: | conda remove -n $RUN_NAME --all -y - name: Delete Caches on Error From 949c273e18dd8f34f65f48eb76c2c9c9d9df004b Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:38:21 +0100 Subject: [PATCH 13/29] allow to run e2e cases manually --- .github/workflows/e2e_testing.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index f367c9cd..4c8ea7cf 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -6,12 +6,11 @@ on: push: branches: [ main ] workflow_dispatch: - -inputs: - test_case: - description: 'Test case to run (see e2e_test_cases.yaml for available cases), "all" to run all test cases.' - required: false - default: 'all' + inputs: + test_case: + description: 'Test case to run (see e2e_test_cases.yaml for available cases), "all" to run all test cases.' + required: false + default: 'all' jobs: end2end_testing: From dfb5a4047d9cc2f4c28ab3339b41644ad2dc7d3d Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:44:35 +0100 Subject: [PATCH 14/29] allow to run e2e cases manually --- .github/workflows/e2e_testing.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 4c8ea7cf..0356092f 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -13,15 +13,29 @@ on: default: 'all' jobs: + determine_test_cases: + runs-on: ubuntu-latest + outputs: + test_cases: ${{ steps.set-matrix.outputs.test_cases }} + steps: + - id: set-matrix + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.test_case }}" != "all" ]; then + echo "test_cases=[\"${{ github.event.inputs.test_case }}\"]" >> $GITHUB_OUTPUT + else + # NEW TEST CASES ARE ADDED HERE: + echo 'test_cases=["basic", "synchropasef", "astral", "astral_automatic_calibration", "multistep"]' >> $GITHUB_OUTPUT + fi + end2end_testing: name: End to end test + needs: determine_test_cases runs-on: self-hosted if: contains(github.event.pull_request.labels.*.name, 'test:e2e') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: - # test case name as defined in e2e_test_cases.yaml - test_case: [ "basic", "synchropasef", "astral", "astral_automatic_calibration", "multistep"] + test_case: ${{ fromJson(needs.determine_test_cases.outputs.test_cases) }} env: RUN_NAME: alphadia-${{github.sha}}-${{github.run_id}}-${{github.run_attempt}} BRANCH_NAME: ${{ github.head_ref || github.ref_name }} @@ -33,21 +47,18 @@ jobs: TQDM_MININTERVAL: 10 # avoid lots of tqdm outputs steps: - uses: actions/checkout@v4 - if: ${{ inputs.test_case == 'all' || matrix.test_case == inputs.test_case }} - name: Pip installation with stable dependencies id: pip_installation - if: ${{ inputs.test_case == 'all' || matrix.test_case == inputs.test_case }} shell: bash -el {0} run: | conda info cd misc . ./pip_install.sh stable $RUN_NAME - name: Run e2e tests - if: ${{ inputs.test_case == 'all' || matrix.test_case == inputs.test_case }} shell: bash -el {0} run: | cd tests - . ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME True ${GITHUB_SHA::7} $BRANCH_NAME + . ./run_e2e_tests.sh ${{ matrix.test_case }} $RUN_NAME True ${GITHUB_SHA::7} $BRANCH_NAME - name: Cleanup if: always() shell: bash -l {0} From f2615d59291ffa191dbb97f8e1dc35bd3538db5b Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:51:12 +0100 Subject: [PATCH 15/29] don't run all tests on PRs to main --- .github/workflows/pip_installation.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index ac66e262..2852dec2 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -1,16 +1,13 @@ # Perform pip installation (stable, loose) and run tests on all three OS # For feature branches, we don't test the full matrix (os x [stable, loose]) in order to save time & resources. -# On each push to develop, the whole test matrix runs, additionally, its success is mandatory for merging to main. +# On each push to main, the whole test matrix runs. # In the (assumed to be rare case) that these full matrix tests fail but the reduced matrix tests passed, -# we will learn about it latest before pushing to main. The merge that caused the issue can then be identified -# from the tests that ran on develop. +# we will learn about it latest after pushing to main. on: push: branches: [ main ] - pull_request: - branches: [ main ] workflow_dispatch: name: Pip install + unit tests From 6268dd18c65af801ccc160f0cd0264926cbc2cff Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:53:12 +0100 Subject: [PATCH 16/29] run e2e only daily --- .github/workflows/e2e_testing.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 0356092f..25f0f2dd 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -3,8 +3,10 @@ name: End to end testing on: pull_request: types: [ labeled ] - push: - branches: [ main ] +# push: +# branches: [ main ] + schedule: + - cron: "0 0 0 * * *" # daily on 12:00 AM workflow_dispatch: inputs: test_case: From 15dffb45ac3a72a7251d741f999e8329a9f28352 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 10:56:11 +0100 Subject: [PATCH 17/29] change strategy to fail-fast: false --- .github/workflows/pip_installation.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 2852dec2..66b7fa81 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -20,6 +20,7 @@ jobs: run-unit-tests-stable: name: Test 'stable' on ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-13, windows-latest] python-version: ["3.10", "3.11", "3.12"] @@ -33,6 +34,7 @@ jobs: run-unit-tests-loose: name: Test 'loose' on ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ ubuntu-latest, macos-13, windows-latest ] python-version: ["3.10", "3.11", "3.12"] @@ -40,5 +42,5 @@ jobs: with: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} - install-script: ./pip_install.sh test + install-script: ./pip_install.sh tests test-script: ./run_unit_tests.sh From 0b7d34fec3f391ff3c237dd6b93a56ff3cbb5e3a Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:38:32 +0100 Subject: [PATCH 18/29] fix tests --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e87a1cfe..90c3e9ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ find = {} # https://stackoverflow.com/a/73600610 dependencies = {file = ["requirements/requirements_loose.txt"]} optional-dependencies.stable = { file = ["requirements/requirements.txt"] } -optional-dependencies.tests = { file = ["requirements/requirements_test.txt"] } +optional-dependencies.tests = { file = ["requirements/requirements_tests.txt"] } optional-dependencies.docs = { file = ["requirements/requirements_docs.txt"] } optional-dependencies.development = { file = [ "requirements/requirements_development.txt", From 7bb2e3d5b5fef90dc207f88ea51ac74f1bcaef73 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:38:46 +0100 Subject: [PATCH 19/29] remove performance_testing workflow --- .github/workflows/performance_testing.yml | 30 ----------------------- 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/performance_testing.yml diff --git a/.github/workflows/performance_testing.yml b/.github/workflows/performance_testing.yml deleted file mode 100644 index 6338ef35..00000000 --- a/.github/workflows/performance_testing.yml +++ /dev/null @@ -1,30 +0,0 @@ -on: - pull_request: - branches: - - 'alpha' - workflow_dispatch: - -name: Performance test - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -env: - TEST_DATA_DIR: C:\actions-runner\_data - CONDA: C:\Users\wallmann\Miniconda3 - NEPTUNE_TOKEN: ${{ secrets.NEPTUNE_TOKEN }} - -jobs: - performance_testing: - name: Performance testing - runs-on: self-hosted - - steps: - - uses: actions/checkout@v3 - - name: Install alphadia - run: | - conda activate alpha - - name: Diann re extraction - run: | - python tests/performance_tests/1_brunner_2022_1ng_all.py From 89b3854e1e88975eb553ceb35e1dee3ae6a55d35 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:38:57 +0100 Subject: [PATCH 20/29] remove tbb dependency for windows installer --- release/windows/build_installer_windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/windows/build_installer_windows.ps1 b/release/windows/build_installer_windows.ps1 index 6b019f46..96e98c81 100644 --- a/release/windows/build_installer_windows.ps1 +++ b/release/windows/build_installer_windows.ps1 @@ -9,5 +9,5 @@ $WHL_NAME = (Get-ChildItem -Path "dist" -Filter "*.whl").Name pip install "dist/$WHL_NAME[stable]" # Creating the stand-alone pyinstaller folder -pip install tbb==2021.13.1 # TODO check if this is necessary +# pip install tbb==2021.13.1 # TODO check if this is necessary pyinstaller release/pyinstaller/alphadia.spec --distpath dist_pyinstaller --workpath build_pyinstaller -y From abeec9abe0aef686e72de560178791ca6d4a184d Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:52:11 +0100 Subject: [PATCH 21/29] fix output_path being None --- alphadia/search_step.py | 2 +- alphadia/workflow/config.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/alphadia/search_step.py b/alphadia/search_step.py index 4b40ca9f..4cbcfeb6 100644 --- a/alphadia/search_step.py +++ b/alphadia/search_step.py @@ -122,7 +122,7 @@ def _init_config( config.update(config_updates, do_print=True) - if ConfigKeys.OUTPUT_DIRECTORY not in config: + if config.get(ConfigKeys.OUTPUT_DIRECTORY, None) is None: config[ConfigKeys.OUTPUT_DIRECTORY] = output_folder config.to_yaml(os.path.join(output_folder, "frozen_config.yaml")) diff --git a/alphadia/workflow/config.py b/alphadia/workflow/config.py index 378ed2c6..c1ce539e 100644 --- a/alphadia/workflow/config.py +++ b/alphadia/workflow/config.py @@ -14,6 +14,7 @@ import yaml +from alphadia.constants.keys import ConfigKeys from alphadia.exceptions import KeyAddedConfigError, TypeMismatchConfigError logger = logging.getLogger() @@ -51,7 +52,9 @@ def to_json(self, path: str) -> None: json.dump(self.data, f) def __setitem__(self, key, item): - raise NotImplementedError("Use update() to update the config.") + if key != ConfigKeys.OUTPUT_DIRECTORY: + raise NotImplementedError("Use update() to update the config.") + return super().__setitem__(key, item) def __delitem__(self, key): raise NotImplementedError("Use update() to update the config.") From de1da63ed9ad9548de95238310b0559654378157 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 11:54:02 +0100 Subject: [PATCH 22/29] fix debug notebook --- nbs/debug/debug_lvl1.ipynb | 89 ++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 32 deletions(-) diff --git a/nbs/debug/debug_lvl1.ipynb b/nbs/debug/debug_lvl1.ipynb index b5140001..5c5d2b97 100644 --- a/nbs/debug/debug_lvl1.ipynb +++ b/nbs/debug/debug_lvl1.ipynb @@ -5,15 +5,13 @@ "metadata": {}, "source": [ "# Debugging notebook for alphaDIA\n", - "THis notebooks allows you to run a search in a jupyter notebook and debug the results.\n", + "This notebooks allows you to run a search in a jupyter notebook and debug the results.\n", "It allows you to debug a search on the workflow level as well on the peakgroup level" ] }, { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "%reload_ext autoreload\n", "%autoreload 2\n", @@ -30,13 +28,13 @@ "os.environ[\"NUMBA_BOUNDSCHECK\"] = \"1\"\n", "os.environ[\"NUMBA_DEVELOPER_MODE\"] = \"1\"\n", "os.environ[\"NUMBA_FULL_TRACEBACKS\"] = \"1\"" - ] + ], + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "import tempfile\n", "\n", @@ -67,13 +65,13 @@ "\n", "library_path = DataShareDownloader(library_url,test_folder).download()\n", "raw_data_path_list = [DataShareDownloader(url,test_folder).download() for url in raw_data_url_list]" - ] + ], + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "config = {\n", " \"general\": {\n", @@ -86,26 +84,29 @@ " \"target_ms1_tolerance\": 4,\n", " \"target_ms2_tolerance\": 7,\n", " \"target_rt_tolerance\": 200,\n", - " }\n", + " },\n", + " \"raw_paths\": raw_data_path_list,\n", + " \"library_path\": library_path,\n", "}\n", - "step = search_step.SearchStep(test_folder, raw_data_path_list, library_path, config=config)" - ] + "output_folder = test_folder + \"/output\"\n", + "step = search_step.SearchStep(output_folder, config=config)" + ], + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "for raw_name, dia_path, speclib in step.get_run_data():\n", " pass" - ] + ], + "outputs": [], + "execution_count": null }, { "metadata": {}, "cell_type": "code", - "outputs": [], - "execution_count": null, "source": [ "workflow = peptidecentric.PeptideCentricWorkflow(\n", " raw_name,\n", @@ -113,31 +114,31 @@ ")\n", "workflow.load(dia_path, speclib)\n", "workflow.search_parameter_optimization()" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "code", - "execution_count": null, "metadata": {}, - "outputs": [], "source": [ "workflow.extraction()" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "code", - "execution_count": null, "metadata": {}, - "outputs": [], "source": [ "test_df = workflow.spectral_library.precursor_df.sample(1000)" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "code", - "execution_count": null, "metadata": {}, - "outputs": [], "source": [ "from alphadia.peakgroup import search\n", "\n", @@ -166,13 +167,13 @@ " fwhm_mobility=workflow.optimization_manager.fwhm_mobility,\n", ")\n", "candidates_df = extraction(thread_count=workflow.config[\"general\"][\"thread_count\"])" - ] + ], + "outputs": [], + "execution_count": null }, { "cell_type": "code", - "execution_count": null, "metadata": {}, - "outputs": [], "source": [ "from alphadia import plexscoring\n", "\n", @@ -202,14 +203,38 @@ " thread_count=workflow.config[\"general\"][\"thread_count\"],\n", " debug=True,\n", ")" - ] + ], + "outputs": [], + "execution_count": null + }, + { + "metadata": {}, + "cell_type": "markdown", + "source": "## Multistep Search" + }, + { + "metadata": {}, + "cell_type": "code", + "source": [ + "from alphadia.search_plan import SearchPlan\n", + "\n", + "config = {\n", + " \"raw_paths\": raw_data_path_list,\n", + " \"library_path\": library_path,\n", + "}\n", + "\n", + "plan = SearchPlan(output_folder, config=config)\n", + "plan.run_plan()" + ], + "outputs": [], + "execution_count": null } ], "metadata": { "kernelspec": { - "display_name": "alpha", + "display_name": "alphadia", "language": "python", - "name": "python3" + "name": "alphadia" }, "language_info": { "codemirror_mode": { From d722b10f9cebc2dce4977e246c37c0166e5c9374 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:26:27 +0100 Subject: [PATCH 23/29] fix fdr_performance.yml --- .github/workflows/e2e_testing.yml | 2 +- .github/workflows/fdr_performance.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 25f0f2dd..29d0fbed 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -49,7 +49,7 @@ jobs: TQDM_MININTERVAL: 10 # avoid lots of tqdm outputs steps: - uses: actions/checkout@v4 - - name: Pip installation with stable dependencies + - name: Pip installation (stable) id: pip_installation shell: bash -el {0} run: | diff --git a/.github/workflows/fdr_performance.yml b/.github/workflows/fdr_performance.yml index 801a31b4..97332bb2 100644 --- a/.github/workflows/fdr_performance.yml +++ b/.github/workflows/fdr_performance.yml @@ -31,11 +31,11 @@ jobs: - name: Conda info shell: bash -l {0} run: conda info - - name: Pip installation with all loose dependencies + - name: Pip installation (stable) shell: bash -l {0} run: | cd misc - . ./pip_install.sh stable,tests + . ./pip_install.sh stable,tests alphadia True - name: Run legacy classifier env: # Or as an environment variable NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_FDR_TOKEN }} From eeb00aa08fc68535fa4b98b0fb4ce11349de101a Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:41:02 +0100 Subject: [PATCH 24/29] fix actions --- .github/workflows/e2e_testing.yml | 2 +- .github/workflows/fdr_performance.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 29d0fbed..84ddcf4f 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -6,7 +6,7 @@ on: # push: # branches: [ main ] schedule: - - cron: "0 0 0 * * *" # daily on 12:00 AM + - cron: "0 0 * * *" # daily on 12:00 AM workflow_dispatch: inputs: test_case: diff --git a/.github/workflows/fdr_performance.yml b/.github/workflows/fdr_performance.yml index 97332bb2..6ce844a5 100644 --- a/.github/workflows/fdr_performance.yml +++ b/.github/workflows/fdr_performance.yml @@ -19,8 +19,8 @@ jobs: env: # Or as an environment variable NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_FDR_TOKEN }} steps: - - uses: actions/checkout@v2 - - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/checkout@v4 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: 3.11 @@ -35,7 +35,7 @@ jobs: shell: bash -l {0} run: | cd misc - . ./pip_install.sh stable,tests alphadia True + . ./pip_install.sh stable,tests alphadia 3.11 True - name: Run legacy classifier env: # Or as an environment variable NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_FDR_TOKEN }} From 9ee5ac7ae778d7b1d65fc26b5b6a0125dc1df8c3 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:47:48 +0100 Subject: [PATCH 25/29] fix merge issues --- .bumpversion.toml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index f18e425a..db4f24ff 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -48,15 +48,9 @@ filename = "./gui/package.json" [[tool.bumpversion.files]] filename = "./release/macos/info.plist" -[[tool.bumpversion.files]] -filename = "./release/linux/build_installer_linux.sh" - [[tool.bumpversion.files]] filename = "./release/linux/control" -[[tool.bumpversion.files]] -filename = "./release/macos/build_installer_macos.sh" - [[tool.bumpversion.files]] filename = "./release/macos/build_package_macos.sh" @@ -65,6 +59,3 @@ filename = "./release/macos/distribution.xml" [[tool.bumpversion.files]] filename = "./release/windows/alphadia_innoinstaller.iss" - -[[tool.bumpversion.files]] -filename = "./release/windows/build_installer_windows.ps1" From 4d36da2ff951324ad34bdf41893acd6c2e070aa1 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:58:15 +0100 Subject: [PATCH 26/29] run also slow tests --- .github/workflows/fdr_performance.yml | 2 +- .github/workflows/pip_installation.yml | 4 ++-- tests/run_unit_tests.sh | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/fdr_performance.yml b/.github/workflows/fdr_performance.yml index 6ce844a5..0fbafaea 100644 --- a/.github/workflows/fdr_performance.yml +++ b/.github/workflows/fdr_performance.yml @@ -35,7 +35,7 @@ jobs: shell: bash -l {0} run: | cd misc - . ./pip_install.sh stable,tests alphadia 3.11 True + . ./pip_install.sh stable,tests alphadia 3.11 true - name: Run legacy classifier env: # Or as an environment variable NEPTUNE_API_TOKEN: ${{ secrets.NEPTUNE_FDR_TOKEN }} diff --git a/.github/workflows/pip_installation.yml b/.github/workflows/pip_installation.yml index 66b7fa81..fac121ae 100644 --- a/.github/workflows/pip_installation.yml +++ b/.github/workflows/pip_installation.yml @@ -29,7 +29,7 @@ jobs: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} install-script: ./pip_install.sh stable,tests - test-script: ./run_unit_tests.sh + test-script: ./run_unit_tests.sh true run-unit-tests-loose: name: Test 'loose' on ${{ matrix.os }} @@ -43,4 +43,4 @@ jobs: python-version: ${{ matrix.python-version }} os: ${{ matrix.os }} install-script: ./pip_install.sh tests - test-script: ./run_unit_tests.sh + test-script: ./run_unit_tests.sh true diff --git a/tests/run_unit_tests.sh b/tests/run_unit_tests.sh index 81ff4727..4236efa2 100755 --- a/tests/run_unit_tests.sh +++ b/tests/run_unit_tests.sh @@ -1,7 +1,14 @@ -conda activate alphadia -#python -m unittest unit_tests/test_cli.py -#python -m unittest unit_tests/test_gui.py -coverage run --source=../alphadia -m pytest -k 'not slow' +#!/bin/bash + +ENV_NAME=alphadia + +INCLUDE_SLOW_TESTS=${1:-false} + +if [ "$INCLUDE_SLOW_TESTS" == "true" ]; then + conda run -n $ENV_NAME --no-capture-output coverage run --source=../alphadia -m pytest +else + conda run -n $ENV_NAME --no-capture-output coverage run --source=../alphadia -m pytest -k 'not slow' +fi + # coverage run --source=../alphadia -m pytest && coverage html && coverage-badge -f -o ../coverage.svg # coverage run --source=../alphadia -m pytest -k 'not slow' && coverage html && coverage-badge -f -o ../coverage.svg -conda deactivate From 4f900631716da43e6faa57b3899b256f6f1709ca Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:39:19 +0100 Subject: [PATCH 27/29] fix running e2e tests manually --- .github/workflows/e2e_testing.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index 84ddcf4f..fe395940 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -13,14 +13,20 @@ on: description: 'Test case to run (see e2e_test_cases.yaml for available cases), "all" to run all test cases.' required: false default: 'all' + commitish_to_test: + type: string + description: 'Enter commit hash or branch to test (default: main).' + default: "main" jobs: - determine_test_cases: + parse_inputs: runs-on: ubuntu-latest + if: contains(github.event.pull_request.labels.*.name, 'test:e2e') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' outputs: - test_cases: ${{ steps.set-matrix.outputs.test_cases }} + test_cases: ${{ steps.parse-test-cases.outputs.test_cases }} + commitish_to_test: ${{ steps.parse-commitish-to-test.outputs.commitish_to_test }} steps: - - id: set-matrix + - id: parse-test-cases run: | if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.test_case }}" != "all" ]; then echo "test_cases=[\"${{ github.event.inputs.test_case }}\"]" >> $GITHUB_OUTPUT @@ -29,15 +35,21 @@ jobs: echo 'test_cases=["basic", "synchropasef", "astral", "astral_automatic_calibration", "multistep"]' >> $GITHUB_OUTPUT fi - end2end_testing: - name: End to end test - needs: determine_test_cases + - id: parse-commitish-to-test + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "commitish_to_test=[\"${{ github.event.inputs.commitish_to_test }}\"]" >> $GITHUB_OUTPUT + else + echo "commitish_to_test=main" >> $GITHUB_OUTPUT + + end2end_tests: + name: End to end tests + needs: parse_inputs runs-on: self-hosted - if: contains(github.event.pull_request.labels.*.name, 'test:e2e') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' strategy: fail-fast: false matrix: - test_case: ${{ fromJson(needs.determine_test_cases.outputs.test_cases) }} + test_case: ${{ fromJson(needs.parse_inputs.outputs.test_cases) }} env: RUN_NAME: alphadia-${{github.sha}}-${{github.run_id}}-${{github.run_attempt}} BRANCH_NAME: ${{ github.head_ref || github.ref_name }} @@ -49,6 +61,8 @@ jobs: TQDM_MININTERVAL: 10 # avoid lots of tqdm outputs steps: - uses: actions/checkout@v4 + with: + ref: ${{ needs.parse_inputs.outputs.commitish_to_test }} - name: Pip installation (stable) id: pip_installation shell: bash -el {0} From 4a7615d4cb6ab90282810cb4b3639e053b3a18ad Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:40:34 +0100 Subject: [PATCH 28/29] fix running e2e tests manually --- .github/workflows/e2e_testing.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e_testing.yml b/.github/workflows/e2e_testing.yml index fe395940..99890b3a 100644 --- a/.github/workflows/e2e_testing.yml +++ b/.github/workflows/e2e_testing.yml @@ -41,6 +41,7 @@ jobs: echo "commitish_to_test=[\"${{ github.event.inputs.commitish_to_test }}\"]" >> $GITHUB_OUTPUT else echo "commitish_to_test=main" >> $GITHUB_OUTPUT + fi end2end_tests: name: End to end tests From 26ef0dc7677fc4f8a3e352bba96ff24da7d28315 Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Fri, 17 Jan 2025 17:03:28 +0100 Subject: [PATCH 29/29] =?UTF-8?q?Bump=20version:=201.9.2=20=E2=86=92=201.9?= =?UTF-8?q?.3-dev0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.toml | 2 +- alphadia/__init__.py | 2 +- gui/package.json | 2 +- gui/src/main/modules/profile.js | 2 +- release/linux/control | 2 +- release/macos/build_package_macos.sh | 4 ++-- release/macos/distribution.xml | 2 +- release/macos/info.plist | 4 ++-- release/windows/alphadia_innoinstaller.iss | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.bumpversion.toml b/.bumpversion.toml index db4f24ff..ddd8ba49 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "1.9.2" +current_version = "1.9.3-dev0" parse = """(?x) (?P0|[1-9]\\d*)\\. (?P0|[1-9]\\d*)\\. diff --git a/alphadia/__init__.py b/alphadia/__init__.py index e16450ce..edc69a43 100644 --- a/alphadia/__init__.py +++ b/alphadia/__init__.py @@ -1,3 +1,3 @@ #!python -__version__ = "1.9.2" +__version__ = "1.9.3-dev0" diff --git a/gui/package.json b/gui/package.json index 0c003da7..51aea7d7 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,7 +1,7 @@ { "name": "alphadia", "productName": "alphadia-gui", - "version": "1.9.2", + "version": "1.9.3-dev0", "description": "Graphical user interface for DIA data analysis", "main": "dist/electron.js", "homepage": "./", diff --git a/gui/src/main/modules/profile.js b/gui/src/main/modules/profile.js index c9b7f95b..3b6d3715 100644 --- a/gui/src/main/modules/profile.js +++ b/gui/src/main/modules/profile.js @@ -3,7 +3,7 @@ const path = require("path") const { app, shell, BrowserWindow} = require("electron") const { dialog } = require('electron') -const VERSION = "1.9.2" +const VERSION = "1.9.3-dev0" const Profile = class { diff --git a/release/linux/control b/release/linux/control index 90fed30a..f15baab3 100644 --- a/release/linux/control +++ b/release/linux/control @@ -1,5 +1,5 @@ Package: alphadia -Version: 1.9.2 +Version: 1.9.3-dev0 Architecture: all Maintainer: Mann Labs Description: alphadia diff --git a/release/macos/build_package_macos.sh b/release/macos/build_package_macos.sh index 2ae26c65..7e999c50 100755 --- a/release/macos/build_package_macos.sh +++ b/release/macos/build_package_macos.sh @@ -7,10 +7,10 @@ set -e -u # Set up package name and version PACKAGE_NAME="alphadia" APP_NAME="alphadia" -PACKAGE_VERSION="1.9.2" +PACKAGE_VERSION="1.9.3-dev0" PKG_FOLDER="dist/$APP_NAME.app" -# BUILD_NAME is taken from environment variables, e.g. alphadia-1.9.2-macos-darwin-arm64 or alphadia-1.9.2-macos-darwin-x64 +# BUILD_NAME is taken from environment variables, e.g. alphadia-1.9.3-dev0-macos-darwin-arm64 or alphadia-1.9.3-dev0-macos-darwin-x64 rm -rf ${BUILD_NAME}.pkg # Cleanup the package folder diff --git a/release/macos/distribution.xml b/release/macos/distribution.xml index bac68251..ded80d77 100644 --- a/release/macos/distribution.xml +++ b/release/macos/distribution.xml @@ -1,6 +1,6 @@ - AlphaDIA 1.9.2 + AlphaDIA 1.9.3-dev0 diff --git a/release/macos/info.plist b/release/macos/info.plist index 02a16ba3..2a83ccdf 100644 --- a/release/macos/info.plist +++ b/release/macos/info.plist @@ -9,9 +9,9 @@ CFBundleIconFile alphadia.icns CFBundleIdentifier - alphadia.1.9.2 + alphadia.1.9.3-dev0 CFBundleShortVersionString - 1.9.2 + 1.9.3-dev0 CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/release/windows/alphadia_innoinstaller.iss b/release/windows/alphadia_innoinstaller.iss index a19ba8e4..ba988cc5 100644 --- a/release/windows/alphadia_innoinstaller.iss +++ b/release/windows/alphadia_innoinstaller.iss @@ -5,7 +5,7 @@ ; so all paths are given relative to the location of this .iss file. #define MyAppName "AlphaDIA" -#define MyAppVersion "1.9.2" +#define MyAppVersion "1.9.3-dev0" #define MyAppPublisher "Max Planck Institute of Biochemistry, Mann Labs" #define MyAppURL "https://github.com/MannLabs/alphadia" #define MyAppExeName "alphadia-gui.exe" @@ -29,7 +29,7 @@ PrivilegesRequired=lowest PrivilegesRequiredOverridesAllowed=dialog ; release workflow expects artifact at root of repository OutputDir=..\..\ -; example for BUILD_NAME: alphadia-1.9.2-win-x64 +; example for BUILD_NAME: alphadia-1.9.3-dev0-win-x64 OutputBaseFilename={#GetEnv('BUILD_NAME')} SetupIconFile=..\logos\alphadia.ico Compression=lzma