Repository navigation
Fix baseline stubtest failures across maintained stubs - #406
Open
Rich Chiodo (rchiodo) wants to merge 5 commits into
Open
Rich Chiodo (rchiodo) wants to merge 5 commits into
Rich Chiodo (rchiodo) wants to merge 5 commits into
Conversation
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
There was a problem hiding this comment.
🟡 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
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
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Follow up on #396 by fixing the pre-existing stubtest failures separately from action pinning.
__new__andSelf, annotate disjoint bases accurately, and remove obsolete exceptions.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.
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.