-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathembeddable_env_without_OpenMS.yaml
More file actions
132 lines (110 loc) · 4.81 KB
/
embeddable_env_without_OpenMS.yaml
File metadata and controls
132 lines (110 loc) · 4.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Build embeddable python env with App
on:
#push:
# branches:
# - main
# - development
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
PYTHON_VERSION: 3.10.0
jobs:
build-executable:
runs-on: windows-2022
env:
PYTHON_VERSION: 3.10.0
APP_NAME: OpenMS-NuXLApp
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python (regular distribution)
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }} # Use the same version as the embeddable version
- name: Setup python embeddable version
run: |
# Create a directory for the embeddable Python version
mkdir python-${{ env.PYTHON_VERSION }}
# Download and unzip the embeddable Python version
curl -O https://www.python.org/ftp/python/${{ env.PYTHON_VERSION }}/python-${{ env.PYTHON_VERSION }}-embed-amd64.zip
unzip python-${{ env.PYTHON_VERSION }}-embed-amd64.zip -d python-${{ env.PYTHON_VERSION }}
rm python-${{ env.PYTHON_VERSION }}-embed-amd64.zip
# Define paths for the regular Python distribution and the embeddable distribution
$PYTHON_DIR="${{ runner.tool_cache }}/Python/${{ env.PYTHON_VERSION }}/x64" # Path from actions/setup-python
$EMBED_DIR="python-${{ env.PYTHON_VERSION }}"
mkdir -p $EMBED_DIR/Lib/site-packages/tkinter
mkdir -p $EMBED_DIR/tcl
# Copy necessary Tkinter files from the regular Python distribution
cp -r $PYTHON_DIR/Lib/tkinter/* $EMBED_DIR/Lib/site-packages/tkinter/
cp -r $PYTHON_DIR/tcl/* $EMBED_DIR/tcl/
cp $PYTHON_DIR/DLLs/_tkinter.pyd $EMBED_DIR/
cp $PYTHON_DIR/DLLs/tcl86t.dll $EMBED_DIR/
cp $PYTHON_DIR/DLLs/tk86t.dll $EMBED_DIR/
- name: Install pip
run: |
curl -O https://bootstrap.pypa.io/get-pip.py
./python-${{ env.PYTHON_VERSION }}/python get-pip.py --no-warn-script-location
rm get-pip.py
- name: Uncomment 'import site' in python310._pth file
run: |
sed -i 's/#import site/import site/' python-${{ env.PYTHON_VERSION }}/python310._pth
- name: Install Required Packages
run: .\python-${{ env.PYTHON_VERSION }}\python -m pip install --force-reinstall -r requirements_embd_py310_win.txt --no-warn-script-location
- name: Binary-stable OpenMS stack
run: |
# Seed DLLs
python -m pip install pyopenms==3.3.0
# Override Python bindings
python -m pip install pyopenms==3.1.0
# Restore correct NumPy ABI
python -m pip install numpy==1.22.4
- name: Set to offline deployment
run: |
$content = Get-Content -Raw settings.json | ConvertFrom-Json
$content.online_deployment = $false
$content | ConvertTo-Json -Depth 100 | Set-Content settings.json
- name: Create .bat file
run: |
echo " start /min .\python-${{ env.PYTHON_VERSION }}\python -m streamlit run app.py local" > ${{ env.APP_NAME }}.bat
- name: Create All-in-one executable folder
run: |
if (Test-Path -Path "streamlit_exe") {
Remove-Item -Recurse -Force "streamlit_exe"
}
mkdir streamlit_exe
mv python-${{ env.PYTHON_VERSION }} streamlit_exe
cp -r src streamlit_exe
cp -r content streamlit_exe
cp -r assets streamlit_exe
cp -r example-data streamlit_exe
cp -r .streamlit streamlit_exe
cp app.py streamlit_exe
cp settings.json streamlit_exe
cp ${{ env.APP_NAME }}.bat streamlit_exe
- name: Generate Readme.txt
shell: bash
run: |
cat <<EOF > streamlit_exe/Readme.txt
Welcome to ${{ env.APP_NAME }} app!
To launch the application:
1. Navigate to the installation directory.
2. Double-click on the file: ${{ env.APP_NAME }}.bat or ${{ env.APP_NAME }} shortcut.
Additional Information:
- If multiple Streamlit apps are running, you can change the port in the .streamlit/config.toml file.
Example:
[server]
port = 8502
Reach out to us:
- Join our Discord server for support and community discussions: https://discord.com/invite/4TAGhqJ7s5
- Contribute or stay updated with the latest OpenMS web app developments on GitHub: https://github.com/OpenMS/streamlit-template
- Checkout the ${{ env.APP_NAME }} on Github: https://github.com/Arslan-Siraj/nuxl-app
- Visit our website for more information: https://openms.de/
Thanks for using ${{ env.APP_NAME }}!
EOF
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: OpenMS_NuXLApp_without_Wix
path: |
streamlit_exe