Skip to content

Fix baseline stubtest failures across maintained stubs - #406

Open
Rich Chiodo (rchiodo) wants to merge 5 commits into
mainfrom
rchiodo/fix-stubtest-baseline
Open

Rich Chiodo (rchiodo) wants to merge 5 commits into
mainfrom
rchiodo/fix-stubtest-baseline

Conversation

@rchiodo

Copy link
Copy Markdown
Contributor

Summary

Follow up on #396 by fixing the pre-existing stubtest failures separately from action pinning.

  • Correct SymPy singleton/constant annotations, read-only properties, callable aliases, and signature-preserving decorators. Remove 1,066 obsolete allowlist entries; retain narrowly documented runtime-source/backend inference exceptions.
  • Update scikit-image estimation/model/transform APIs for its latest compatible releases: 0.25 on Python 3.10 and 0.26 on Python 3.11+. Preserve supported deprecated calls and document five upstream signature-metadata exceptions. Make existing exact test-module exceptions optional for wheels that omit tests.
  • Describe scikit-learn Cython constructors with __new__ and Self, annotate disjoint bases accurately, and remove obsolete exceptions.
  • Update VisPy text layout, line caps, marker size limits, mouse modifiers, and font registration APIs. Account for Python-version-dependent builtin subclass layouts.
  • Add type regressions and runtime estimation regressions, execute runtime regressions in all CI matrix jobs, and document local validation.

No dependency downgrades, blanket API exclusions, or disabled checks.

Local validation

Both Python 3.10 and 3.13 pass the complete Ruff, mypy, Pyright, and stubtest checks. Runtime regressions pass on both versions.

Runtime check Python 3.10 Python 3.13
SymPy 1.14.0 1,516 modules 1,516 modules
scikit-learn 1.6.1 649 modules 649 modules
VisPy 0.17.0 372 modules 372 modules
scikit-image 424 modules (0.25.2) 259 modules (0.26.0)
Runtime regressions 1 passed 4 passed

Mypy checks all 1,288 source files; Pyright reports zero errors. CI retains the full Linux/Windows/macOS and Python 3.10/3.13 matrix to verify platform-specific wheel differences.

Update VisPy layout APIs and scikit-learn Cython constructors, annotate disjoint bases with Python-version-aware builtin layouts, and remove obsolete exceptions. Add property and constructor type regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee5422c8-7d8e-4ef8-a050-de857f5b799a
Annotate canonical singleton and constant values, model read-only properties and callable aliases, preserve decorator signatures, and cover representative types with regressions. Keep only narrow documented exceptions for runtime-source inference artifacts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee5422c8-7d8e-4ef8-a050-de857f5b799a
Support scikit-image 0.25 on Python 3.10 and 0.26 on newer Python versions without changing dependencies. Update estimation and transform APIs, document wrapper metadata exceptions, and retain optional exact test-module exclusions across wheel layouts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee5422c8-7d8e-4ef8-a050-de857f5b799a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: ee5422c8-7d8e-4ef8-a050-de857f5b799a

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The stubs incorrectly exclude fixed-arity models from RansacModelProtocol and bind away sympify’s first parameter in the singleton alias, rejecting valid calls while accepting S().

2 open issues
What changed in this PR

This PR addresses baseline stubtest failures across the maintained SymPy, scikit-image, scikit-learn, and VisPy stubs, separately from CI action pinning.

Changes:

  • Corrects constants, properties, callable signatures, constructors, and extension-type inheritance annotations.
  • Updates version-dependent scikit-image APIs and refines stubtest exceptions.
  • Adds typing and runtime regressions, runs runtime checks in CI, and documents local validation.
