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

Skip to content

reduce install path to accomodate better with nodejs #611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -134,15 +134,15 @@ 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:
path = self.winpydir + relpath
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)
Expand All @@ -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)]
Expand Down Expand Up @@ -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):
Expand All @@ -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):
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -471,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):
Expand Down Expand Up @@ -598,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
Expand All @@ -608,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
Expand All @@ -618,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

Expand Down Expand Up @@ -679,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"
Expand All @@ -690,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"
Expand All @@ -700,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"
}

#####################
Expand Down Expand Up @@ -1368,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'
)
9 changes: 7 additions & 2 deletions portable/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ 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
;================================================================

!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"
Expand All @@ -39,7 +41,10 @@ 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}"
InstallDir "$EXEDIR\${ID_INSTALL}"
BrandingText "${BRANDING}"
XPStyle on
RequestExecutionLevel user
Expand Down
2 changes: 1 addition & 1 deletion winpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
4 changes: 2 additions & 2 deletions winpython/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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")
Expand Down