Skip to content

Commit

Permalink
MAINT: Make sure CIs are still green (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jun 24, 2024
1 parent f324eb8 commit c7c1b18
Show file tree
Hide file tree
Showing 113 changed files with 5,836 additions and 7,389 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
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 sphinx_bootstrap_theme sphinx_fontawesome numpydoc git+https://github.com/sphinx-gallery/sphinx-gallery
- 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)"
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/*
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
6 changes: 4 additions & 2 deletions .github/workflows/circle_artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,13 +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!
41 changes: 0 additions & 41 deletions .github/workflows/codespell_and_flake.yml

This file was deleted.

71 changes: 41 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'tests'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on:
on: # yamllint disable-line rule:truthy
push:
branches:
- '*'
Expand All @@ -20,67 +20,75 @@ jobs:
shell: bash -el {0}
strategy:
matrix:
os: ['ubuntu-20.04', 'windows-2022']
kind: ['pip']
python: ['3.10']
include:
- os: 'macos-latest'
# 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.10'
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@v3
name: Checkout
- uses: LABSN/sound-ci-helpers@v1
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
- run: sudo apt install -q libavutil56 libavcodec58 libavformat58 libswscale5 libglu1-mesa gstreamer1.0-alsa gstreamer1.0-libav python3-gst-1.0
name: Install Linux video dependencies
# 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 make/get_video.ps1
name: Install Windows video dependencies
- run: powershell tools/get_video.ps1
if: ${{ startsWith(matrix.os, 'windows') }}
- run: |
if [[ "${{ matrix.os }}" == "windows"* ]]; then
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 [[ "${{ matrix.os }}" == "ubuntu"* ]]; then
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 [[ "${{ matrix.os }}" == "macos"* ]]; then
elif [[ "${{ runner.os }}" == "macOS" ]]; then
echo "Setting env vars for macOS"
fi
name: Set env vars
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
if: ${{ matrix.kind != 'conda' }}
if: matrix.kind != 'conda'
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: 'environment_test.yml'
create-args: python=${{ matrix.python }}
init-shell: bash
name: 'Setup conda'
if: ${{ matrix.kind == 'conda' }}
- run: python -m pip install --upgrade pip setuptools wheel sounddevice
if: ${{ matrix.kind != 'conda' }}
- run: python -m pip install --upgrade sounddevice rtmixer "pyglet<1.6" pyglet-ffmpeg scipy matplotlib pandas h5py mne numpydoc pillow joblib
if: ${{ matrix.kind == 'pip' }}
- run: python -m pip install sounddevice rtmixer "pyglet<1.6"
if: ${{ matrix.kind == 'conda' }}
- run: python -m pip install sounddevice rtmixer "pyglet<1.4" numpy scipy matplotlib "pillow<8" codecov
if: ${{ matrix.kind == 'old' }}
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') }}
if: startsWith(matrix.os, 'windows')
- run: python -m sounddevice
- run: |
set -o pipefail
Expand All @@ -89,8 +97,11 @@ jobs:
- 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' }}
- run: pytest --tb=short --cov=expyfun --cov-report=xml expyfun
- uses: codecov/codecov-action@v1
if: success()
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()
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.orig
.vscode
doc/generated
doc/sg_execution_times.rst
.DS_Store

# C extensions
Expand Down
43 changes: 43 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
repos:
# Ruff mne
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
hooks:
- id: ruff
name: ruff lint expyfun
args: ["--fix"]
files: ^expyfun/
- id: ruff
name: ruff lint doc and examples
# D103: missing docstring in public function
# D400: docstring first line must end with period
args: ["--ignore=D103,D400", "--fix"]
files: ^doc/|^examples/
- id: ruff-format
files: ^expyfun/|^doc/|^examples/

# Codespell
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
additional_dependencies:
- tomli
files: ^expyfun/|^doc/|^examples/
types_or: [python, bib, rst, inc]

# yamllint
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict, -c, .yamllint.yml]

# rstcheck
- repo: https://github.com/rstcheck/rstcheck.git
rev: v6.2.0
hooks:
- id: rstcheck
additional_dependencies:
- tomli
files: ^doc/.*\.(rst|inc)$
8 changes: 8 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends: default

ignore: |
.github/workflows/codeql-analysis.yml
rules:
line-length: disable
document-start: disable
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ recursive-include expyfun/data *

### Exclude

exclude make
exclude tools
exclude doc
exclude .circleci
exclude Makefile
Expand All @@ -21,6 +21,6 @@ exclude .mailmap
recursive-exclude expyfun *.pyc

recursive-exclude doc *
recursive-exclude make *
recursive-exclude tools *
recursive-exclude examples *.tab
recursive-exclude .circleci *
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ github_checks: # too noisy, even though "a" interactively disables them

codecov:
notify:
require_ci_to_pass: no
require_ci_to_pass: false

coverage:
status:
Expand Down
Loading

0 comments on commit c7c1b18

Please sign in to comment.