File Description
tests/​vispy/​visuals_tests.py Adds visual-property and constructor typing regressions.
tests/​sympy/​sympy_tests.py Adds constant, property, callable, and decorator regressions.
tests/​sklearn/​cython_constructors_tests.py Checks Cython constructor and subclass return types.
tests/​skimage/​test_estimation.py Tests legacy and new estimation APIs.
stubs/​vispy/​visuals/​text/​text.pyi Adds line-height and scaling APIs.
stubs/​vispy/​visuals/​markers.pyi Adds canvas-size limit properties.
stubs/​vispy/​visuals/​line/​line.pyi Adds line-cap configuration.
stubs/​vispy/​visuals/​graphs/​util.pyi Declares the sparse-array predicate.
stubs/​vispy/​util/​fonts/​_vispy_fonts.pyi Adds font registration.
stubs/​vispy/​stubtest_allowlist.txt Adds specific test-module exceptions.
stubs/​vispy/​scene/​events.pyi Types mouse-event modifiers.
stubs/​vispy/​gloo/​gl/​_constants.pyi Accounts for version-dependent integer-subclass layouts.
stubs/​sympy-stubs/​utilities/​decorator.pyi Preserves types through public.
stubs/​sympy-stubs/​tensor/​tensor.pyi Types the tensor multiplication identity.
stubs/​sympy-stubs/​tensor/​array/​expressions/​array_expressions.pyi Types array-element flags.
stubs/​sympy-stubs/​stats/​stochastic_process_types.pyi Types process index sets and constants.
stubs/​sympy-stubs/​stats/​rv.pyi Types the module symbol.
stubs/​sympy-stubs/​stats/​drv.pyi Types the discrete distribution support set.
stubs/​sympy-stubs/​stats/​drv_types.pyi Types discrete distribution support constants.
stubs/​sympy-stubs/​stats/​crv.pyi Types the continuous distribution support set.
stubs/​sympy-stubs/​stats/​crv_types.pyi Types continuous support sets and infinity.
stubs/​sympy-stubs/​solvers/​__init__.pyi Corrects the solver import and complex-set constant.
stubs/​sympy-stubs/​simplify/​powsimp.pyi Types the internal dummy symbol.
stubs/​sympy-stubs/​simplify/​hyperexpand.pyi Types the internal dummy symbol.
stubs/​sympy-stubs/​sets/​sets.pyi Types set flags and slots.
stubs/​sympy-stubs/​sets/​ordinals.pyi Types ordinal singleton exports.
stubs/​sympy-stubs/​sets/​handlers/​comparison.pyi Declares the equality dispatcher.
stubs/​sympy-stubs/​sets/​fancysets.pyi Types numeric-set bounds.
stubs/​sympy-stubs/​sets/​conditionset.pyi Types the condition-set dummy symbol.
stubs/​sympy-stubs/​sets/​__init__.pyi Types exported set singletons.
stubs/​sympy-stubs/​series/​__init__.pyi Types the empty-sequence singleton.
stubs/​sympy-stubs/​printing/​printer.pyi Allows an unset print-method name.
stubs/​sympy-stubs/​polys/​polyroots.pyi Types the polynomial root symbol.
stubs/​sympy-stubs/​polys/​polyquinticconst.pyi Types the quintic helper symbol.
stubs/​sympy-stubs/​polys/​polyclasses.pyi Corrects polynomial constructors to __new__.
stubs/​sympy-stubs/​polys/​monomials.pyi Corrects the monomial-operations constructor.
stubs/​sympy-stubs/​polys/​domains/​pythonrational.pyi Resolves the Python rational class alias.
stubs/​sympy-stubs/​polys/​domains/​pythonintegerring.pyi Types the Python integer-ring alias.
stubs/​sympy-stubs/​polys/​domains/​gmpyintegerring.pyi Types the GMP integer-ring alias.
stubs/​sympy-stubs/​polys/​domains/​gaussiandomains.pyi Corrects Gaussian rational class constants.
stubs/​sympy-stubs/​polys/​domains/​finitefield.pyi Types field metadata and the field-status property.
stubs/​sympy-stubs/​polys/​domains/​expressionrawdomain.pyi Types expression-domain identities.
stubs/​sympy-stubs/​physics/​units/​unitsystem.pyi Corrects the dimensional-expression return type.
stubs/​sympy-stubs/​physics/​units/​quantities.pyi Types quantity assumption flags.
stubs/​sympy-stubs/​physics/​units/​prefixes.pyi Types prefixes and their lookup dictionaries.
stubs/​sympy-stubs/​physics/​units/​dimensions.pyi Types dimension metadata and flags.
stubs/​sympy-stubs/​physics/​units/​__init__.pyi Types exported dimension constants.
stubs/​sympy-stubs/​physics/​matrices.pyi Types the Minkowski tensor constant.
stubs/​sympy-stubs/​matrices/​expressions/​transpose.pyi Types the transpose flag.
stubs/​sympy-stubs/​matrices/​expressions/​trace.pyi Types trace flags.
stubs/​sympy-stubs/​matrices/​expressions/​matmul.pyi Types matrix multiplication flags and identity.
stubs/​sympy-stubs/​matrices/​expressions/​matexpr.pyi Types matrix flags and array conversion.
stubs/​sympy-stubs/​matrices/​expressions/​matadd.pyi Types matrix addition flags and identity.
stubs/​sympy-stubs/​matrices/​expressions/​kronecker.pyi Types the Kronecker-product flag.
stubs/​sympy-stubs/​matrices/​expressions/​inverse.pyi Types the inverse exponent constant.
stubs/​sympy-stubs/​matrices/​expressions/​hadamard.pyi Types the Hadamard-product flag.
stubs/​sympy-stubs/​logic/​boolalg.pyi Corrects Boolean constants, constructors, and operator aliases.
stubs/​sympy-stubs/​liealgebras/​cartan_type.pyi Types the callable Cartan-type generator.
stubs/​sympy-stubs/​integrals/​transforms.pyi Types inverse Mellin helper symbols.
stubs/​sympy-stubs/​integrals/​meijerint.pyi Types the integration dummy symbol.
stubs/​sympy-stubs/​integrals/​manualintegrate.pyi Types integration and cache dummy symbols.
stubs/​sympy-stubs/​integrals/​laplace.pyi Types inverse Laplace helper symbols.
stubs/​sympy-stubs/​holonomic/​holonomic.pyi Types the holonomic helper symbol.
stubs/​sympy-stubs/​geometry/​entity.pyi Types the geometry dummy symbol.
stubs/​sympy-stubs/​functions/​special/​spherical_harmonics.pyi Types the internal dummy symbol.
stubs/​sympy-stubs/​functions/​special/​polynomials.pyi Types the polynomial dummy symbol.
stubs/​sympy-stubs/​functions/​special/​error_functions.pyi Types special-function constants.
stubs/​sympy-stubs/​functions/​special/​beta_functions.pyi Types accepted argument-count sets.
stubs/​sympy-stubs/​functions/​special/​bessel.pyi Types Bessel constants and argument-count sets.
stubs/​sympy-stubs/​functions/​elementary/​trigonometric.pyi Corrects argument properties and rewrite signatures.
stubs/​sympy-stubs/​functions/​elementary/​piecewise.pyi Types constants, flags, and assumption methods.
stubs/​sympy-stubs/​functions/​elementary/​miscellaneous.pyi Types identity and min/max constants.
stubs/​sympy-stubs/​functions/​elementary/​integers.pyi Adds rounding and fractional-part declarations.
stubs/​sympy-stubs/​functions/​elementary/​exponential.pyi Corrects logarithm arguments and singularities.
stubs/​sympy-stubs/​functions/​elementary/​complexes.pyi Makes arguments read-only and types flags.
stubs/​sympy-stubs/​functions/​combinatorial/​numbers.pyi Types the internal symbol.
stubs/​sympy-stubs/​external/​pythonmpq.pyi Types rational implementation slots.
stubs/​sympy-stubs/​crypto/​crypto.pyi Types cipher alphabet constants.
stubs/​sympy-stubs/​core/​symbol.pyi Types symbol metadata and read-only binary symbols.
stubs/​sympy-stubs/​core/​singleton.pyi Types the singleton registry and callable alias.
stubs/​sympy-stubs/​core/​relational.pyi Types relational flags, operators, and slots.
stubs/​sympy-stubs/​core/​power.pyi Makes power arguments read-only.
stubs/​sympy-stubs/​core/​numbers.pyi Types numeric constants, flags, and reflected operators.
stubs/​sympy-stubs/​core/​mul.pyi Corrects multiplication arguments and assumption methods.
stubs/​sympy-stubs/​core/​kind.pyi Types kind singleton exports.
stubs/​sympy-stubs/​core/​function.pyi Corrects function metadata and bound-symbol aliases.
stubs/​sympy-stubs/​core/​exprtools.pyi Types the expression helper symbol.
stubs/​sympy-stubs/​core/​expr.pyi Corrects metadata, rounding alias, and obsolete API.
stubs/​sympy-stubs/​core/​decorators.pyi Preserves decorated callable signatures.
stubs/​sympy-stubs/​core/​containers.pyi Corrects reflected tuple multiplication.
stubs/​sympy-stubs/​core/​basic.pyi Types flags, read-only assumptions, and substitution arguments.
stubs/​sympy-stubs/​core/​add.pyi Makes arguments read-only and declares assumption methods.
stubs/​sympy-stubs/​core/​__init__.pyi Types exported numeric singletons.
stubs/​sympy-stubs/​combinatorics/​subsets.pyi Types optional subset caches.
stubs/​sympy-stubs/​combinatorics/​prufer.pyi Types optional Prüfer representations and metadata.
stubs/​sympy-stubs/​combinatorics/​polyhedron.pyi Corrects vertices alias and polyhedron constants.
stubs/​sympy-stubs/​combinatorics/​permutations.pyi Types permutation caches and flags.
stubs/​sympy-stubs/​combinatorics/​perm_groups.pyi Types the permutation-group flag.
stubs/​sympy-stubs/​combinatorics/​pc_groups.pyi Types polycyclic-group flags.
stubs/​sympy-stubs/​combinatorics/​partitions.pyi Types optional partition caches.
stubs/​sympy-stubs/​combinatorics/​graycode.pyi Types Gray-code state.
stubs/​sympy-stubs/​codegen/​fnodes.pyi Types Fortran attributes and argument-count sets.
stubs/​sympy-stubs/​codegen/​cnodes.pyi Types C attributes and the void type.
stubs/​sympy-stubs/​codegen/​cfunctions.pyi Types C-function constants and argument-count sets.
stubs/​sympy-stubs/​codegen/​ast.pyi Types code-generation tokens, types, and streams.
stubs/​sympy-stubs/​assumptions/​sathandlers.pyi Types the assumption-handler symbol.
stubs/​sympy-stubs/​assumptions/​relation/​equality.pyi Types relation-predicate metadata.
stubs/​sympy-stubs/​assumptions/​assume.pyi Types applied-predicate slots.
stubs/​sympy-stubs/​assumptions/​ask.pyi Types the assumption-key registry.
stubs/​sklearn/​utils/​_seq_dataset.pyi Corrects dataset constructors and extension layouts.
stubs/​sklearn/​utils/​_pprint.pyi Accounts for version-dependent tuple-subclass layouts.
stubs/​sklearn/​utils/​_fast_dict.pyi Marks the extension type as a disjoint base.
stubs/​sklearn/​tree/​_tree.pyi Corrects tree-builder constructors and extension layouts.
stubs/​sklearn/​tree/​_splitter.pyi Marks the splitter as a disjoint base.
stubs/​sklearn/​tree/​_criterion.pyi Annotates criterion extension layouts.
stubs/​sklearn/​stubtest_allowlist.txt Removes obsolete exceptions.
stubs/​sklearn/​metrics/​_dist_metrics.pyi Annotates distance-metric extension layouts.
stubs/​sklearn/​linear_model/​_sgd_fast.pyi Annotates loss-function extension layouts.
stubs/​sklearn/​_loss/​_loss.pyi Annotates Cython loss extension layouts.
stubs/​skimage/​transform/​_geometric.pyi Adds version-dependent constructors and estimation methods.
stubs/​skimage/​stubtest_allowlist.txt Makes test exceptions optional and documents signature exceptions.
stubs/​skimage/​README.md Documents version targets and estimation compatibility.
stubs/​skimage/​measure/​fit.pyi Adds model construction, estimation, and protocol declarations.
stubs/​skimage/​measure/​_regionprops.pyi Adds version-dependent median intensity.
stubs/​skimage/​measure/​__init__.pyi Exports the version-dependent model protocol.
stubs/​skimage/​feature/​_cascade.pyi Annotates the cascade extension layout.
stubs/​skimage/​feature/​_basic_features.pyi Updates the version-dependent worker parameter.
stubs/​skimage/​draw/​draw.pyi Adds version-dependent doctest metadata.
stubs/​skimage/​data/​_registry.pyi Limits legacy registries to older releases.
stubs/​skimage/​data/​_fetchers.pyi Adds the version-dependent fetch prefix.
stubs/​skimage/​_shared/​utils.pyi Adds estimation failure types and decorator options.
stubs/​skimage/​_shared/​testing.pyi Updates version-dependent test-data fetching.
CONTRIBUTING.md Documents validation commands and exception guidance.
.github/​workflows/​test.yml Runs runtime regressions across the CI matrix.

Review effort: Balanced

Comment thread stubs/skimage/measure/fit.pyi Outdated
Comment thread stubs/sympy-stubs/core/singleton.pyi Outdated
@StellaHuang95

Stella Huang (StellaHuang95) commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🔒 Automated review in progress — Stella Huang (@StellaHuang95) is auto-reviewing this PR.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: ee5422c8-7d8e-4ef8-a050-de857f5b799a
@Avasam

Avasam (Avasam) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Writing here so I also update #397 (I quick-fixed simply by updating the baseline ignores, but if you actually update the stubs that's probably better)

Also re-mentioning #398 for sympy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants