Skip to content

docstub warnings for Python SWIG bindings #13356

@geographika

Description

@geographika

What is the bug?

The initial docstub PR #13270 used docstub=0.4.0 and all errors were resolved.
The latest version is 0.6.0 and is logging thousands of warnings (e.g. in this log).

2025-11-07T15:15:56.7634318Z 3:     /__w/gdal/gdal/build/swig/python/osgeo/gnm.py:400
2025-11-07T15:15:56.7642762Z 3: W Missing annotation for parameter 'args'
2025-11-07T15:15:56.7643480Z 3:     /__w/gdal/gdal/build/swig/python/osgeo/gnm.py:404
2025-11-07T15:15:56.8187590Z 3: W Warnings: 3128

It appears as though additional warning were logged in this PR: scientific-python/docstub#79

Specifically at these lines:

https://github.com/scientific-python/docstub/blob/80a7ce455d8256ca772632b5a0c27b63ee649d0f/src/docstub/_stubs.py#L603

https://github.com/scientific-python/docstub/blob/80a7ce455d8256ca772632b5a0c27b63ee649d0f/src/docstub/_stubs.py#L944

These warnings seem to be for any variables or parameters used in the code (and were previously not reported, even it present).

The simple solution seems to be to run docstub in quiet mode and check for errors-only.

Steps to reproduce the issue

pip install docstub==0.6
docstub run osgeo --no-cache --config pyproject.toml --verbose

Versions and provenance

GDAL master

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions