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

Skip to content

Commit 87167ea

Browse files
authored
Merge pull request #611 from stonebig/master
reduce install path to accomodate better with nodejs
2 parents b7b7926 + e3d74f0 commit 87167ea

File tree

4 files changed

+39
-32
lines changed

4 files changed

+39
-32
lines changed

make.py

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ def build_nsis(srcname, dstname, data):
9393

9494
class WinPythonDistribution(object):
9595
"""WinPython distribution"""
96-
MINGW32_PATH = r'\tools\mingw32\bin'
97-
R_PATH = r'\tools\R\bin'
98-
JULIA_PATH = r'\tools\Julia\bin'
99-
NODEJS_PATH = r'\tools\n'
96+
MINGW32_PATH = r'\t\mingw32\bin'
97+
R_PATH = r'\t\R\bin'
98+
JULIA_PATH = r'\t\Julia\bin'
99+
NODEJS_PATH = r'\t\n'
100100

101101
def __init__(self, build_number, release_level, target, wheeldir,
102102
toolsdirs=None, verbose=False, simulation=False,
@@ -134,15 +134,15 @@ def package_index_wiki(self):
134134
def get_tool_path(relpath, checkfunc):
135135
if self.simulation:
136136
for dirname in self.toolsdirs:
137-
path = dirname + relpath.replace(r'\tools', '')
137+
path = dirname + relpath.replace(r'\t', '')
138138
if checkfunc(path):
139139
return path
140140
else:
141141
path = self.winpydir + relpath
142142
if checkfunc(path):
143143
return path
144144

145-
if get_tool_path (r'\tools\SciTE.exe', osp.isfile):
145+
if get_tool_path (r'\t\SciTE.exe', osp.isfile):
146146
installed_tools += [('SciTE', '3.3.7')]
147147

148148
rpath = get_tool_path(self.R_PATH, osp.isdir)
@@ -162,12 +162,12 @@ def get_tool_path(relpath, checkfunc):
162162
npmver = utils.get_npmjs_version(nodepath)
163163
installed_tools += [('npmjs', npmver)]
164164

165-
pandocexe = get_tool_path (r'\tools\pandoc.exe', osp.isfile)
165+
pandocexe = get_tool_path (r'\t\pandoc.exe', osp.isfile)
166166
if pandocexe is not None:
167167
pandocver = utils.get_pandoc_version(osp.dirname(pandocexe))
168168
installed_tools += [('Pandoc', pandocver)]
169169

170-
ffmpegexe = get_tool_path (r'\tools\ffmpeg.exe', osp.isfile)
170+
ffmpegexe = get_tool_path (r'\t\ffmpeg.exe', osp.isfile)
171171
if ffmpegexe is not None:
172172
ffmpegver = utils.get_ffmpeg_version(osp.dirname(ffmpegexe))
173173
installed_tools += [('ffmpeg', ffmpegver)]
@@ -241,7 +241,7 @@ def prepath(self):
241241
"""Return PATH contents to be prepend to the environment variable"""
242242
path = [r"Lib\site-packages\PyQt5", r"Lib\site-packages\PyQt4",
243243
"", # Python root directory (python.exe)
244-
"DLLs", "Scripts", r"..\tools", r"..\tools\mingw32\bin"
244+
"DLLs", "Scripts", r"..\t", r"..\t\mingw32\bin"
245245
]
246246
if self.distribution.architecture == 32 \
247247
and osp.isdir(self.winpydir + self.MINGW32_PATH):
@@ -264,13 +264,13 @@ def postpath(self):
264264
"""Return PATH contents to be append to the environment variable"""
265265
path = []
266266
# if osp.isfile(self.winpydir + self.THG_PATH):
267-
# path += [r"..\tools\TortoiseHg"]
267+
# path += [r"..\t\TortoiseHg"]
268268
return path
269269

270270
@property
271271
def toolsdirs(self):
272272
"""Return tools directory list"""
273-
return [osp.join(osp.dirname(osp.abspath(__file__)), 'tools')] + self._toolsdirs
273+
return [osp.join(osp.dirname(osp.abspath(__file__)), 't')] + self._toolsdirs
274274

275275
@property
276276
def docsdirs(self):
@@ -381,6 +381,8 @@ def create_installer(self):
381381
('ARCH', self.winpy_arch),
382382
('VERSION', '%s.%d%s' % (self.python_fullversion,
383383
self.build_number, self.flavor)),
384+
('VERSION_INSTALL', '%s.%d' % (self.python_fullversion,
385+
self.build_number)),
384386
('RELEASELEVEL', self.release_level),)
385387
build_nsis('installer.nsi', fname, data)
386388
self._print_done()
@@ -471,15 +473,15 @@ def _install_all_other_packages(self):
471473
def _copy_dev_tools(self):
472474
"""Copy dev tools"""
473475
self._print("Copying tools")
474-
toolsdir = osp.join(self.winpydir, 'tools')
476+
toolsdir = osp.join(self.winpydir, 't')
475477
os.mkdir(toolsdir)
476-
for dirname in self.toolsdirs:
478+
for dirname in self.toolsdirs: # the ones in the make.py script environment
477479
for name in os.listdir(dirname):
478480
path = osp.join(dirname, name)
479481
copy = shutil.copytree if osp.isdir(path) else shutil.copyfile
480-
copy(path, osp.join(toolsdir, name))
481482
if self.verbose:
482483
print(path + ' --> ' + osp.join(toolsdir, name))
484+
copy(path, osp.join(toolsdir, name))
483485
self._print_done()
484486

