Skip to content

Commit

Permalink
Merge pull request #86 from ynput/enhancement/safe-builtin-dependencies
Browse files Browse the repository at this point in the history
Build process: Builtin python dependencies are added safely
  • Loading branch information
iLLiCiTiT authored Jan 15, 2024
2 parents 8edd09d + 4ba93b3 commit 6b55b64
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"email.mime.text",
"sqlite3",
"timeit",
]

# These are added just to be sure created executable has available even
# unused modules. Some of them are not available on all platforms.
python_builtins = [
# Just to be sure
"abc",
"argparse",
Expand Down Expand Up @@ -198,6 +203,13 @@
"zipimport",
"zoneinfo",
]
for module_name in python_builtins:
try:
__import__(module_name)
except ImportError:
pass
else:
install_requires.append(module_name)

includes = []
excludes = [
Expand Down

0 comments on commit 6b55b64

Please sign in to comment.