Skip to content

Commit

Permalink
Merge pull request #6 from compmem/2024-data-collection-updates
Browse files Browse the repository at this point in the history
2024 data collection updates
  • Loading branch information
Shotgunosine authored Nov 13, 2024
2 parents be9293a + 73db4d6 commit bf9c19f
Show file tree
Hide file tree
Showing 114 changed files with 1,479 additions and 1,303 deletions.
118 changes: 118 additions & 0 deletions .github/workflows/build_executables.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Build Executables

on:

workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false

push:
branches: [master]
pull_request:
branches: [master]

jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
activate-environment: kivy20
python-version: "3.10"
channels: conda-forge
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive # Initializes and updates submodules
- name: create env
shell: bash -l {0}
run: conda install -y kivy=2.3 pyinstaller=4.10 requests glfw
- name: pip installs
shell: bash -l {0}
run: pip install kivy-deps.sdl2 kivy-deps.glew pyo
- name: install smile
shell: bash -l {0}
run: pip install -e smile
- name: create files
shell: bash -l {0}
run: echo $SI > serverinfo.txt && echo $ULCRT > cert.pem
- name: package cogmood
shell: bash -l {0}
run: |
cd package
export KIVY_GL_BACKEND=angle_sdl2
python -m PyInstaller cogmood_windows.spec
- name: save exe
uses: actions/upload-artifact@v3
with:
name: SUPREME
path: package/dist/SUPREME.exe


build-macos:
runs-on: macos-14
steps:
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
detached: true
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive # Initializes and updates submodules

- name: Install Homebrew dependencies
run: |
brew update
brew install sdl2 sdl2_image sdl2_mixer sdl2_ttf
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10" # Specify your Python version

- name: Check if Python is a fat binary
run: |
if lipo -info $(which python3) | grep -q "Architectures in the fat file"; then
lipo -info $(which python3)
echo "Python is a fat binary."
export PATH=/Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin:$PATH
else
echo "Python is NOT a fat binary."
exit 1 # Optional: Exit with error if you require a fat binary
fi
- name: Install dependencies
run: |
export PATH=/Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin:$PATH
mkdir python_packages
python3 -m pip install --upgrade pip
python3 -m pip install --target $PWD/python_packages --only-binary=:all: --platform macosx_10_13_universal2 -r requirements.txt
export PYTHONPATH=$PWD/python_packages:$PYTHONPATH
- name: Build executable with PyInstaller
run: |
export PATH=/Users/runner/hostedtoolcache/Python/3.10.11/arm64/bin:$PATH
export PYTHONPATH=$PWD/python_packages:$PYTHONPATH
cd package
python3 -m PyInstaller --noconfirm cogmood_mac.spec
- name: Upload macOS executable
uses: actions/upload-artifact@v4
with:
name: SUPREME
path: package/dist/SUPREME
43 changes: 0 additions & 43 deletions .github/workflows/mac-build.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/windows-build.yml

This file was deleted.

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Stimuli extracted for AssBind
tasks/AssBind/stim/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -31,7 +34,6 @@ MANIFEST
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down Expand Up @@ -127,3 +129,6 @@ dmypy.json

# Pyre type checker
.pyre/

# MacOS
.DS_Store
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# SUPREMEMOOD

## Updated Non-Conda Build Instructions
**Note:** Must use Git Bash or WSL on Windows for compatibility with Make


Create virtual environment:
```bash
python -m venv .venv
```

Activate venv:
- Windows:
```bash
source .venv/Scripts/activate
```

- Mac:
```bash
source .venv/bin/activate
```

Install requirements:
```bash
pip install -r requirements.txt
```

Go to package directory:
```bash
cd package
```

Use Makefile to call PyInstaller (The Makefile will check for MacOS or Windows or other & call PyInstaller or output message if OS not supported):
```bash
make
```

## Windows build instructions
### Kivy 2.0
Pysinstaller 5.0 took out some tk hooks that kivy 2.0 depends on. kivy 2.1 fixes that, and could be used with pyinstaller 5.0, but there's a mouse issue with kivy 2.1.
Expand All @@ -8,7 +43,7 @@ After cloning this repo
```commandline
conda create -p ./env_kivy20 -c conda-forge python=3.9 kivy=2.0 pyinstaller=4.10 requests
conda activate ./env_kivy20
pip install kivy-deps.sdl2 kivy-deps.glew pyo pyperclip
pip install kivy-deps.sdl2 kivy-deps.glew pyo
pip install -e cogmood/smile
cd cogmood/package
python -m PyInstaller cogmood_winkivy20.spec
Expand All @@ -20,7 +55,7 @@ After cloning this repo
```commandline
conda create -p ./env_kivy20 -c conda-forge python=3.9 kivy=2.0 pyinstaller=4.10 requests
conda activate ./env_kivy20
pip install pyo pyperclip
pip install pyo
pip install -e cogmood/smile
cd cogmood/package
python -m PyInstaller cogmood_mackivy20.spec
Expand Down
Loading

0 comments on commit bf9c19f

Please sign in to comment.