Bump to NumPy 2.x #667
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python package | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # 3.13 is now available and worth testing for NumPy 2.0+ | |
| python-version: ["3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'pip' # Automatically caches your dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install flake8 pytest pytest-cov | |
| # Install requirements first | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| # Install remaining packages without --user | |
| pip install pyyaml TextGrid mne-bids | |
| # Final sanity check to ensure NumPy 2.0 didn't get downgraded | |
| python -c "import numpy; print(f'Using NumPy {numpy.__version__}')" | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Test with pytest and get coverage | |
| run: | | |
| # Using -v helps identify exactly which test crashes if collection fails | |
| pytest -v tests/ --cov=./naplib/ --cov-report=xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v4 # Updated to v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # v4 often requires a token |