485487
def _copy_dev_docs(self):
@@ -598,8 +600,8 @@ def _create_batch_scripts_initial(self):
598600
rem ******************
599601
rem handle R if included
600602
rem ******************
601-
if not exist "%WINPYDIRBASE%\tools\R\bin" goto r_bad
602-
set R_HOME=%WINPYDIRBASE%\tools\R
603+
if not exist "%WINPYDIRBASE%\t\R\bin" goto r_bad
604+
set R_HOME=%WINPYDIRBASE%\t\R
603605
if "%WINPYARCH%"=="WIN32" set R_HOMEbin=%R_HOME%\bin\i386
604606
if not "%WINPYARCH%"=="WIN32" set R_HOMEbin=%R_HOME%\bin\x64
605607
:r_bad
@@ -608,8 +610,8 @@ def _create_batch_scripts_initial(self):
608610
rem ******************
609611
rem handle Julia if included
610612
rem ******************
611-
if not exist "%WINPYDIRBASE%\tools\Julia\bin" goto julia_bad
612-
set JULIA_HOME=%WINPYDIRBASE%\tools\Julia\bin\
613+
if not exist "%WINPYDIRBASE%\t\Julia\bin" goto julia_bad
614+
set JULIA_HOME=%WINPYDIRBASE%\t\Julia\bin\
613615
set JULIA_EXE=julia.exe
614616
set JULIA=%JULIA_HOME%%JULIA_EXE%
615617
set JULIA_PKGDIR=%WINPYDIRBASE%\settings\.julia
@@ -618,8 +620,8 @@ def _create_batch_scripts_initial(self):
618620
rem ******************
619621
rem handle ffmpeg if included
620622
rem ******************
621-
if not exist "%WINPYDIRBASE%\tools\ffmpeg.exe" goto ffmpeg_bad
622-
set IMAGEIO_FFMPEG_EXE=%WINPYDIRBASE%\tools\ffmpeg.exe
623+
if not exist "%WINPYDIRBASE%\t\ffmpeg.exe" goto ffmpeg_bad
624+
set IMAGEIO_FFMPEG_EXE=%WINPYDIRBASE%\t\ffmpeg.exe
623625
624626
:ffmpeg_bad
625627
@@ -679,8 +681,8 @@ def _create_batch_scripts_initial(self):
679681
#####################
680682
### handle R if included
681683
#####################
682-
if (Test-Path "$env:WINPYDIR\..\tools\R\bin") {
683-
$env:R_HOME = "$env:WINPYDIR\..\tools\R"
684+
if (Test-Path "$env:WINPYDIR\..\t\R\bin") {
685+
$env:R_HOME = "$env:WINPYDIR\..\t\R"
684686
$env:R_HOMEbin = "$env:R_HOME\bin\x64"
685687
if ("$env:WINPYARCH" -eq "WIN32") {
686688
$env:R_HOMEbin = "$env:R_HOME\bin\i386"
@@ -690,8 +692,8 @@ def _create_batch_scripts_initial(self):
690692
#####################
691693
### handle Julia if included
692694
#####################
693-
if (Test-Path "$env:WINPYDIR\..\tools\Julia\bin") {
694-
$env:JULIA_HOME = "$env:WINPYDIR\..\tools\Julia\bin\"
695+
if (Test-Path "$env:WINPYDIR\..\t\Julia\bin") {
696+
$env:JULIA_HOME = "$env:WINPYDIR\..\t\Julia\bin\"
695697
$env:JULIA_EXE = "julia.exe"
696698
$env:JULIA = "$env:JULIA_HOME$env:JULIA_EXE"
697699
$env:JULIA_PKGDIR = "$env:WINPYDIR\..\settings\.julia"
@@ -700,8 +702,8 @@ def _create_batch_scripts_initial(self):
700702
#####################
701703
### handle ffmpeg if included
702704
#####################
703-
if (Test-Path "$env:WINPYDIR\..\tools\ffmpeg.exe") {
704-
$env:IMAGEIO_FFMPEG_EXE = "%WINPYDIRBASE%\tools\ffmpeg.exe"
705+
if (Test-Path "$env:WINPYDIR\..\t\ffmpeg.exe") {
706+
$env:IMAGEIO_FFMPEG_EXE = "%WINPYDIRBASE%\t\ffmpeg.exe"
705707
}
706708
707709
#####################
@@ -1368,6 +1370,6 @@ def make_all(build_number, release_level, pyver, architecture,
13681370
install_options=r'--no-index --pre --trusted-host=None',
13691371
find_links=r'D:\Winpython\packages.srcreq',
13701372
source_dirs=r'D:\WinPython\basedir34\packages.src D:\WinPython\basedir34\packages.win-amd64',
1371-
toolsdirs=r'D:\WinPython\basedir34\Tools.Slim',
1373+
toolsdirs=r'D:\WinPython\basedir34\t.Slim',
13721374
docsdirs=r'D:\WinPython\basedir34\docs.Slim'
13731375
)

portable/installer.nsi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ Licensed under the terms of the MIT License
1414
!define DISTDIR "D:\Pierre\maketest\winpython-2.7.3.amd64"
1515
!define ARCH "16bit"
1616
!define VERSION "2.7.3.0"
17+
; 2018-04-04 need to minimize path length of installation further: remove flavor in install path
18+
!define VERSION_INSTALL "2.7.3.0"
1719
!define RELEASELEVEL "beta2" ; empty means final release
1820
;================================================================
1921

2022
!define ID "WinPython"
21-
!define ID_INSTALL "WinPy"
23+
!define ID_INSTALL "WinPython"
2224
!define FILE_DESCRIPTION "${ID} Installer"
2325
!define COMPANY "${ID}"
2426
!define BRANDING "${ID}, the portable Python Distribution for Scientists"
@@ -39,7 +41,10 @@ OutFile "${DISTDIR}\..\${ID}${ARCH}-${VERSION}${RELEASELEVEL}.exe"
3941

4042
; 2018-03-31 need to minimize path length of installation:
4143
;InstallDir "$EXEDIR\${ID}${ARCH}-${VERSION}${RELEASELEVEL}"
42-
InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION}${RELEASELEVEL}"
44+
; 2018-04-04 need to minimize path length of installation further: remove arch + flavor
45+
;InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION}${RELEASELEVEL}"
46+
;InstallDir "$EXEDIR\${ID_INSTALL}-${VERSION_INSTALL}${RELEASELEVEL}"
47+
InstallDir "$EXEDIR\${ID_INSTALL}"
4348
BrandingText "${BRANDING}"
4449
XPStyle on
4550
RequestExecutionLevel user

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__ = '1.9.20180331'
31+
__version__ = '1.10.20180404'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

winpython/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
# Development only
33-
TOOLS_DIR = osp.abspath(osp.join(osp.dirname(__file__), os.pardir, 'tools'))
33+
TOOLS_DIR = osp.abspath(osp.join(osp.dirname(__file__), os.pardir, 't'))
3434
if osp.isdir(TOOLS_DIR):
3535
os.environ['PATH'] += ';%s' % TOOLS_DIR
3636
ROOT_DIR = os.environ.get('WINPYTHONROOTDIR')
@@ -629,7 +629,7 @@ def do_script(this_script, python_exe=None, copy_to=None,
629629

630630

631631
if __name__ == '__main__':
632-
thg = get_thg_version(osp.join(BASE_DIR, 'tools', 'tortoisehg'))
632+
thg = get_thg_version(osp.join(BASE_DIR, 't', 'tortoisehg'))
633633
print(("thg version: %r" % thg))
634634

635635
print_box("Test")

0 commit comments

Comments
 (0)