Skip to content

[pyinstaller] Add missing compat.is_netbsd - #16217

Open
ekanshul wants to merge 1 commit into
python:mainfrom
ekanshul:pyinstaller-is-netbsd
Open

[pyinstaller] Add missing compat.is_netbsd#16217
ekanshul wants to merge 1 commit into
python:mainfrom
ekanshul:pyinstaller-is-netbsd

Conversation

@ekanshul

Copy link
Copy Markdown

Fixes the stubtest failure reported in #16213.

PyInstaller.compat defines is_netbsd next to the other platform flags, but the stub does not have it, so the daily run fails with:

error: PyInstaller.compat.is_netbsd is not present in stub
Stub: in file stubs/pyinstaller/PyInstaller/compat.pyi
MISSING
Runtime:
False

Upstream defines it between is_openbsd and is_hpux, and also folds it into is_unix (compat.py#L90-L97):

is_freebsd = sys.platform.startswith('freebsd')
is_openbsd = sys.platform.startswith('openbsd')
is_netbsd = sys.platform.startswith('netbsd')
is_hpux = sys.platform.startswith('hp-ux')
...
is_unix = is_linux or is_solar or is_aix or is_freebsd or is_hpux or is_openbsd or is_netbsd

I put the new line in the same position so the stub keeps matching that order.

Verified locally against pyinstaller==6.22.1 with the pinned mypy==2.3.0. Before the change stubtest reports the error above; after it:

Success: no issues found in 165 modules

One note in case it comes up in CI: ruff format --diff wants to remove two blank lines further down the same file, around the getenv overloads. That is already the case on main without this change, so I left it alone rather than mixing an unrelated reformat into this fix.

PyInstaller.compat defines is_netbsd alongside the other platform flags,
but the stub is missing it, so the daily stubtest run fails with:

    error: PyInstaller.compat.is_netbsd is not present in stub

Placed between is_openbsd and is_hpux to match the order upstream.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since this new flag was introduced in PyInstaller 6.22.1, we need to bump the version to ~= 6.22.1.

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.

2 participants