From f4b95acafcd69a50040730dfdf732e797278fdcc Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Thu, 16 Nov 2023 12:39:00 -0600 Subject: [PATCH] Remove Python 3.7 support (#8361) Closes #7803 Authored by: bashonly --- .github/workflows/build.yml | 15 ++++- .github/workflows/core.yml | 6 +- .github/workflows/download.yml | 8 +-- .github/workflows/quick-test.yml | 2 +- CONTRIBUTING.md | 2 +- README.md | 6 +- setup.cfg | 4 +- setup.py | 4 +- test/test_update.py | 108 ++++++++++++++++++------------- yt_dlp/__init__.py | 11 ++-- yt_dlp/compat/functools.py | 14 ---- yt_dlp/update.py | 14 +--- 12 files changed, 100 insertions(+), 94 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a52973ea2..d944659b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -377,8 +377,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 - with: # 3.7 is used for Vista support. See https://github.com/yt-dlp/yt-dlp/issues/390 - python-version: "3.7" + with: + python-version: "3.8" architecture: "x86" - name: Install Requirements run: | @@ -436,7 +436,16 @@ jobs: run: | cat >> _update_spec << EOF # This file is used for regulating self-update - lock 2022.08.18.36 .+ Python 3.6 + lock 2022.08.18.36 .+ Python 3\.6 + lock 2023.11.16 (?!win_x86_exe).+ Python 3\.7 + lock 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server) + lockV2 yt-dlp/yt-dlp 2022.08.18.36 .+ Python 3\.6 + lockV2 yt-dlp/yt-dlp 2023.11.16 (?!win_x86_exe).+ Python 3\.7 + lockV2 yt-dlp/yt-dlp 2023.11.16 win_x86_exe .+ Windows-(?:Vista|2008Server) + lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 (?!win_x86_exe).+ Python 3\.7 + lockV2 yt-dlp/yt-dlp-nightly-builds 2023.11.15.232826 win_x86_exe .+ Windows-(?:Vista|2008Server) + lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 (?!win_x86_exe).+ Python 3\.7 + lockV2 yt-dlp/yt-dlp-master-builds 2023.11.15.232812 win_x86_exe .+ Windows-(?:Vista|2008Server) EOF - name: Sign checksum files diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index e5a976de5..3c10fc17e 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -13,12 +13,12 @@ jobs: matrix: os: [ubuntu-latest] # CPython 3.11 is in quick-test - python-version: ['3.8', '3.9', '3.10', '3.12', pypy-3.7, pypy-3.8, pypy-3.10] + python-version: ['3.8', '3.9', '3.10', '3.12', pypy-3.8, pypy-3.10] run-tests-ext: [sh] include: # atleast one of each CPython/PyPy tests must be in windows - os: windows-latest - python-version: '3.7' + python-version: '3.8' run-tests-ext: bat - os: windows-latest python-version: '3.12' @@ -32,7 +32,7 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install test requirements run: pip install pytest -r requirements.txt - name: Run tests continue-on-error: False diff --git a/.github/workflows/download.yml b/.github/workflows/download.yml index 7302a93bc..73b2f9ca3 100644 --- a/.github/workflows/download.yml +++ b/.github/workflows/download.yml @@ -15,7 +15,7 @@ jobs: with: python-version: 3.9 - name: Install test requirements - run: pip install pytest + run: pip install pytest -r requirements.txt - name: Run tests continue-on-error: true run: ./devscripts/run_tests.sh download @@ -28,7 +28,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - python-version: ['3.7', '3.10', '3.12', pypy-3.7, pypy-3.8, pypy-3.10] + python-version: ['3.10', '3.11', '3.12', pypy-3.8, pypy-3.10] run-tests-ext: [sh] include: # atleast one of each CPython/PyPy tests must be in windows @@ -44,8 +44,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install pytest - run: pip install pytest + - name: Install test requirements + run: pip install pytest -r requirements.txt - name: Run tests continue-on-error: true run: ./devscripts/run_tests.${{ matrix.run-tests-ext }} download diff --git a/.github/workflows/quick-test.yml b/.github/workflows/quick-test.yml index e4fd89551..edbdaffd7 100644 --- a/.github/workflows/quick-test.yml +++ b/.github/workflows/quick-test.yml @@ -15,7 +15,7 @@ jobs: with: python-version: '3.11' - name: Install test requirements - run: pip install pytest pycryptodomex + run: pip install pytest -r requirements.txt - name: Run tests run: | python3 -m yt_dlp -v || true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 90e7faf7c..c472f3251 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -222,7 +222,7 @@ ## Adding support for a new site $ flake8 yt_dlp/extractor/yourextractor.py -1. Make sure your code works under all [Python](https://www.python.org/) versions supported by yt-dlp, namely CPython and PyPy for Python 3.7 and above. Backward compatibility is not required for even older versions of Python. +1. Make sure your code works under all [Python](https://www.python.org/) versions supported by yt-dlp, namely CPython and PyPy for Python 3.8 and above. Backward compatibility is not required for even older versions of Python. 1. When the tests pass, [add](https://git-scm.com/docs/git-add) the new files, [commit](https://git-scm.com/docs/git-commit) them and [push](https://git-scm.com/docs/git-push) the result, like this: $ git add yt_dlp/extractor/_extractors.py diff --git a/README.md b/README.md index 33690f470..6fe7fab6a 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ ### Differences in default behavior Some of yt-dlp's default options are different from that of youtube-dl and youtube-dlc: -* yt-dlp supports only [Python 3.7+](## "Windows 7"), and *may* remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743) +* yt-dlp supports only [Python 3.8+](## "Windows 7"), and *may* remove support for more versions as they [become EOL](https://devguide.python.org/versions/#python-release-cycle); while [youtube-dl still supports Python 2.6+ and 3.2+](https://github.com/ytdl-org/youtube-dl/issues/30568#issue-1118238743) * The options `--auto-number` (`-A`), `--title` (`-t`) and `--literal` (`-l`), no longer work. See [removed options](#Removed) for details * `avconv` is not supported as an alternative to `ffmpeg` * yt-dlp stores config files in slightly different locations to youtube-dl. See [CONFIGURATION](#configuration) for a list of correct locations @@ -266,7 +266,7 @@ #### Misc **Note**: The manpages, shell completion (autocomplete) files etc. are available inside the [source tarball](https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.tar.gz) ## DEPENDENCIES -Python versions 3.7+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly. +Python versions 3.8+ (CPython and PyPy) are supported. Other versions and implementations may or may not work correctly.