readcon-core 0.14.7

An oxidized single and multiple CON file reader and writer with FFI bindings for ergonomic C/C++ usage.
Documentation
name: Python ReadCon

on:
  push:
    branches: [main]
    paths:
      - 'src/**'
      - 'tests/python/**'
      - 'resources/test/**'
      - 'docs/orgmode/tutorial.org'
      - 'docs/orgmode/chemfiles-notebook.org'
      - 'docs/notebooks/**'
      - 'scripts/run-tutorial-core.sh'
      - 'scripts/run-chemfiles-notebook.sh'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - 'pyproject.toml'
      - '.github/workflows/ci_python.yml'
  pull_request:
    branches: [main]
    paths:
      - 'src/**'
      - 'tests/python/**'
      - 'resources/test/**'
      - 'docs/orgmode/tutorial.org'
      - 'docs/orgmode/chemfiles-notebook.org'
      - 'docs/notebooks/**'
      - 'scripts/run-tutorial-core.sh'
      - 'scripts/run-chemfiles-notebook.sh'
      - 'Cargo.toml'
      - 'Cargo.lock'
      - 'pyproject.toml'
      - '.github/workflows/ci_python.yml'
  workflow_dispatch:

concurrency:
  group: python-tests-${{ github.ref }}
  cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
  pytest:
    name: pytest (${{ matrix.features }})
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        include:
          - features: python
            name: lean
          - features: python,chemfiles-from-sources
            name: chemfiles
    steps:
      - uses: actions/checkout@v6

      - uses: dtolnay/rust-toolchain@stable

      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Install maturin, pytest, emacs (org-babel)
        run: |
          python -m venv .venv
          echo "VIRTUAL_ENV=$PWD/.venv" >> "$GITHUB_ENV"
          echo "$PWD/.venv/bin" >> "$GITHUB_PATH"
          .venv/bin/python -m pip install -U pip
          .venv/bin/python -m pip install maturin pytest numpy
          sudo apt-get update
          sudo apt-get install -y --no-install-recommends emacs-nox

      - name: maturin develop
        env:
          # match wheel CI: avoid mold breakage on some runners
          RUSTFLAGS: "-C link-arg=-fuse-ld=bfd"
        run: |
          maturin develop --features '${{ matrix.features }}'

      # Org Babel: tangle tutorial.org → docs/notebooks/tutorial_core.py and run
      - name: Org Babel One Good Tutorial
        run: |
          scripts/run-tutorial-core.sh

      # Org Babel: tangle chemfiles-notebook.org → chemfiles_ingress.py and run
      - name: Org Babel chemfiles notebook
        if: matrix.name == 'chemfiles'
        run: |
          scripts/run-chemfiles-notebook.sh

      - name: pytest tests/python
        run: |
          python -m pytest tests/python/ -q --tb=short