Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4d68cea

Browse files
committed
replace winpython legacy code per msvc-runtime wheel
1 parent2d88b2d commit4d68cea

File tree

5 files changed

+46
-232
lines changed

5 files changed

+46
-232
lines changed

‎generate_a_winpython_distro.bat

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ set my_buildenv=C:\WinPython-64bit-3.6.8.0
3535

3636
rem handle alpha
3737
if"%my_release_level%"==""setmy_release_level=
38-
rem if %my_python_target%==38 set my_release_level=b1
3938

4039
rem ---------
4140
rem newAge 20191022
@@ -45,10 +44,10 @@ rem --------
4544

4645
if%my_python_target%==37 (
4746
setmy_python_target_release=377
48-
setmy_release=0
47+
setmy_release=1
4948
)
5049
if%my_python_target%==38 (
51-
setmy_python_target_release=382
50+
setmy_python_target_release=384
5251
setmy_release=0
5352
)
5453
if%my_python_target%==39 (
@@ -172,16 +171,36 @@ set path=%my_original_path%
172171
setmy_WINPYDIRBASE=%my_root_dir_for_builds%\bd%my_python_target%\bu%my_flavor%\Wpy%my_arch%-%my_python_target_release%%my_release%%my_release_level%
173172

174173
setWINPYDIRBASE=%my_WINPYDIRBASE%
174+
175+
rem D/2020-07-04: poka-yoke
176+
ifnotexist%my_WINPYDIRBASE%\scripts\env.bat (
177+
echo please check and correct my_python_target_release=%my_python_target_release%
178+
echo in generate_a_winpython_distro.bat
179+
echo as%my_WINPYDIRBASE%\scripts\env.bat doesnt exist
180+
pause
181+
exit
182+
)
183+
rem F/2020-07-04: poka-yoke
184+
175185
call%my_WINPYDIRBASE%\scripts\env.bat
176186
set
177187
echo beg of step 2/3
178188
rem ok no pause
179189

190+
rem D/2020-07-05: install msvc_runtime before packages that may want to compile
191+
echo pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq --upgrade
192+
echo pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq --upgrade>>%my_archive_log%
193+
pip install msvc_runtime --pre --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq --upgrade
194+
rem F/2020-07-05: install msvc_runtime before packages that may want to compile
195+
180196
echo pip install -r%my_requirements% --pre --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq --upgrade
181197
echo pip install -r%my_requirements% --pre --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq --upgrade>>%my_archive_log%
198+
199+
echo if pip doesn't work, check the path of%my_WINPYDIRBASE%
200+
182201
pip install -r%my_requirements% --pre --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq --upgrade>>%my_archive_log%
183202
echo mid of step 2/3
184-
rem pause
203+
185204

186205
rem finalize
187206
@echoon

‎make.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -782,18 +782,6 @@ def _extract_python(self):
782782
)
783783
self._print_done()
784784

785-
def_add_msvc_files(self):
786-
"""Adding Microsoft Visual C++ DLLs"""
787-
print("Adding Microsoft Visual C++ DLLs""")
788-
msvc_version=dh.get_msvc_version(
789-
self.distribution.version
790-
)
791-
forfnameindh.get_msvc_dlls(
792-
msvc_version,
793-
architecture=self.distribution.architecture,
794-
):
795-
shutil.copy(fname,self.python_dir)
796-
797785
def_copy_dev_tools(self):
798786
"""Copy dev tools"""
799787
self._print("Copying tools")
@@ -1945,7 +1933,7 @@ def make(
19451933

19461934
ifremove_existing:
19471935
ifnotself.simulation:
1948-
self._add_msvc_files()
1936+
#self._add_msvc_files() # replaced per msvc_runtime package
19491937
self._create_batch_scripts_initial()
19501938
self._create_batch_scripts()
19511939
# always create all launchers (as long as it is NSIS-based)

‎run_complement_newbuild.bat

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ call scripts\env.bat
1919
@echooff
2020

2121

22+
rem * ===========================
23+
rem 2020-05-15 patch jedi-0.17.0
24+
rem * ===========================
25+
rem see https://github.com/davidhalter/jedi/commit/f871f5e726f796127d4cfb981726b494f056ebe9
26+
rem as it fixes https://github.com/davidhalter/jedi/issues/1548 Use the `project` variable before setting the default value.
27+
rem if exist "%WINPYDIR%\Lib\site-packages\jedi-0.17.0.dist-info" copy/Y "C:\WinP\tempo_fixes\Jedi-0.17.0\api\__init__.py" "%WINPYDIR%\Lib\site-packages\Jedi-0.17.0\api\__init__.py"
28+
29+
2230
rem * ==========================
2331
rem * When Python has no mingwpy
2432
rem * ==========================
@@ -46,6 +54,9 @@ rem * ===========================
4654
echo finish install of jupyterlab
4755
rem * ===========================
4856

57+
rem 2020-04-10 security
58+
rem if exist "%WINPYDIR%\Lib\site-packages\jupyterlab" "%WINPYDIR%\..\n\npm" config set ignore-scripts true
59+
4960
rem other suggestion from https://github.com/nteract/nteract
5061
rem npm install -g --production windows-build-tools
5162

@@ -295,6 +306,8 @@ if exist "%WINPYDIR%\Lib\site-packages\jupyterlab" (
295306
jupyter labextension list
296307
)
297308

309+
rem jupyter labextension update --all (will rebuild if needed)
310+
298311
rem 2018-01-15 node-gyp experience
299312
rem npm config set python "C:\WinPython\bd27\buildZero\winpython-32bit-2.7.x.2\python-2.7.13"
300313
rem npm config delete python
@@ -339,6 +352,12 @@ echo patch spyder update reflex (2019-05-18 : spyder, not spyderlib !)
339352
rem * ====================
340353
%WINPYDIR%\python.exe -c"from winpython.utils import patch_sourcefile;patch_sourcefile(r'%WINPYDIR%\Lib\site-packages\spyder\config\main.py', ' '+chr(39)+'check_updates_on_startup'+chr(39)+': True', ' '+chr(39)+'check_updates_on_startup'+chr(39)+': False' )"
341354

355+
rem * ====================
356+
echo summary 20202-04-11
357+
rem * ====================
358+
pip check
359+
ifexist"%WINPYDIR%\Lib\site-packages\pipdeptree" pipdeptree
360+
342361

343362
@echoon
344363
goto the_end

‎winpython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__='2.4.20200425'
31+
__version__='3.0.20200705'
3232
__license__=__doc__
3333
__project_url__='http://winpython.github.io/'

‎winpython/disthelpers.py

Lines changed: 2 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -122,219 +122,6 @@ def try_to_remove(fname):
122122
atexit.register(try_to_remove,osp.abspath(fname))
123123

124124

125-
defget_msvc_version(python_version):
126-
"""Return Microsoft Visual C++ version used to build this Python version"""
127-
ifpython_versionisNone:
128-
python_version='2.7'
129-
warnings.warn("assuming Python 2.7 target")
130-
ifpython_versionin (
131-
'2.6',
132-
'2.7',
133-
'3.0',
134-
'3.1',
135-
'3.2',
136-
):
137-
# Python 2.6-2.7, 3.0-3.2 were built with Visual Studio 9.0.21022.8
138-
# (i.e. Visual C++ 2008, not Visual C++ 2008 SP1!)
139-
return"9.0.21022.8"
140-
elifpython_versionin ('3.3','3.4'):
141-
# Python 3.3+ were built with Visual Studio 10.0.30319.1
142-
# (i.e. Visual C++ 2010)
143-
return'10.0'
144-
elifpython_versionin ('3.5','3.6'):
145-
return'15.0'
146-
elifpython_versionin ('3.7','3.8'):
147-
return'15.0'
148-
elifStrictVersion(python_version)>=StrictVersion('3.9'):
149-
return'15.0'
150-
else:
151-
raiseRuntimeError(
152-
"Unsupported Python version %s"%python_version
153-
)
154-
155-
156-
defget_msvc_dlls(msvc_version,architecture=None):
157-
"""Get the list of Microsoft Visual C++ DLLs associated to
158-
architecture and Python version, create the manifest file.
159-
160-
architecture: integer (32 or 64) -- if None, take the Python build arch
161-
python_version: X.Y"""
162-
current_architecture= (
163-
64ifsys.maxsize>2**32else32
164-
)
165-
ifarchitectureisNone:
166-
architecture=current_architecture
167-
filelist= []
168-
169-
# simple vs2015 situation: nothing (system dll)
170-
ifmsvc_version=='14.0':
171-
returnfilelist
172-
msvc_major=msvc_version.split('.')[0]
173-
msvc_minor=msvc_version.split('.')[1]
174-
175-
ifmsvc_major=='9':
176-
key="1fc8b3b9a1e18e3b"
177-
atype=""ifarchitecture==64else"win32"
178-
arch="amd64"ifarchitecture==64else"x86"
179-
180-
groups= {
181-
'CRT': (
182-
'msvcr90.dll',
183-
'msvcp90.dll',
184-
'msvcm90.dll',
185-
),
186-
# 'OPENMP': ('vcomp90.dll',)
187-
}
188-
189-
forgroup,dll_listingroups.items():
190-
dlls=''
191-
fordllindll_list:
192-
dlls+=' <file name="%s" />%s'% (
193-
dll,
194-
os.linesep,
195-
)
196-
manifest="""<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
197-
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
198-
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
199-
<noInheritable/>
200-
<assemblyIdentity
201-
type="%(atype)s"
202-
name="Microsoft.VC90.%(group)s"
203-
version="%(version)s"
204-
processorArchitecture="%(arch)s"
205-
publicKeyToken="%(key)s"
206-
/>
207-
%(dlls)s</assembly>
208-
"""%dict(
209-
version=msvc_version,
210-
key=key,
211-
atype=atype,
212-
arch=arch,
213-
group=group,
214-
dlls=dlls,
215-
)
216-
217-
vc90man="Microsoft.VC90.%s.manifest"%group
218-
open(vc90man,'w').write(manifest)
219-
_remove_later(vc90man)
220-
filelist+= [vc90man]
221-
222-
winsxs=osp.join(
223-
os.environ['windir'],'WinSxS'
224-
)
225-
vcstr='%s_Microsoft.VC90.%s_%s_%s'% (
226-
arch,
227-
group,
228-
key,
229-
msvc_version,
230-
)
231-
forfnameinos.listdir(winsxs):
232-
path=osp.join(winsxs,fname)
233-
ifosp.isdir(
234-
path
235-
)andfname.lower().startswith(
236-
vcstr.lower()
237-
):
238-
fordllnameinos.listdir(path):
239-
filelist.append(
240-
osp.join(path,dllname)
241-
)
242-
break
243-
else:
244-
raiseRuntimeError(
245-
"Microsoft Visual C++ %s DLLs version %s "
246-
"were not found"% (group,msvc_version)
247-
)
248-
elif (
249-
msvc_major=='10'ormsvc_major=='15'
250-
):# 15 for vs 2015
251-
namelist= [
252-
name% (msvc_major+msvc_minor)
253-
fornamein (
254-
'msvcp%s.dll',
255-
'msvcr%s.dll',
256-
'vcomp%s.dll',
257-
)
258-
]
259-
ifmsvc_major=='15'andarchitecture==64:
260-
namelist= [
261-
name% ('14'+msvc_minor)
262-
fornamein (
263-
'vcruntime%s.dll',
264-
'vcruntime%s_1.dll',
265-
'msvcp%s.dll',
266-
'vccorlib%s.dll',
267-
'concrt%s.dll',
268-
'vcomp%s.dll',
269-
)
270-
]
271-
ifmsvc_major=='15'andarchitecture!=64:
272-
namelist= [
273-
name% ('14'+msvc_minor)
274-
fornamein (
275-
'vcruntime%s.dll',
276-
'msvcp%s.dll',
277-
'vccorlib%s.dll',
278-
'concrt%s.dll',
279-
'vcomp%s.dll',
280-
)
281-
]
282-
windir=os.environ['windir']
283-
is_64bit_windows=osp.isdir(
284-
osp.join(windir,"SysWOW64")
285-
)
286-
287-
# Reminder: WoW64 (*W*indows 32-bit *o*n *W*indows *64*-bit) is a
288-
# subsystem of the Windows operating system capable of running 32-bit
289-
# applications and is included on all 64-bit versions of Windows
290-
# (source: http://en.wikipedia.org/wiki/WoW64)
291-
#
292-
# In other words, "SysWOW64" contains 64-bit DLL and applications,
293-
# whereas "System32" contains 64-bit DLL and applications on a 64-bit
294-
# system.
295-
sysdir="System32"
296-
ifnotis_64bit_windowsandarchitecture==64:
297-
raiseRuntimeError(
298-
"Can't find 64-bit MSVC DLLs on a 32-bit OS"
299-
)
300-
ifis_64bit_windowsandarchitecture==32:
301-
sysdir="SysWOW64"
302-
fordllnameinnamelist:
303-
fname=osp.join(windir,sysdir,dllname)
304-
print('searching',fname)
305-
ifosp.exists(fname):
306-
filelist.append(fname)
307-
else:
308-
raiseRuntimeError(
309-
"Microsoft Visual C++ DLLs version %s "
310-
"were not found"%msvc_version
311-
)
312-
else:
313-
raiseRuntimeError(
314-
"Unsupported MSVC version %s"%msvc_version
315-
)
316-
returnfilelist
317-
318-
319-
defcreate_msvc_data_files(
320-
architecture=None,python_version=None,verbose=False
321-
):
322-
"""Including Microsoft Visual C++ DLLs"""
323-
msvc_version=get_msvc_version(python_version)
324-
filelist=get_msvc_dlls(
325-
msvc_version,architecture=architecture
326-
)
327-
print(create_msvc_data_files.__doc__)
328-
ifverbose:
329-
fornameinfilelist:
330-
print(" ",name)
331-
msvc_major=msvc_version.split('.')[0]
332-
ifmsvc_major=='9':
333-
return [("Microsoft.VC90.CRT",filelist)]
334-
else:
335-
return [("",filelist)]
336-
337-
338125
defto_include_files(data_files):
339126
"""Convert data_files list to include_files list
340127
@@ -509,7 +296,8 @@ def setup(
509296
self.msvc=msvc
510297
ifself.msvc:
511298
try:
512-
self.data_files+=create_msvc_data_files()
299+
pass# manage via msvc_runtime wheel (or give up anyway)
300+
# self.data_files += create_msvc_data_files()
513301
exceptIOError:
514302
print(
515303
"Setting the msvc option to False "

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp