fix #679 - defer printing of partial characters at end of buffer when flushing text PyIO #1016
Workflow file for this run
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: Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonexe }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x64] # x86 unsupported by MicroMamba | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
jlversion: ['1','1.9'] | |
pythonexe: ['@CondaPkg'] | |
include: | |
- arch: x64 | |
os: ubuntu-latest | |
jlversion: '1' | |
pythonexe: python | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Julia ${{ matrix.jlversion }} | |
uses: julia-actions/setup-julia@v2 | |
with: | |
version: ${{ matrix.jlversion }} | |
arch: ${{ matrix.arch }} | |
- uses: julia-actions/cache@v2 | |
- name: Build package | |
uses: julia-actions/julia-buildpkg@v1 | |
env: | |
PYTHON: python | |
- name: Run tests | |
uses: julia-actions/julia-runtest@v1 | |
env: | |
JULIA_DEBUG: PythonCall | |
JULIA_NUM_THREADS: '2' | |
PYTHON: python | |
JULIA_PYTHONCALL_EXE: ${{ matrix.pythonexe }} | |
- name: Process coverage | |
uses: julia-actions/julia-processcoverage@v1 | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
python: | |
name: Test 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.9"] | |
juliaexe: ["@JuliaPkg"] | |
include: | |
- os: ubuntu-latest | |
pyversion: 3 | |
juliaexe: julia | |
env: | |
MANUAL_TEST_PROJECT: /tmp/juliacall-test-project | |
PYTHON_JULIACALL_THREADS: '2' | |
PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes' | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Python ${{ matrix.pyversion }} | |
uses: actions/setup-python@v6 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
- 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@v6 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
- name: Set up Julia | |
id: setup_julia | |
uses: julia-actions/setup-julia@v2 | |
with: | |
# Python in the GitHub runners ships with OpenSSL 3.0. Julia 1.12 requires | |
# OpenSSL 3.5. Therefore juliapkg requires Julia 1.11 or lower. | |
version: '1.11' | |
- 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@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |