Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/stubs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Check type stubs
env:
version: 10.0.0

on:
push:
branches:
- "master"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- "master"
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
stubtest:
if: (github.event_name != 'pull_request') || (github.event.pull_request.draft == false)
runs-on: ubuntu-24.04
env:
PYTHON_VERSION: "3.14"

steps:
- uses: actions/checkout@v6

- name: Install dependencies (SCIPOptSuite)
run: |
wget --quiet --no-check-certificate "https://github.com/scipopt/scip/releases/download/v${{ env.version }}/scipoptsuite_${{ env.version }}-1+jammy_amd64.deb"
sudo apt-get update && sudo apt install -y ./scipoptsuite_${{ env.version }}-1+jammy_amd64.deb

- name: Setup python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install mypy
run: |
python -m pip install mypy

- name: Install PySCIPOpt
run: |
export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror -Wno-error=deprecated-declarations" # Debug mode. More warnings. Warnings as errors, but allow deprecated declarations.
python -m pip install . -v 2>&1 | tee build.log

- name: Run MyPy
run: python -m mypy --package pyscipopt

- name: Run stubtest
run: stubs/test.sh

lint:
runs-on: ubuntu-latest
env:
FILES: src/pyscipopt/scip.pyi

steps:
- uses: actions/checkout@v6

- name: Install Ruff
uses: astral-sh/ruff-action@v3
with:
args: "--version"

- name: Lint type stubs
run: ruff check ${{ env.FILES }} --extend-select ANN,I,PYI,RUF100

- name: Format type stubs
run: ruff format ${{ env.FILES }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

## Unreleased
### Added
- Added automated script for generating type stubs
- Include parameter names in type stubs
- Speed up MatrixExpr.sum(axis=...) via quicksum
### Fixed
- all fundamental callbacks now raise an error if not implemented
- Fixed the type of MatrixExpr.sum(axis=...) result from MatrixVariable to MatrixExpr.
- Updated IIS result in PyiisfinderExec()
### Changed
- changed default value of enablepricing flag to True
### Removed
Expand Down
Loading