pyrepl #1235
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: Tests | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| jobs: | |
| julia: | |
| name: Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonexe }} ${{ matrix.pyversion}}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| jlversion: ['1','1.10'] | |
| pythonexe: ['@CondaPkg'] | |
| pyversion: ['3'] | |
| include: | |
| - os: ubuntu-latest | |
| jlversion: '1' | |
| pythonexe: python | |
| pyversion: '3' | |
| - os: ubuntu-latest | |
| jlversion: '1' | |
| pythonexe: python | |
| pyversion: '3.14t' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Julia ${{ matrix.jlversion }} | |
| uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: ${{ matrix.jlversion }} | |
| - uses: julia-actions/cache@v3 | |
| - name: Build package | |
| uses: julia-actions/julia-buildpkg@v1 | |
| env: | |
| PYTHON: python | |
| - name: Install Python | |
| id: setup-python | |
| uses: actions/setup-python@v6 | |
| if: ${{ matrix.pythonexe == 'python' }} | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Build PyCall | |
| if: ${{ matrix.pythonexe == 'python' }} | |
| run: | | |
| julia --project=test -e 'import Pkg; Pkg.build("PyCall")' | |
| env: | |
| PYTHON: ${{ steps.setup-python.outputs.python-path }} | |
| - name: Run tests | |
| uses: julia-actions/julia-runtest@v1 | |
| env: | |
| JULIA_DEBUG: ${{ runner.debug == '1' && 'PythonCall' || '' }} | |
| JULIA_NUM_THREADS: '2' | |
| PYTHON: ${{ steps.setup-python.outputs.python-path }} | |
| JULIA_PYTHONCALL_EXE: ${{ case(matrix.pythonexe == 'python', steps.setup-python.outputs.python-path, matrix.pythonexe) }} | |
| - name: Process coverage | |
| uses: julia-actions/julia-processcoverage@v1 | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| python: | |
| name: Python (${{ matrix.pyversion }}, ${{ matrix.os }}, ${{ matrix.juliaexe }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| pyversion: ['3', '3.10'] | |
| juliaexe: ["@JuliaPkg"] | |
| include: | |
| - os: ubuntu-latest | |
| pyversion: '3' | |
| juliaexe: julia | |
| - os: ubuntu-latest | |
| pyversion: '3.14t' | |
| juliaexe: '@JuliaPkg' | |
| env: | |
| MANUAL_TEST_PROJECT: /tmp/juliacall-test-project | |
| PYTHON_JULIACALL_THREADS: '2' | |
| PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| # We previously had to restrict to Julia 1.11 because Julia 1.12 requires OpenSSL | |
| # 3.5 but the GitHub runners only ship Python with OpenSSL 3.0. | |
| # - name: Check Python OpenSSL version (see setup_julia) | |
| # shell: python | |
| # run: | | |
| # import ssl | |
| # assert ssl.OPENSSL_VERSION_INFO < (3, 5) | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Set up Julia | |
| id: setup_julia | |
| uses: julia-actions/setup-julia@v3 | |
| with: | |
| version: '1' | |
| - name: Set up test Julia project | |
| if: ${{ matrix.juliaexe == 'julia' }} | |
| run: | | |
| mkdir ${{ env.MANUAL_TEST_PROJECT }} | |
| julia --project=${{ env.MANUAL_TEST_PROJECT }} -e 'import Pkg; Pkg.develop(path="."); Pkg.instantiate()' | |
| - name: Install dependencies | |
| run: | | |
| cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json | |
| uv sync --dev | |
| - name: Lint with flake8 | |
| run: | | |
| # stop the build if there are Python syntax errors or undefined names | |
| uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics | |
| # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
| uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
| - name: Run tests (with JuliaPkg) | |
| if: ${{ matrix.juliaexe == '@JuliaPkg' }} | |
| run: | | |
| uv run pytest -s --nbval --cov=pysrc ./pytest/ | |
| - name: Run tests (without JuliaPkg) | |
| if: ${{ matrix.juliaexe == 'julia' }} | |
| run: | | |
| uv run pytest -s --nbval --cov=pysrc ./pytest/ | |
| env: | |
| PYTHON_JULIACALL_EXE: "${{ steps.setup_julia.outputs.julia-bindir }}/julia" | |
| PYTHON_JULIACALL_PROJECT: ${{ env.MANUAL_TEST_PROJECT }} | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v7 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |