Skip to content

Commit

Permalink
Merge branch 'main' into modern
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jun 24, 2024
2 parents 616c060 + 8c67580 commit 7878faf
Show file tree
Hide file tree
Showing 120 changed files with 6,101 additions and 7,737 deletions.
54 changes: 35 additions & 19 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,46 @@ version: 2
jobs:
build_docs:
docker:
- image: circleci/python:3.8.5-buster
- image: cimg/base:current-22.04
steps:
# Get our data and merge with upstream
- checkout
- run: echo $(git log -1 --pretty=%B) | tee gitlog.txt
- run: echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt
- run: sudo apt update
- run: sudo apt install libglu1-mesa ffmpeg
- run:
command: |
if [[ $(cat merge.txt) != "" ]]; then
echo "Merging $(cat merge.txt)";
git pull --ff-only origin "refs/pull/$(cat merge.txt)/merge";
fi
- run: echo "export DISPLAY=:99" >> $BASH_ENV
- run: echo "export _EXPYFUN_SILENT=true" >> $BASH_ENV
- run: echo "export PATH=~/.local/bin:$PATH" >> $BASH_ENV
- run: echo "export SOUND_CARD_BACKEND=pyglet >> $BASH_ENV" # rtmixer needs pulse, which is a huge pain to get running on CircleCI
- run: /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset;
- run: pip install --quiet --upgrade --user pip
- run: pip install --quiet --upgrade --user numpy scipy matplotlib sphinx pillow pandas h5py mne pyglet psutil sphinx_bootstrap_theme sphinx_fontawesome numpydoc https://api.github.com/repos/sphinx-gallery/sphinx-gallery/zipball/master
name: Merge
command: |
set -eo pipefail
echo $(git log -1 --pretty=%B) | tee gitlog.txt
echo ${CI_PULL_REQUEST//*pull\//} | tee merge.txt
if [[ $(cat merge.txt) != "" ]]; then
echo "Merging $(cat merge.txt)";
git pull --ff-only origin "refs/pull/$(cat merge.txt)/merge";
fi
- run:
name: Prep env
command: |
set -eo pipefail
echo "set -eo pipefail" >> $BASH_ENV
sudo apt update
sudo apt install libglu1-mesa python3.10-venv python3-venv libxft2 ffmpeg ffmpeg xvfb
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1400x900x24 -ac +extension GLX +render -noreset
python3.10 -m venv ~/python_env
echo "export PATH=~/.local/bin:$PATH" >> $BASH_ENV
echo "export SOUND_CARD_BACKEND=pyglet >> $BASH_ENV" # rtmixer needs pulse, which is a huge pain to get running on CircleCI
echo "export OPENBLAS_NUM_THREADS=4" >> $BASH_ENV
echo "export XDG_RUNTIME_DIR=/tmp/runtime-circleci" >> $BASH_ENV
echo "export PATH=~/.local/bin/:$PATH" >> $BASH_ENV
echo "export DISPLAY=:99" >> $BASH_ENV
echo "export _EXPYFUN_SILENT=true" >> $BASH_ENV
echo "source ~/python_env/bin/activate" >> $BASH_ENV
mkdir -p ~/.local/bin
ln -s ~/python_env/bin/python ~/.local/bin/python
echo "BASH_ENV:"
cat $BASH_ENV
- run: pip install --quiet --upgrade pip setuptools wheel
- run: pip install --quiet --upgrade numpy scipy matplotlib sphinx pandas h5py mne "pyglet<2.0" psutil pydata-sphinx-theme numpydoc git+https://github.com/sphinx-gallery/sphinx-gallery
- run: python -m pip install -ve .
- run: python -c "import mne; mne.sys_info()"
- run: python -c "import pyglet; print(pyglet.version)"
- run: python setup.py develop --user
- run: cd doc && make html

- store_artifacts:
Expand All @@ -44,7 +60,7 @@ jobs:
steps:
- add_ssh_keys:
fingerprints:
- d4:4f:25:af:ed:5f:61:01:dc:b6:3a:9e:b5:d6:8d:d1
- "25:b7:f2:bf:d7:38:6d:b6:c7:78:41:05:01:f8:41:7b"
- attach_workspace:
at: /tmp/_build
- run:
Expand Down
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ include = */expyfun/*
omit =
*/setup.py
*/expyfun/codeblocks/*
*/expyfun/_externals/*
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c7c1b18440968e2def388dff25118e13fe3c3b9a # ruff format
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
actions:
patterns:
- "*"
5 changes: 5 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
exclude:
authors:
- dependabot
- pre-commit-ci
7 changes: 5 additions & 2 deletions .github/workflows/circle_artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
on: [status]
on: [status] # yamllint disable-line rule:truthy
jobs:
circleci_artifacts_redirector_job:
if: "${{ startsWith(github.event.context, 'ci/circleci: build_docs') }}"
runs-on: ubuntu-20.04
name: Run CircleCI artifacts redirector
steps:
- name: GitHub Action step
uses: larsoner/circleci-artifacts-redirector-action@master
uses: scientific-python/circleci-artifacts-redirector-action@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
api-token: ${{ secrets.CIRCLECI_TOKEN }}
artifact-path: 0/html/index.html
circleci-jobs: build_docs
job-title: Check the rendered docs here!
38 changes: 0 additions & 38 deletions .github/workflows/codespell_and_flake.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/compat_old.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/linux_conda.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/macos_conda.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: 'tests'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
job:
name: ${{ matrix.os }} ${{ matrix.kind }}
continue-on-error: true
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
include:
# 24.04 works except for the video test, even though it works locally on 24.10
- os: ubuntu-22.04
kind: pip
python: '3.12'
# ARM64 will probably need to wait until
# - os: 'macos-latest' # arm64
# kind: 'conda'
# python: '3.12'
- os: 'macos-13' # intel
kind: 'conda'
python: '3.12'
# TODO: There is a bug on Python 3.12 on Windows :(
- os: 'windows-latest'
kind: 'pip'
python: '3.11'
- os: 'ubuntu-20.04'
kind: 'old'
python: '3.8'
steps:
- uses: actions/checkout@v4
- uses: LABSN/sound-ci-helpers@v1
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
# Use -dev here just to get whichever version is right (e.g., 22.04 has a different version from 24.04)
- run: sudo apt install -q libavutil-dev libavcodec-dev libavformat-dev libswscale-dev libglu1-mesa gstreamer1.0-alsa gstreamer1.0-libav
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- run: powershell tools/get_video.ps1
if: ${{ startsWith(matrix.os, 'windows') }}
- run: |
set -xeo pipefail
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "Setting env vars for Windows"
echo "AZURE_CI_WINDOWS=true" >> $GITHUB_ENV
echo "SOUND_CARD_BACKEND=rtmixer" >> $GITHUB_ENV
echo "SOUND_CARD_NAME=Speakers" >> $GITHUB_ENV
echo "SOUND_CARD_FS=48000" >> $GITHUB_ENV
echo "SOUND_CARD_API=Windows WDM-KS" >> $GITHUB_ENV
elif [[ "${{ runner.os }}" == "Linux" ]]; then
echo "Setting env vars for Linux"
echo "_EXPYFUN_SILENT=true" >> $GITHUB_ENV
echo "SOUND_CARD_BACKEND=pyglet" >> $GITHUB_ENV
elif [[ "${{ runner.os }}" == "macOS" ]]; then
echo "Setting env vars for macOS"
fi
name: Set env vars
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
if: matrix.kind != 'conda'
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: 'environment_test.yml'
create-args: python=${{ matrix.python }}
init-shell: bash
if: matrix.kind == 'conda'
# Pyglet pin: https://github.com/pyglet/pyglet/issues/1089 (and need OpenGL2 compat for Pyglet>=2, too)
- run: python -m pip install --upgrade pip setuptools wheel sounddevice "pyglet<1.5.28"
- run: python -m pip install --upgrade --only-binary="rtmixer,scipy,matplotlib,pandas,numpy" rtmixer pyglet-ffmpeg scipy matplotlib pandas h5py mne numpydoc pillow joblib
if: matrix.kind == 'pip'
# arm64 has issues with rtmixer / PortAudio
- run: python -m pip install --only-binary="rtmixer" rtmixer
if: matrix.kind == 'conda' && matrix.os != 'macos-latest'
- run: python -m pip install --only-binary="rtmixer,numpy,scipy,matplotlib" rtmixer "pyglet<1.4" numpy scipy matplotlib "pillow<8"
if: matrix.kind == 'old'
- run: python -m pip install tdtpy
if: startsWith(matrix.os, 'windows')
- run: python -m sounddevice
- run: |
set -o pipefail
python -m sounddevice | grep "[82] out"
name: Check that there is some output device
- run: python -c "import pyglet; print(pyglet.version)"
- run: python -c "import matplotlib.pyplot as plt"
- run: pip install -ve .[test]
# Video hangs on macOS arm64, not sure why
- run: python -c "import expyfun; expyfun._utils._has_video(raise_error=True)"
if: matrix.kind != 'old' && matrix.os != 'macos-latest'
- run: pytest expyfun --cov-report=xml --cov=expyfun
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: always()
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*.orig
.vscode
doc/generated
doc/sg_execution_times.rst
.DS_Store

# C extensions
*.so
Expand Down
Loading

0 comments on commit 7878faf

Please sign in to comment.