mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-19 05:42:34 +00:00
[build] Rename requirements files to clean up dependency graph (#16740)
Authored by: bashonly
This commit is contained in:
parent
410e0af537
commit
32f1671a90
14
.github/workflows/build.yml
vendored
14
.github/workflows/build.yml
vendored
@ -325,7 +325,7 @@ jobs:
|
||||
brew uninstall --ignore-dependencies python3
|
||||
python3 -m venv ~/yt-dlp-build-venv
|
||||
source ~/yt-dlp-build-venv/bin/activate
|
||||
python3 -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python3 -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
rm -rf build
|
||||
# Only directly install wheels for "macosx_10_15_universal2" and "any" platforms
|
||||
mkdir -p build/wheels
|
||||
@ -335,7 +335,7 @@ jobs:
|
||||
--platform=any \
|
||||
-d build/wheels \
|
||||
--require-hashes \
|
||||
-r "bundle/requirements/requirements-macos.txt"
|
||||
-r "bundle/requirements/macos.txt"
|
||||
python3 -m pip install --force-reinstall --no-deps -U build/wheels/*.whl
|
||||
rm -rf build/wheels/*
|
||||
# We need to fuse our own universal2 wheels for curl_cffi and cffi
|
||||
@ -347,7 +347,7 @@ jobs:
|
||||
--platform "${platform}" \
|
||||
-d build/wheels \
|
||||
--require-hashes \
|
||||
-r "bundle/requirements/requirements-macos-curl_cffi.txt"
|
||||
-r "bundle/requirements/macos-curl_cffi.txt"
|
||||
done
|
||||
python3 -m delocate.cmd.delocate_merge build/wheels/curl_cffi-*.whl -w build/universal2
|
||||
python3 -m delocate.cmd.delocate_merge build/wheels/cffi-*.whl -w build/universal2
|
||||
@ -456,12 +456,12 @@ jobs:
|
||||
$PSNativeCommandUseErrorActionPreference = $true
|
||||
python -m venv /yt-dlp-build-venv
|
||||
/yt-dlp-build-venv/Scripts/Activate.ps1
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-win-${Env:ARCH}-pyinstaller.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/win-${Env:ARCH}-pyinstaller.txt"
|
||||
if (${Env:ARCH} -eq "x86") {
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-default.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/default.txt"
|
||||
} else {
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-curl-cffi.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/curl-cffi.txt"
|
||||
}
|
||||
|
||||
- name: Prepare
|
||||
|
||||
6
.github/workflows/challenge-tests.yml
vendored
6
.github/workflows/challenge-tests.yml
vendored
@ -79,9 +79,9 @@ jobs:
|
||||
- name: Install test requirements
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-default.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/default.txt"
|
||||
- name: Run tests
|
||||
timeout-minutes: 15
|
||||
shell: bash
|
||||
|
||||
12
.github/workflows/core.yml
vendored
12
.github/workflows/core.yml
vendored
@ -75,16 +75,16 @@ jobs:
|
||||
- name: Install test requirements (cpython)
|
||||
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
|
||||
run: |
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-curl-cffi.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/curl-cffi.txt"
|
||||
|
||||
- name: Install test requirements (PyPy)
|
||||
if: ${{ startsWith(matrix.python-version, 'pypy') }}
|
||||
run: |
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-default.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/default.txt"
|
||||
|
||||
- name: Run tests
|
||||
timeout-minutes: 15
|
||||
|
||||
8
.github/workflows/quick-test.yml
vendored
8
.github/workflows/quick-test.yml
vendored
@ -31,8 +31,8 @@ jobs:
|
||||
- name: Install test requirements
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
||||
- name: Run tests
|
||||
timeout-minutes: 15
|
||||
shell: bash
|
||||
@ -56,8 +56,8 @@ jobs:
|
||||
python-version: '3.14'
|
||||
- name: Install dev dependencies
|
||||
run: |
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-static-analysis.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/static-analysis.txt"
|
||||
- name: Make lazy extractors
|
||||
run: python ./devscripts/make_lazy_extractors.py
|
||||
- name: Run ruff
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@ -185,8 +185,8 @@ jobs:
|
||||
- name: Install Requirements
|
||||
run: |
|
||||
sudo apt -y install pandoc man
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-build.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/build.txt"
|
||||
|
||||
- name: Prepare
|
||||
env:
|
||||
|
||||
6
.github/workflows/test-workflows.yml
vendored
6
.github/workflows/test-workflows.yml
vendored
@ -36,9 +36,9 @@ jobs:
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-pyflakes.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/requirements-test.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pip.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/pyflakes.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/test.txt"
|
||||
|
||||
- name: Install requirements
|
||||
env:
|
||||
|
||||
@ -14,8 +14,8 @@ 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 pip install -U --require-hashes -r "bundle/requirements/pyinstaller.txt"
|
||||
python -m pip install -U --require-hashes -r "bundle/requirements/${REQUIREMENTS}.txt"
|
||||
python -m devscripts.make_lazy_extractors
|
||||
python devscripts/update-version.py -c "${CHANNEL}" -r "${ORIGIN}" "${VERSION}"
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ PYPROJECT_PATH = BASE_PATH / 'pyproject.toml'
|
||||
MAKEFILE_PATH = BASE_PATH / 'Makefile'
|
||||
LOCKFILE_PATH = BASE_PATH / 'uv.lock'
|
||||
REQUIREMENTS_PATH = BASE_PATH / 'bundle/requirements'
|
||||
REQS_OUTPUT_TMPL = 'requirements-{}.txt'
|
||||
REQS_OUTPUT_TMPL = '{}.txt'
|
||||
|
||||
EXTRAS_TABLE = 'project.optional-dependencies'
|
||||
GROUPS_TABLE = 'dependency-groups'
|
||||
@ -544,11 +544,11 @@ def package_diff_dict(
|
||||
return ret_dict
|
||||
|
||||
|
||||
def get_lock_packages(lock: dict[str, typing.Any]) -> dict[str, str]:
|
||||
def get_lock_packages(lock: dict[str, typing.Any], ignore_names: list[str] | None = None) -> dict[str, str]:
|
||||
return {
|
||||
package['name']: package['version']
|
||||
for package in lock['package']
|
||||
if package.get('version')
|
||||
if package.get('version') and package['name'] not in (ignore_names or [])
|
||||
}
|
||||
|
||||
|
||||
@ -578,6 +578,7 @@ def update_requirements(
|
||||
|
||||
pyproject_text = PYPROJECT_PATH.read_text()
|
||||
pyproject_toml = parse_toml(pyproject_text)
|
||||
package_name = pyproject_toml['project']['name']
|
||||
extras = get_extras(pyproject_toml)
|
||||
|
||||
# Remove pinned extras so they don't muck up the lockfile during generation/upgrade
|
||||
@ -603,8 +604,8 @@ def update_requirements(
|
||||
run_process('uv', 'lock', upgrade_arg, env=env)
|
||||
|
||||
# Record diff in uv.lock packages
|
||||
old_packages = get_lock_packages(old_lock) if old_lock else {}
|
||||
new_packages = get_lock_packages(parse_toml(LOCKFILE_PATH.read_text()))
|
||||
old_packages = get_lock_packages(old_lock, [package_name]) if old_lock else {}
|
||||
new_packages = get_lock_packages(parse_toml(LOCKFILE_PATH.read_text()), [package_name])
|
||||
all_updates = package_diff_dict(old_packages, new_packages)
|
||||
|
||||
# Update Windows PyInstaller requirements; need to compare before & after .txt's for reporting
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user