Skip to content

Commit

Permalink
rename & add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mschwoer committed Aug 26, 2024
1 parent 211e44e commit 6186969
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 49 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ Older releases remain available on the [release
page](https://github.com/MannLabs/alphapeptdeep/releases), but no
backwards compatibility is guaranteed.


TODO
Note that, as GitHub does not allow large release files, these installers do not have GPU support.
To create GPU version installers, clone the source code and install GPU-version pytorch [see here](#use-gpu),
and then use `release/[macos, linux, windows]/create_installer_*.sh` to build an installer locally.
To create GPU version installers: clone the source code, install the GPU-version of pytorch [see here](#use-gpu),
and then use the `build_installer_*.sh` and `build_package_*.sh`
script in the respective `release/[macos, linux, windows]` folder to build the installer locally.
For Linux you need to additionally pass the "GPU" flag, i.e. run
```bash
release/linux/XXXX.sh GPU
release/linux/build_installer_linux.sh GPU
release/linux/build_package_linux.sh
```

### Pip
Expand Down
16 changes: 0 additions & 16 deletions release/linux/build_backend_linux.sh

This file was deleted.

35 changes: 15 additions & 20 deletions release/linux/build_installer_linux.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
#!/bin/bash

# Build the installer for Linux.
# This script is intended to be run from the root of the repository.

PACKAGE_NAME="peptdeep"
PACKAGE_VERSION="1.2.1"
rm -rf dist
rm -rf build

ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
ARCH="x64"
fi
echo "ARCH=${ARCH}" >> $GITHUB_ENV

KERNEL=$(uname -s | tr '[:upper:]' '[:lower:]')
# Creating the wheel
python setup.py sdist bdist_wheel

BUILD_NAME="${PACKAGE_NAME}-${PACKAGE_VERSION}-${KERNEL}-${ARCH}"
# Setting up the local package
# Make sure you include the required extra packages and always use the stable or very-stable options!
pip install "dist/peptdeep-1.2.1-py3-none-any.whl[stable]"

# If needed, include additional source such as e.g.:
# cp ../../peptdeep/data/*.fasta dist/peptdeep/data
# WARNING: this probably does not work!!!!
if [ "$1" != "GPU" ]; then
pip install torch -U --extra-index-url https://download.pytorch.org/whl/cpu
fi

# Wrapping the pyinstaller folder in a .deb package
mv dist/peptdeep dist/peptdeep.tmp
mkdir -p dist/$BUILD_NAME/usr/local/bin
mv dist/peptdeep.tmp dist/$BUILD_NAME/usr/local/bin/peptdeep
mkdir dist/$BUILD_NAME/DEBIAN
cp release/linux/control dist/$BUILD_NAME/DEBIAN
dpkg-deb --build --root-owner-group dist/$BUILD_NAME/
# Creating the stand-alone pyinstaller folder
pip install pyinstaller
pyinstaller release/pyinstaller/peptdeep.spec -y
29 changes: 29 additions & 0 deletions release/linux/build_package_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Build the install package for Linux.
# This script is intended to be run from the root of the repository after running build_installer_linux.sh

PACKAGE_NAME="peptdeep"
PACKAGE_VERSION="1.2.1"

ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
ARCH="x64"
fi
echo "ARCH=${ARCH}" >> $GITHUB_ENV

KERNEL=$(uname -s | tr '[:upper:]' '[:lower:]')

BUILD_NAME="${PACKAGE_NAME}-${PACKAGE_VERSION}-${KERNEL}-${ARCH}"

# If needed, include additional source such as e.g.:
# cp ../../peptdeep/data/*.fasta dist/peptdeep/data
# WARNING: this probably does not work!!!!

# Wrapping the pyinstaller folder in a .deb package
mv dist/peptdeep dist/peptdeep.tmp
mkdir -p dist/$BUILD_NAME/usr/local/bin
mv dist/peptdeep.tmp dist/$BUILD_NAME/usr/local/bin/peptdeep
mkdir dist/$BUILD_NAME/DEBIAN
cp release/linux/control dist/$BUILD_NAME/DEBIAN
dpkg-deb --build --root-owner-group dist/$BUILD_NAME/
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash

# OUT OF SCOPE: moving to pyproject.toml / unifying these scripts
# Build the installer for MacOS.
# This script is intended to be run from the root of the repository.


rm -rf dist
rm -rf build

# Creating the wheel
python setup.py sdist bdist_wheel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash

# Build the install package for MacOS.
# This script is intended to be run from the root of the repository after running build_installer_macos.sh

PACKAGE_NAME="peptdeep"
PACKAGE_VERSION="1.2.1"

rm -rf ${PACKAGE_NAME}.pkg

ARCH=$(uname -m)
if [ "$ARCH" == "x86_64" ]; then
ARCH="x64"
Expand All @@ -27,5 +32,5 @@ cp LICENSE.txt dist/peptdeep/Contents/Resources/LICENSE.txt
cp release/logos/alpha_logo.png dist/peptdeep/Contents/Resources/alpha_logo.png
chmod 777 release/macos/scripts/*

pkgbuild --root dist/${PACKAGE_NAME} --identifier de.mpg.biochem.${PACKAGE_NAME}.app --version 1.2.1 --install-location /Applications/${PACKAGE_NAME}.app --scripts release/macos/scripts peptdeep.pkg
productbuild --distribution release/macos/distribution.xml --resources Resources --package-path peptdeep.pkg dist/${BUILD_NAME}.pkg
pkgbuild --root dist/${PACKAGE_NAME} --identifier de.mpg.biochem.${PACKAGE_NAME}.app --version 1.2.1 --install-location /Applications/${PACKAGE_NAME}.app --scripts release/macos/scripts ${PACKAGE_NAME}.pkg
productbuild --distribution release/macos/distribution.xml --resources Resources --package-path ${PACKAGE_NAME}.pkg dist/${BUILD_NAME}.pkg
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Build the installer for Windows.
# This script is intended to be run from the root of the repository.

Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./build
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue ./dist

Expand All @@ -10,11 +13,6 @@ pip install "dist/peptdeep-1.2.1-py3-none-any.whl[stable]"
pip install pyinstaller
pyinstaller release/pyinstaller/peptdeep.spec -y


echo ls dist:
ls dist

set +e
# for some reason, the installer builder expects the files here
mv dist/* release/windows/dist
mkdir release/windows/dist/peptdeep
Expand Down

0 comments on commit 6186969

Please sign in to comment.