bashonly 3a12be701c
[cleanup] Misc (#16630)
* Fix PyPy dependency issue with cffi
* Export requirements files from dependency groups
* Simplify bundle targets & rework build flow
* Code cleanup & type annotation fixes
* Update FFmpeg-Builds status in README

Authored by: bashonly
2026-05-05 22:00:57 +00:00

37 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -exuo pipefail
if [[ -z "${PYTHON_VERSION:-}" ]]; then
PYTHON_VERSION="3.13"
echo "Defaulting to using Python ${PYTHON_VERSION}"
fi
# Set up virtual environment
rm -rf .venv
py"${PYTHON_VERSION}" -m venv .venv --without-pip
PYTHONPATH="$(py"${PYTHON_VERSION}" -c 'import sysconfig; print(sysconfig.get_path("purelib"))')"
export PYTHONPATH
# shellcheck disable=SC1091
source .venv/bin/activate
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pyinstaller.txt"
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-${REQUIREMENTS}.txt"
python -m devscripts.make_lazy_extractors
python devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}"
if [[ -z "${SKIP_ONEDIR_BUILD:-}" ]]; then
mkdir -p /build
python -m bundle.pyinstaller --onedir --distpath=/build
pushd "/build/${EXE_NAME}"
chmod +x "${EXE_NAME}"
python -m zipfile -c "/yt-dlp/dist/${EXE_NAME}.zip" ./
popd
fi
if [[ -z "${SKIP_ONEFILE_BUILD:-}" ]]; then
python -m bundle.pyinstaller
chmod +x "./dist/${EXE_NAME}"
fi
deactivate