From aafabcef0157ece3090b0fae5f81a4392453277e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Sat, 20 Jul 2024 13:55:42 -0400 Subject: [PATCH 1/5] MAINT: Update CIs --- .github/dependabot.yml | 10 +++++++ .github/release.yaml | 6 +++++ .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 16 ++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/release.yaml create mode 100644 .github/workflows/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d57929b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" + groups: + actions: + patterns: + - "*" diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..386ce98 --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,6 @@ +changelog: + exclude: + authors: + - dependabot + - pre-commit-ci + - github-actions diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a004ff9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +# Upload a Python Package using Twine when a release is created + +name: Build +on: # yamllint disable-line rule:truthy + release: + types: [published] + push: + branches: ["main", "maint/*"] + pull_request: + branches: ["main", "maint/*"] + +permissions: + contents: read + +jobs: + package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build twine + - run: python -m build --sdist --wheel + - run: twine check --strict dist/* + - uses: actions/upload-artifact@v4 + with: + name: dist + path: dist + + pypi-upload: + needs: package + runs-on: ubuntu-latest + if: github.event_name == 'release' + permissions: + id-token: write # for trusted publishing + environment: + name: pypi + url: https://pypi.org/p/mne + steps: + - uses: actions/download-artifact@v4 + with: + name: dist + path: dist + - uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event_name == 'release' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a8a1d14..8148f9b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,3 +50,19 @@ jobs: with: qt: true pyvista: false + - run: pip install --upgrade pip setuptools + # TODO: Relax this pin + # TODO: Remove nose dependency + - run: pip install -ve . s3cmd mne scikit-learn nose pytest pytest-cov "mne<0.24" nibabel + - run: openssl aes-256-cbc -K "${{ secrets.encrypted_73bd2a498087_key }}" -iv "${{ secrets.encrypted_73bd2a498087_iv }}" -in .s3cfg.enc -out ~/.s3cfg -d + - run: python -c "from pathlib import Path; assert (Path('~').expanduser() / '.s3cfg').is_file()" + - run: mkdir ~/mne-hcp-data + - run: s3cmd get s3://mne-hcp-testing-data/mne-hcp-testing.tar.gz ~/mne-hcp-data/ + - run: cd ~/mne-hcp-data/ && tar -xvzf mne-hcp-testing.tar.gz + - run: find ~/mne-hcp-data/mne-hcp-testing/105923 -name "*" > output.txt && cat output.txt | wc -l && head output.txt + - run: mkdir -p "${{ env.SUBJECTS_DIR}}" && python -c "import mne; mne.datasets.fetch_fsaverage(subjects_dir='${{ env.subjects_dir }}')" + - run: pytest -rfEXs --cov-report= --tb=short --durations 30 -v --cov=mne --cov-report xml hcp + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + if: success() From 9e6085898fe1f4e80c1598dca353ffa8c2eb2038 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Sat, 20 Jul 2024 14:08:12 -0400 Subject: [PATCH 2/5] FIX: More --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8148f9b..9309c84 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,9 +51,11 @@ jobs: qt: true pyvista: false - run: pip install --upgrade pip setuptools + # TODO: shouldn't need to install NumPy first or pin it (distutils gone in 2.0), bad build reqs + - run: pip install --upgrade "numpy<2" s3cmd mne scikit-learn nose pytest pytest-cov "mne<0.24" nibabel # TODO: Relax this pin # TODO: Remove nose dependency - - run: pip install -ve . s3cmd mne scikit-learn nose pytest pytest-cov "mne<0.24" nibabel + - run: pip install -ve . - run: openssl aes-256-cbc -K "${{ secrets.encrypted_73bd2a498087_key }}" -iv "${{ secrets.encrypted_73bd2a498087_iv }}" -in .s3cfg.enc -out ~/.s3cfg -d - run: python -c "from pathlib import Path; assert (Path('~').expanduser() / '.s3cfg').is_file()" - run: mkdir ~/mne-hcp-data From 3e33b9e28a618faec50084d0790ccf114b20ffca Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Sat, 20 Jul 2024 14:09:25 -0400 Subject: [PATCH 3/5] FIX: Iso --- .github/workflows/tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9309c84..6a01bfe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -46,16 +46,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - - uses: pyvista/setup-headless-display-action@main - with: - qt: true - pyvista: false - run: pip install --upgrade pip setuptools # TODO: shouldn't need to install NumPy first or pin it (distutils gone in 2.0), bad build reqs - run: pip install --upgrade "numpy<2" s3cmd mne scikit-learn nose pytest pytest-cov "mne<0.24" nibabel # TODO: Relax this pin # TODO: Remove nose dependency - - run: pip install -ve . + - run: pip install --no-build-isolation -ve . - run: openssl aes-256-cbc -K "${{ secrets.encrypted_73bd2a498087_key }}" -iv "${{ secrets.encrypted_73bd2a498087_iv }}" -in .s3cfg.enc -out ~/.s3cfg -d - run: python -c "from pathlib import Path; assert (Path('~').expanduser() / '.s3cfg').is_file()" - run: mkdir ~/mne-hcp-data @@ -63,6 +59,11 @@ jobs: - run: cd ~/mne-hcp-data/ && tar -xvzf mne-hcp-testing.tar.gz - run: find ~/mne-hcp-data/mne-hcp-testing/105923 -name "*" > output.txt && cat output.txt | wc -l && head output.txt - run: mkdir -p "${{ env.SUBJECTS_DIR}}" && python -c "import mne; mne.datasets.fetch_fsaverage(subjects_dir='${{ env.subjects_dir }}')" + # TODO: Move this to the top (toward bottom to speed up testing of steps above) + - uses: pyvista/setup-headless-display-action@main + with: + qt: true + pyvista: false - run: pytest -rfEXs --cov-report= --tb=short --durations 30 -v --cov=mne --cov-report xml hcp - uses: codecov/codecov-action@v4 with: From 4eaa59cd44673689e333db2938be50c3085d4b4c Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 23 Jul 2024 16:23:02 -0400 Subject: [PATCH 4/5] FIX: Name --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6a01bfe..9154c6d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,7 +58,7 @@ jobs: - run: s3cmd get s3://mne-hcp-testing-data/mne-hcp-testing.tar.gz ~/mne-hcp-data/ - run: cd ~/mne-hcp-data/ && tar -xvzf mne-hcp-testing.tar.gz - run: find ~/mne-hcp-data/mne-hcp-testing/105923 -name "*" > output.txt && cat output.txt | wc -l && head output.txt - - run: mkdir -p "${{ env.SUBJECTS_DIR}}" && python -c "import mne; mne.datasets.fetch_fsaverage(subjects_dir='${{ env.subjects_dir }}')" + - run: mkdir -p "${{ env.SUBJECTS_DIR}}" && python -c "import mne; mne.datasets.fetch_fsaverage(subjects_dir='${{ env.SUBJECTS_DIR }}')" # TODO: Move this to the top (toward bottom to speed up testing of steps above) - uses: pyvista/setup-headless-display-action@main with: From e7c0227b1074fac17cab04f197e925771e7f979d Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Tue, 23 Jul 2024 17:30:40 -0400 Subject: [PATCH 5/5] FIX: More fixes --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9154c6d..2d5ec0b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,7 +64,7 @@ jobs: with: qt: true pyvista: false - - run: pytest -rfEXs --cov-report= --tb=short --durations 30 -v --cov=mne --cov-report xml hcp + - run: pytest -rfEXs --cov-report= --tb=short --durations 30 -v --cov=hcp --cov-report xml hcp - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }}