Infrastructure and dependencies update #118
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Tests | |
| on: [push, pull_request] | |
| jobs: | |
| get_python_versions: | |
| name: "Determine Python versions" | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| outputs: | |
| min-python: ${{ steps.nep29.outputs.min-python }} | |
| max-python: "${{ steps.nep29.outputs.max-python }}" | |
| steps: | |
| - name: "calculate versions according to SPEC-0" | |
| id: nep29 | |
| uses: mstimberg/github-calc-nep29@a73481e4e8488a5fa0b3be70a385cc5206a261ba # v0.7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| # Match SPEC-0 | |
| deprecate-python-after: 36 | |
| min-python-releases: 0 | |
| build: | |
| runs-on: ubuntu-latest | |
| needs: [get_python_versions] | |
| name: "Python ${{ matrix.python-version }} (latest Brian: ${{ matrix.latest-brian }})" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["${{ needs.get_python_versions.outputs.min-python }}", "3.13"] | |
| latest-brian: [false, true] | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Install brian2modelfitting | |
| run: uv sync -v --extra skopt --extra sbi --extra test --dev # Not testing efel for now, since incompatible with numpy 2 | |
| - name: Update to latest Brian development version | |
| run: uv pip install -i https://test.pypi.org/simple/ --pre --upgrade Brian2 | |
| if: ${{ matrix.latest-brian }} | |
| - name: Check for syntax errors and undefined names | |
| run: uv run ruff check . --select=E9,F63,F7,F82 | |
| - name: Test with pytest | |
| run: | | |
| uv run --no-sync --frozen pytest --timeout=120 --cov=brian2modelfitting | |
| - name: Upload coverage to coveralls | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| if: ${{ matrix.python-version == needs.get_python_versions.outputs.min-python && ! matrix.latest-brian}} | |
| run: coveralls --service=github | |