From 41169d3e7ea0efdd7a48b8e6b41ef0d3747c6e23 Mon Sep 17 00:00:00 2001 From: stonebig Date: Wed, 4 Apr 2018 19:44:56 +0200 Subject: [PATCH 1/2] remove architecture and flavor from install directory --- make.py | 2 ++ portable/installer.nsi | 6 +++++- winpython/__init__.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/make.py b/make.py index 6e9a4761..d86577ee 100644 --- a/make.py +++ b/make.py @@ -381,6 +381,8 @@ def create_installer(self): ('ARCH', self.winpy_arch), ('VERSION', '%s.%d%s' % (self.python_fullversion, self.build_number, self.flavor)), + ('VERSION_INSTALL', '%s.%d' % (self.python_fullversion, + self.build_number)), ('RELEASELEVEL', self.release_level),) build_nsis('installer.nsi', fname, data) self._print_done() diff --git a/portable/installer.nsi b/portable/installer.nsi index ef8b007c..28332a53 100644 --- a/portable/installer.nsi +++ b/portable/installer.nsi @@ -14,6 +14,8 @@ Licensed under the terms of the MIT License !define DISTDIR "D:\Pierre\maketest\winpython-2.7.3.amd64" !define ARCH "16bit" !define VERSION "2.7.3.0" +; 2018-04-04 need to minimize path length of installation further: remove flavor in install path +!define VERSION_INSTALL "2.7.3.0" !define RELEASELEVEL "beta2" ; empty means final release ;================================================================ @@ -39,7 +41,9 @@ OutFile "${DISTDIR}\..\${ID}${ARCH}-${VERSION}${RELEASELEVEL}.exe" ; 2018-03-31 need to minimize path length of installation: ;InstallDir "$EXEDIR\${ID}${ARCH}-${VERSION}${RELEASELEVEL}" -InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION}${RELEASELEVEL}" +; 2018-04-04 need to minimize path length of installation further: remove arch + flavor +;InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION}${RELEASELEVEL}" +InstallDir "$EXEDIR\${ID_INSTALL}-${VERSION_INSTALL}${RELEASELEVEL}" BrandingText "${BRANDING}" XPStyle on RequestExecutionLevel user diff --git a/winpython/__init__.py b/winpython/__init__.py index e718247a..a914e95d 100644 --- a/winpython/__init__.py +++ b/winpython/__init__.py @@ -28,6 +28,6 @@ OTHER DEALINGS IN THE SOFTWARE. """ -__version__ = '1.9.20180331' +__version__ = '1.10.20180404' __license__ = __doc__ __project_url__ = 'http://winpython.github.io/' From e3d74f0eb7e0ba0d73955bd8bec4b06af3843357 Mon Sep 17 00:00:00 2001 From: stonebig Date: Wed, 4 Apr 2018 21:30:35 +0200 Subject: [PATCH 2/2] reduce "tools" path to "t" + default install dir is "WinPython" --- make.py | 54 +++++++++++++++++++++--------------------- portable/installer.nsi | 5 ++-- winpython/utils.py | 4 ++-- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/make.py b/make.py index d86577ee..aacd57dc 100644 --- a/make.py +++ b/make.py @@ -93,10 +93,10 @@ def build_nsis(srcname, dstname, data): class WinPythonDistribution(object): """WinPython distribution""" - MINGW32_PATH = r'\tools\mingw32\bin' - R_PATH = r'\tools\R\bin' - JULIA_PATH = r'\tools\Julia\bin' - NODEJS_PATH = r'\tools\n' + MINGW32_PATH = r'\t\mingw32\bin' + R_PATH = r'\t\R\bin' + JULIA_PATH = r'\t\Julia\bin' + NODEJS_PATH = r'\t\n' def __init__(self, build_number, release_level, target, wheeldir, toolsdirs=None, verbose=False, simulation=False, @@ -134,7 +134,7 @@ def package_index_wiki(self): def get_tool_path(relpath, checkfunc): if self.simulation: for dirname in self.toolsdirs: - path = dirname + relpath.replace(r'\tools', '') + path = dirname + relpath.replace(r'\t', '') if checkfunc(path): return path else: @@ -142,7 +142,7 @@ def get_tool_path(relpath, checkfunc): if checkfunc(path): return path - if get_tool_path (r'\tools\SciTE.exe', osp.isfile): + if get_tool_path (r'\t\SciTE.exe', osp.isfile): installed_tools += [('SciTE', '3.3.7')] rpath = get_tool_path(self.R_PATH, osp.isdir) @@ -162,12 +162,12 @@ def get_tool_path(relpath, checkfunc): npmver = utils.get_npmjs_version(nodepath) installed_tools += [('npmjs', npmver)] - pandocexe = get_tool_path (r'\tools\pandoc.exe', osp.isfile) + pandocexe = get_tool_path (r'\t\pandoc.exe', osp.isfile) if pandocexe is not None: pandocver = utils.get_pandoc_version(osp.dirname(pandocexe)) installed_tools += [('Pandoc', pandocver)] - ffmpegexe = get_tool_path (r'\tools\ffmpeg.exe', osp.isfile) + ffmpegexe = get_tool_path (r'\t\ffmpeg.exe', osp.isfile) if ffmpegexe is not None: ffmpegver = utils.get_ffmpeg_version(osp.dirname(ffmpegexe)) installed_tools += [('ffmpeg', ffmpegver)] @@ -241,7 +241,7 @@ def prepath(self): """Return PATH contents to be prepend to the environment variable""" path = [r"Lib\site-packages\PyQt5", r"Lib\site-packages\PyQt4", "", # Python root directory (python.exe) - "DLLs", "Scripts", r"..\tools", r"..\tools\mingw32\bin" + "DLLs", "Scripts", r"..\t", r"..\t\mingw32\bin" ] if self.distribution.architecture == 32 \ and osp.isdir(self.winpydir + self.MINGW32_PATH): @@ -264,13 +264,13 @@ def postpath(self): """Return PATH contents to be append to the environment variable""" path = [] # if osp.isfile(self.winpydir + self.THG_PATH): - # path += [r"..\tools\TortoiseHg"] + # path += [r"..\t\TortoiseHg"] return path @property def toolsdirs(self): """Return tools directory list""" - return [osp.join(osp.dirname(osp.abspath(__file__)), 'tools')] + self._toolsdirs + return [osp.join(osp.dirname(osp.abspath(__file__)), 't')] + self._toolsdirs @property def docsdirs(self): @@ -473,15 +473,15 @@ def _install_all_other_packages(self): def _copy_dev_tools(self): """Copy dev tools""" self._print("Copying tools") - toolsdir = osp.join(self.winpydir, 'tools') + toolsdir = osp.join(self.winpydir, 't') os.mkdir(toolsdir) - for dirname in self.toolsdirs: + for dirname in self.toolsdirs: # the ones in the make.py script environment for name in os.listdir(dirname): path = osp.join(dirname, name) copy = shutil.copytree if osp.isdir(path) else shutil.copyfile - copy(path, osp.join(toolsdir, name)) if self.verbose: print(path + ' --> ' + osp.join(toolsdir, name)) + copy(path, osp.join(toolsdir, name)) self._print_done() def _copy_dev_docs(self): @@ -600,8 +600,8 @@ def _create_batch_scripts_initial(self): rem ****************** rem handle R if included rem ****************** -if not exist "%WINPYDIRBASE%\tools\R\bin" goto r_bad -set R_HOME=%WINPYDIRBASE%\tools\R +if not exist "%WINPYDIRBASE%\t\R\bin" goto r_bad +set R_HOME=%WINPYDIRBASE%\t\R if "%WINPYARCH%"=="WIN32" set R_HOMEbin=%R_HOME%\bin\i386 if not "%WINPYARCH%"=="WIN32" set R_HOMEbin=%R_HOME%\bin\x64 :r_bad @@ -610,8 +610,8 @@ def _create_batch_scripts_initial(self): rem ****************** rem handle Julia if included rem ****************** -if not exist "%WINPYDIRBASE%\tools\Julia\bin" goto julia_bad -set JULIA_HOME=%WINPYDIRBASE%\tools\Julia\bin\ +if not exist "%WINPYDIRBASE%\t\Julia\bin" goto julia_bad +set JULIA_HOME=%WINPYDIRBASE%\t\Julia\bin\ set JULIA_EXE=julia.exe set JULIA=%JULIA_HOME%%JULIA_EXE% set JULIA_PKGDIR=%WINPYDIRBASE%\settings\.julia @@ -620,8 +620,8 @@ def _create_batch_scripts_initial(self): rem ****************** rem handle ffmpeg if included rem ****************** -if not exist "%WINPYDIRBASE%\tools\ffmpeg.exe" goto ffmpeg_bad -set IMAGEIO_FFMPEG_EXE=%WINPYDIRBASE%\tools\ffmpeg.exe +if not exist "%WINPYDIRBASE%\t\ffmpeg.exe" goto ffmpeg_bad +set IMAGEIO_FFMPEG_EXE=%WINPYDIRBASE%\t\ffmpeg.exe :ffmpeg_bad @@ -681,8 +681,8 @@ def _create_batch_scripts_initial(self): ##################### ### handle R if included ##################### -if (Test-Path "$env:WINPYDIR\..\tools\R\bin") { - $env:R_HOME = "$env:WINPYDIR\..\tools\R" +if (Test-Path "$env:WINPYDIR\..\t\R\bin") { + $env:R_HOME = "$env:WINPYDIR\..\t\R" $env:R_HOMEbin = "$env:R_HOME\bin\x64" if ("$env:WINPYARCH" -eq "WIN32") { $env:R_HOMEbin = "$env:R_HOME\bin\i386" @@ -692,8 +692,8 @@ def _create_batch_scripts_initial(self): ##################### ### handle Julia if included ##################### -if (Test-Path "$env:WINPYDIR\..\tools\Julia\bin") { - $env:JULIA_HOME = "$env:WINPYDIR\..\tools\Julia\bin\" +if (Test-Path "$env:WINPYDIR\..\t\Julia\bin") { + $env:JULIA_HOME = "$env:WINPYDIR\..\t\Julia\bin\" $env:JULIA_EXE = "julia.exe" $env:JULIA = "$env:JULIA_HOME$env:JULIA_EXE" $env:JULIA_PKGDIR = "$env:WINPYDIR\..\settings\.julia" @@ -702,8 +702,8 @@ def _create_batch_scripts_initial(self): ##################### ### handle ffmpeg if included ##################### -if (Test-Path "$env:WINPYDIR\..\tools\ffmpeg.exe") { - $env:IMAGEIO_FFMPEG_EXE = "%WINPYDIRBASE%\tools\ffmpeg.exe" +if (Test-Path "$env:WINPYDIR\..\t\ffmpeg.exe") { + $env:IMAGEIO_FFMPEG_EXE = "%WINPYDIRBASE%\t\ffmpeg.exe" } ##################### @@ -1370,6 +1370,6 @@ def make_all(build_number, release_level, pyver, architecture, install_options=r'--no-index --pre --trusted-host=None', find_links=r'D:\Winpython\packages.srcreq', source_dirs=r'D:\WinPython\basedir34\packages.src D:\WinPython\basedir34\packages.win-amd64', - toolsdirs=r'D:\WinPython\basedir34\Tools.Slim', + toolsdirs=r'D:\WinPython\basedir34\t.Slim', docsdirs=r'D:\WinPython\basedir34\docs.Slim' ) diff --git a/portable/installer.nsi b/portable/installer.nsi index 28332a53..f279e016 100644 --- a/portable/installer.nsi +++ b/portable/installer.nsi @@ -20,7 +20,7 @@ Licensed under the terms of the MIT License ;================================================================ !define ID "WinPython" -!define ID_INSTALL "WinPy" +!define ID_INSTALL "WinPython" !define FILE_DESCRIPTION "${ID} Installer" !define COMPANY "${ID}" !define BRANDING "${ID}, the portable Python Distribution for Scientists" @@ -43,7 +43,8 @@ OutFile "${DISTDIR}\..\${ID}${ARCH}-${VERSION}${RELEASELEVEL}.exe" ;InstallDir "$EXEDIR\${ID}${ARCH}-${VERSION}${RELEASELEVEL}" ; 2018-04-04 need to minimize path length of installation further: remove arch + flavor ;InstallDir "$EXEDIR\${ID_INSTALL}${ARCH}-${VERSION}${RELEASELEVEL}" -InstallDir "$EXEDIR\${ID_INSTALL}-${VERSION_INSTALL}${RELEASELEVEL}" +;InstallDir "$EXEDIR\${ID_INSTALL}-${VERSION_INSTALL}${RELEASELEVEL}" +InstallDir "$EXEDIR\${ID_INSTALL}" BrandingText "${BRANDING}" XPStyle on RequestExecutionLevel user diff --git a/winpython/utils.py b/winpython/utils.py index 28354e13..f693b9e5 100644 --- a/winpython/utils.py +++ b/winpython/utils.py @@ -30,7 +30,7 @@ # Development only -TOOLS_DIR = osp.abspath(osp.join(osp.dirname(__file__), os.pardir, 'tools')) +TOOLS_DIR = osp.abspath(osp.join(osp.dirname(__file__), os.pardir, 't')) if osp.isdir(TOOLS_DIR): os.environ['PATH'] += ';%s' % TOOLS_DIR ROOT_DIR = os.environ.get('WINPYTHONROOTDIR') @@ -629,7 +629,7 @@ def do_script(this_script, python_exe=None, copy_to=None, if __name__ == '__main__': - thg = get_thg_version(osp.join(BASE_DIR, 'tools', 'tortoisehg')) + thg = get_thg_version(osp.join(BASE_DIR, 't', 'tortoisehg')) print(("thg version: %r" % thg)) print_box("Test")