-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathappveyor.yml
More file actions
196 lines (182 loc) · 7.72 KB
/
appveyor.yml
File metadata and controls
196 lines (182 loc) · 7.72 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
version: 1.2.{build}
build: off
environment:
global:
PYLSL_LIB: /home/appveyor/.local/lib/python3.10/site-packages/pylsl/lib/liblsl.so
matrix:
#- ID: macOS
# APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
# PYTHON: "3.9"
# PYTHON_VERSION: "3.9"
# Waiting on pylsl 3.13 support, won't download via pip atm
#- ID: VS2019_Py313
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PYTHON: "C:\\Python313-x64"
# PYTHON_VERSION: "3.13"
- ID: VS2019_Py312
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: "C:\\Python312-x64"
PYTHON_VERSION: "3.12"
- ID: VS2019_Py311
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: "C:\\Python311-x64"
PYTHON_VERSION: "3.11"
- ID: VS2019_Py310
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: "C:\\Python310-x64"
PYTHON_VERSION: "3.10"
- ID: VS2019_Py39
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: "C:\\Python39-x64"
PYTHON_VERSION: "3.9"
#- ID: Ubuntu
# APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004
# PYTHON: "3.10"
# PYTHON_VERSION: "3.10"
matrix:
fast_finish: true
install:
# Install dependencies
- ps: |
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2019") {
# Update PATH environment variable for Python and Scripts directory
$env:Path = "$env:PYTHON;$env:PYTHON\Scripts;$env:Path"
# Check if correct python is being used
Write-Host "Current Python from Path"
Get-Command python
# Other commands
python -m pip install --upgrade pip setuptools wheel
python --version
python -m pip --version
python -m pip install --upgrade urllib3>=2.0.5
python -m pip install -e .
python -m pip install pytest pytest-timeout ruff setuptools
$env:PYLSL_LIB = "lsl.dll"
python -m pip list
python -c "import pybci; print(pybci.__file__)"
}
- sh: |
case $APPVEYOR_BUILD_WORKER_IMAGE in
"ubuntu2004")
echo "Updating ubuntu system..."
sudo apt-get update
sudo apt-get install python3.10
# Install pip for Python 3.10
sudo apt-get install python3-distutils
#ls /usr/bin/python*
#where python3.10
#sudo find / -name python3.10
wget https://bootstrap.pypa.io/get-pip.py
/opt/az/bin/python3.10 get-pip.py
# Set Python 3.10 as the default Python version
#sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 1
sudo apt-get install -y python3-pip cmake git
/opt/az/bin/python3.10 -m pip install --upgrade urllib3>=2.0.5
/opt/az/bin/python3.10 -m pip install pytest pytest-timeout ruff
/opt/az/bin/python3.10 -m pip install .
/opt/az/bin/python3.10 -m site
echo 'export PATH=$PATH:/home/appveyor/.local/bin' >> ~/.bashrc
source ~/.bashrc
;;
"macos-monterey")
echo "Updating Homebrew and installing packages..."
brew update
brew install python@3.9
python3.9 -m pip install --upgrade urllib3>=2.0.5
python3.9 -m pip install -e .
python3.9 -m pip install pytest pytest-timeout ruff
echo "Setting PYTHONPATH..."
export PYTHONPATH=$(pwd):$PYTHONPATH
echo "PYTHONPATH set to: $PYTHONPATH"
echo "Debugging Python environment..."
python3.9 -c "import sys; print('Python Path:', sys.path)"
python3.9 -c "import pybci; print('pybci located at:', pybci.__file__)" || echo "pybci not found!"
;;
esac
- "echo 'About to install lsl lib for mac and linux...'"
- sh: |
set -e # Exit immediately if a command exits with a non-zero status.
case $APPVEYOR_BUILD_WORKER_IMAGE in
"ubuntu2004")
sudo apt-get install -y libpugixml1v5
echo "Downloading liblsl DEB package..."
wget https://github.com/sccn/liblsl/releases/download/v1.16.2/liblsl-1.16.2-focal_amd64.deb -O liblsl.deb || exit 1
echo "Installing liblsl DEB package..."
sudo dpkg -i liblsl.deb || exit 1
echo "Verifying installation..."
# This command checks if the library is installed and lists its files.
dpkg -L liblsl || exit 1
echo "Creating target directory..."
mkdir -p /home/appveyor/.local/lib/python3.10/site-packages/pylsl/lib || exit 1
echo "Copying liblsl.so to target directory..."
# You need to verify the exact path where the .deb package installs the library.
# Usually, it should be under /usr/lib or /usr/local/lib. The path below is just an example.
cp /usr/lib/liblsl.so /home/appveyor/.local/lib/python3.10/site-packages/pylsl/lib/ || exit 1
#echo "Cloning liblsl repository..."
#git clone --depth=1 https://github.com/sccn/liblsl.git
#echo "Listing contents of liblsl directory..."
##ls -alh liblsl
#echo "Configuring liblsl project..."
#cd liblsl
#cmake -S . -B build
#echo "Building liblsl..."
#cmake --build build
#echo "Listing contents of build directory..."
##ls -alh build
#echo "Creating target directory..."
#ls -alh /home/appveyor/.local/lib/python3.10/site-packages/pylsl
#mkdir -p /home/appveyor/.local/lib/python3.10/site-packages/pylsl/lib
##ls -alh /opt/az/lib/python3.10/site-packages/pylsl
##mkdir -p /opt/az/lib/python3.10/site-packages/pylsl/lib
#echo "Copying liblsl.so to target directory..."
# Update the source path based on where the build outputs the library.
#cp build/liblsl.so /home/appveyor/.local/lib/python3.10/site-packages/pylsl/lib/ || exit 1
;;
"macos-monterey")
# Install LSL
# Remove conflicting binaries
rm -f /usr/local/bin/ccmake /usr/local/bin/cmake /usr/local/bin/cpack /usr/local/bin/ctest
# Install LSL
brew install --verbose labstreaminglayer/tap/lsl
#brew install --verbose labstreaminglayer/tap/lsl
;;
esac
# Exit if error
#- ps: if ($LastExitCode -ne 0) { Write-Host "Command exited with code $LastExitCode"; exit $LastExitCode }
#- sh: if [[ $? != 0 ]]; then echo "Command exited with code $?"; exit $?; fi
test_script:
# Run tests
- "echo 'About to run tests...'"
- sh: |
if [[ $APPVEYOR_BUILD_WORKER_IMAGE == "ubuntu2004" ]]; then
echo 'About to run tests on Ubuntu...'
# Diagnostic commands
echo "PYLSL_LIB: $PYLSL_LIB"
ls -alh /home/appveyor/.local/lib/python3.10/site-packages/pylsl/lib
echo $PYLSL_LIB
/opt/az/bin/python3.10 --version
cd $APPVEYOR_BUILD_FOLDER
ls -alh Tests/
export PYTEST_ERRORLEVEL=0
/opt/az/bin/python3.10 -m pytest -vv -s Tests/ || PYTEST_ERRORLEVEL=$?
if [[ $PYTEST_ERRORLEVEL != 0 ]]; then
echo 'Pytest failed. Terminating python process.'
pkill -f /opt/az/bin/python3.10 || echo 'No Python310 process found to terminate.'
fi
fi
- ps: |
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -ne "ubuntu2204") {
$PYTEST_ERRORLEVEL = 0
pytest -vv -s Tests/
$PYTEST_ERRORLEVEL = $LASTEXITCODE
if ($PYTEST_ERRORLEVEL -ne 0) {
Write-Host 'Pytest failed. Terminating python process.'
Stop-Process -Name python -Force
} else {
Write-Host 'Pytest succeeded.'
}
}
- "ruff check"
- "echo 'Finished running tests.'"
#- ps: if ($LastExitCode -ne 0) { Write-Host "Command exited with code $LastExitCode"; exit $LastExitCode }
#- sh: if [[ $? != 0 ]]; then echo "Command exited with code $?"; exit $?; fi