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

Skip to content

Commit d2140cc

Browse files
committed
Issue #28783: Embedded and nuget packages incorrect reference missing bdist_wininst command.
2 parents 99250d5 + 2a94301 commit d2140cc

2 files changed

Lines changed: 48 additions & 3 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""distutils.command
2+
3+
Package containing implementation of all the standard Distutils
4+
commands."""
5+
6+
__all__ = ['build',
7+
'build_py',
8+
'build_ext',
9+
'build_clib',
10+
'build_scripts',
11+
'clean',
12+
'install',
13+
'install_lib',
14+
'install_headers',
15+
'install_scripts',
16+
'install_data',
17+
'sdist',
18+
'register',
19+
'bdist',
20+
'bdist_dumb',
21+
'bdist_rpm',
22+
# This command is not included in this package
23+
#'bdist_wininst',
24+
'check',
25+
'upload',
26+
# These two are reserved for future use:
27+
#'bdist_sdux',
28+
#'bdist_pkgtool',
29+
# Note:
30+
# bdist_packager is not included because it only provides
31+
# an abstract base class
32+
]

Tools/msi/make_zip.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import tempfile
99

10+
from itertools import chain
1011
from pathlib import Path
1112
from zipfile import ZipFile, ZIP_DEFLATED
1213
import subprocess
@@ -42,6 +43,7 @@
4243
}
4344

4445
EXCLUDE_FILE_FROM_LIBS = {
46+
'liblzma',
4547
'ssleay',
4648
'libeay',
4749
'python3stub',
@@ -77,6 +79,10 @@ def include_in_lib(p):
7779
if name in EXCLUDE_FILE_FROM_LIBRARY:
7880
return False
7981

82+
# Special code is included below to patch this file back in
83+
if [d.lower() for d in p.parts[-3:]] == ['distutils', 'command', '__init__.py']:
84+
return False
85+
8086
suffix = p.suffix.lower()
8187
return suffix not in {'.pyc', '.pyo', '.exe'}
8288

@@ -173,7 +179,7 @@ def rglob(root, pattern, condition):
173179
def main():
174180
parser = argparse.ArgumentParser()
175181
parser.add_argument('-s', '--source', metavar='dir', help='The directory containing the repository root', type=Path)
176-
parser.add_argument('-o', '--out', metavar='file', help='The name of the output self-extracting archive', type=Path, default=None)
182+
parser.add_argument('-o', '--out', metavar='file', help='The name of the output archive', type=Path, default=None)
177183
parser.add_argument('-t', '--temp', metavar='dir', help='A directory to temporarily extract files into', type=Path, default=None)
178184
parser.add_argument('-e', '--embed', help='Create an embedding layout', action='store_true', default=False)
179185
parser.add_argument('-a', '--arch', help='Specify the architecture to use (win32/amd64)', type=str, default="win32")
@@ -207,8 +213,15 @@ def main():
207213

208214
try:
209215
for t, s, p, c in layout:
210-
s = source / s.replace("$arch", arch)
211-
copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c))
216+
fs = source / s.replace("$arch", arch)
217+
files = rglob(fs, p, c)
218+
extra_files = []
219+
if s == 'Lib' and p == '**/*':
220+
extra_files.append((
221+
source / 'tools' / 'msi' / 'distutils.command.__init__.py',
222+
Path('distutils') / 'command' / '__init__.py'
223+
))
224+
copied = copy_to_layout(temp / t.rstrip('/'), chain(files, extra_files))
212225
print('Copied {} files'.format(copied))
213226

214227
if ns.embed:

0 commit comments

Comments
 (0)