From cc749a8a3b8b6e5c05318868c72a403f376a1b38 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Tue, 27 May 2025 18:11:58 -0500 Subject: [PATCH] [build] Exclude `pkg_resources` from being collected (#13320) Closes #13311 Authored by: bashonly --- bundle/docker/static/entrypoint.sh | 1 + bundle/pyinstaller.py | 3 +++ pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bundle/docker/static/entrypoint.sh b/bundle/docker/static/entrypoint.sh index 220275974..8049e6820 100755 --- a/bundle/docker/static/entrypoint.sh +++ b/bundle/docker/static/entrypoint.sh @@ -2,6 +2,7 @@ set -e source ~/.local/share/pipx/venvs/pyinstaller/bin/activate +python -m devscripts.install_deps -o --include build python -m devscripts.install_deps --include secretstorage --include curl-cffi python -m devscripts.make_lazy_extractors python devscripts/update-version.py -c "${channel}" -r "${origin}" "${version}" diff --git a/bundle/pyinstaller.py b/bundle/pyinstaller.py index 4184c4bc9..c2f651121 100755 --- a/bundle/pyinstaller.py +++ b/bundle/pyinstaller.py @@ -36,6 +36,9 @@ def main(): f'--name={name}', '--icon=devscripts/logo.ico', '--upx-exclude=vcruntime140.dll', + # Ref: https://github.com/yt-dlp/yt-dlp/issues/13311 + # https://github.com/pyinstaller/pyinstaller/issues/9149 + '--exclude-module=pkg_resources', '--noconfirm', '--additional-hooks-dir=yt_dlp/__pyinstaller', *opts, diff --git a/pyproject.toml b/pyproject.toml index 7accaeeb9..3775251e1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ build = [ "build", "hatchling", "pip", - "setuptools>=71.0.2", # 71.0.0 broke pyinstaller + "setuptools>=71.0.2,<81", # See https://github.com/pyinstaller/pyinstaller/issues/9149 "wheel", ] dev = [