Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packaging/pyinstaller/playlistforge.linux.spec
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
exclude_binaries=True,
name="PlaylistForge",
debug=False,
bootloader_ignore_signals=False,
Expand Down
35 changes: 35 additions & 0 deletions tests/test_packaging_specs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""Tests for packaging spec regressions."""

from __future__ import annotations

import ast
from pathlib import Path


def test_linux_pyinstaller_spec_uses_exclude_binaries_for_onedir_build() -> None:
spec_path = (
Path(__file__).resolve().parents[1]
/ "packaging"
/ "pyinstaller"
/ "playlistforge.linux.spec"
)

module = ast.parse(spec_path.read_text(encoding="utf-8"))

exe_call = None
for node in module.body:
if isinstance(node, ast.Assign) and any(
isinstance(target, ast.Name) and target.id == "exe" for target in node.targets
):
exe_call = node.value
break

assert isinstance(exe_call, ast.Call)
assert isinstance(exe_call.func, ast.Name)
assert exe_call.func.id == "EXE"

exclude_binaries = {
keyword.arg: keyword.value for keyword in exe_call.keywords if keyword.arg is not None
}["exclude_binaries"]
assert isinstance(exclude_binaries, ast.Constant)
assert exclude_binaries.value is True
Loading