Skip to content

Stabilize ordering of import vs. import ... as#293

Merged
ax3l merged 1 commit intopybind:mainfrom
cjwatson:stabilize-import-as-name-ordering
Apr 3, 2026
Merged

Stabilize ordering of import vs. import ... as#293
ax3l merged 1 commit intopybind:mainfrom
cjwatson:stabilize-import-as-name-ordering

Conversation

@cjwatson
Copy link
Copy Markdown
Contributor

Due to an alias, pytango's stubs include the following lines:

from tango._tango import CmdArgType
from tango._tango import CmdArgType as ArgType

However, pybind11-stubgen doesn't sort these reliably. I noticed this because of a failure from Debian's reproducible builds system (https://reproduce.debian.net/amd64/api/v1/builds/153381/artifacts/383911/diffoscope) showing that those two lines had been generated in the opposite order. The intent seems to be to sort the output predictably, so let's constrain this a little more tightly.

@ax3l ax3l added the bug Something isn't working label Apr 3, 2026
Due to an alias, pytango's stubs include the following lines:

```
from tango._tango import CmdArgType
from tango._tango import CmdArgType as ArgType
```

However, pybind11-stubgen doesn't sort these reliably.  I noticed this
because of a failure from Debian's reproducible builds system
(https://reproduce.debian.net/amd64/api/v1/builds/153381/artifacts/383911/diffoscope)
showing that those two lines had been generated in the opposite order.
The intent seems to be to sort the output predictably, so let's
constrain this a little more tightly.
@ax3l ax3l force-pushed the stabilize-import-as-name-ordering branch from 34c7f83 to 0da4818 Compare April 3, 2026 04:50
Copy link
Copy Markdown
Contributor

@ax3l ax3l left a comment

Choose a reason for hiding this comment

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

Thank you for the fix!

@ax3l ax3l self-assigned this Apr 3, 2026
@ax3l ax3l merged commit 6cb14aa into pybind:main Apr 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants