Skip to content

Commit

Permalink
[build] Exclude requests from py2exe (yt-dlp#9982)
Browse files Browse the repository at this point in the history
Authored by: bashonly
  • Loading branch information
bashonly committed May 31, 2024
1 parent 2e5a47d commit e264079
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ You can also run `make yt-dlp` instead to compile only the binary without updati

### Standalone Py2Exe Builds (Windows)

While we provide the option to build with [py2exe](https://www.py2exe.org), it is recommended to build [using PyInstaller](#standalone-pyinstaller-builds) instead since the py2exe builds **cannot contain `pycryptodomex`/`certifi` and need VC++14** on the target computer to run.
While we provide the option to build with [py2exe](https://www.py2exe.org), it is recommended to build [using PyInstaller](#standalone-pyinstaller-builds) instead since the py2exe builds **cannot contain `pycryptodomex`/`certifi`/`requests` and need VC++14** on the target computer to run.

If you wish to build it anyway, install Python (if it is not already installed) and you can run the following commands:

Expand Down
6 changes: 3 additions & 3 deletions bundle/py2exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def main():
# py2exe cannot import Crypto
'Crypto',
'Cryptodome',
# py2exe appears to confuse this with our socks library.
# We don't use pysocks and urllib3.contrib.socks would fail to import if tried.
'urllib3.contrib.socks'
# requests >=2.32.0 breaks py2exe builds due to certifi dependency
'requests',
'urllib3'
],
'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
# Modules that are only imported dynamically must be added here
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ pyinstaller = [
]
py2exe = [
"py2exe>=0.12",
"requests==2.31.*",
]

[project.urls]
Expand Down

0 comments on commit e264079

Please sign in to comment.