Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5288477

Browse files
committed
Includes ensurepip and venv packages in nuget package.
1 parent 6d46ae7 commit 5288477

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Tools/msi/make_zip.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@
2828

2929
EXCLUDE_FROM_LIBRARY = {
3030
'__pycache__',
31-
'ensurepip',
3231
'idlelib',
3332
'pydoc_data',
3433
'site-packages',
3534
'tkinter',
3635
'turtledemo',
36+
}
37+
38+
EXCLUDE_FROM_EMBEDDABLE_LIBRARY = {
39+
'ensurepip',
3740
'venv',
3841
}
3942

@@ -78,6 +81,12 @@ def include_in_lib(p):
7881
suffix = p.suffix.lower()
7982
return suffix not in {'.pyc', '.pyo', '.exe'}
8083

84+
def include_in_embeddable_lib(p):
85+
if p.is_dir() and p.name.lower() in EXCLUDE_FROM_EMBEDDABLE_LIBRARY:
86+
return False
87+
88+
return include_in_lib(p)
89+
8190
def include_in_libs(p):
8291
if not is_not_debug(p):
8392
return False
@@ -108,7 +117,7 @@ def include_in_tools(p):
108117
('/', '$build', 'python*.exe', is_not_debug),
109118
('/', '$build', '*.pyd', is_not_debug),
110119
('/', '$build', '*.dll', is_not_debug),
111-
('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib),
120+
('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_embeddable_lib),
112121
]
113122

114123
if os.getenv('DOC_FILENAME'):

0 commit comments

Comments
 (0)