diff --git a/make.py b/make.py index 730e4b24..af279d2a 100644 --- a/make.py +++ b/make.py @@ -546,6 +546,10 @@ def _create_batch_scripts_initial(self): self._print("Creating batch scripts initial") conv = lambda path: ";".join(['%WINPYDIR%\\'+pth for pth in path]) path = conv(self.prepath) + ";%PATH%;" + conv(self.postpath) + + convps = lambda path: ";".join(['$env:WINPYDIR\\'+pth for pth in path]) + pathps = convps(self.prepath) + ";$env:path;" + convps(self.postpath) + self.create_batch_script('env.bat', r"""@echo off set WINPYDIR=%~dp0.."""+"\\" + self.python_name + r""" set WINPYVER=""" + self.winpyver + r""" @@ -595,6 +599,90 @@ def _create_batch_scripts_initial(self): echo #JUPYTER_DATA_DIR = %%HOME%%>>"%winpython_ini%" echo #WINPYWORKDIR = %%HOMEDRIVE%%%%HOMEPATH%%\Documents\WinPython%%WINPYVER%%\Notebooks>>"%winpython_ini%" ) +""") + + self.create_batch_script('WinPython_PS_Prompt.ps1', r""" +############################### +### WinPython_PS_Prompt.ps1 ### +############################### + + +$env:WINPYDIR = '$pwd\.."""+'\\' + self.python_name + r"""' +$env:WINPYVER = '""" + self.winpyver + r"""' +$env:HOME = '$env:WINPYDIR\..\settings' +$env:JUPYTER_DATA_DIR = '$env:HOME' +$env:WINPYARCH = 'WIN32' +if ($env:WINPYARCH.subString($env:WINPYARCH.length-5, 5) -eq 'amd64') { + $env:WINPYARCH = 'WIN-AMD64' } + +if (-not $env:PATH.ToLower().Contains(";"+ $env:WINPYDIR.ToLower()+ ";")) { + $env:PATH = '""" + pathps + r"""' } + +#rem force default pyqt5 kit for Spyder if PyQt5 module is there +if (Test-Path "$env:WINPYDIR\Lib\site-packages\PyQt5") { $env:QT_API = "pyqt5" } + + +############################### +### Set-WindowSize +############################### +Function Set-WindowSize { +Param([int]$x=$host.ui.rawui.windowsize.width, + [int]$y=$host.ui.rawui.windowsize.heigth, + [int]$buffer=$host.UI.RawUI.BufferSize.heigth) + + $buffersize = new-object System.Management.Automation.Host.Size($x,$buffer) + $host.UI.RawUI.BufferSize = $buffersize + $size = New-Object System.Management.Automation.Host.Size($x,$y) + $host.ui.rawui.WindowSize = $size +} + +Set-WindowSize 150 40 6000 + +### Colorize to distinguish +$host.ui.RawUI.BackgroundColor = "DarkBlue" +$host.ui.RawUI.ForegroundColor = "White" + + +##################### +### handle R if included +##################### +if (Test-Path "$env:WINPYDIR\..\tools\R\bin") { + $env:R_HOME = "$env:WINPYDIR\..\tools\R" + $env:R_HOMEbin = "$env:R_HOME\bin\x64" + if ("$env:WINPYARCH" -eq "WIN32") { + $env:R_HOMEbin = "$env:R_HOME\bin\i386" + } +} + +##################### +### handle Julia if included +##################### +if (Test-Path "$env:WINPYDIR\..\tools\Julia\bin") { + $env:JULIA_HOME = "$env:WINPYDIR\..\tools\Julia\bin\" + $env:JULIA_EXE = "julia.exe" + $env:JULIA = "$env:JULIA_HOME$env:JULIA_EXE" + $env:JULIA_PKGDIR = "$env:WINPYDIR\..\settings\.julia" +} + +##################### +### WinPython.ini part (removed from nsis) +##################### +if (-not (Test-Path "$env:WINPYDIR\..\settings")) { md -Path "$env:WINPYDIR\..\settings" } +$env:winpython_ini = "$env:WINPYDIR\..\settings\winpython.ini" +if (-not (Test-Path $env:winpython_ini)) { + "[debug]" | Add-Content -Path $env:winpython_ini + "state = disabled" | Add-Content -Path $env:winpython_ini + "[environment]" | Add-Content -Path $env:winpython_ini + "## Uncomment lines to override environment variables" | Add-Content -Path $env:winpython_ini + "#HOME = %%HOMEDRIVE%%%%HOMEPATH%%\Documents\WinPython%%WINPYVER%%" | Add-Content -Path $env:winpython_ini + "#JUPYTER_DATA_DIR = %%HOME%%" | Add-Content -Path $env:winpython_ini + "#WINPYWORKDIR = %%HOMEDRIVE%%%%HOMEPATH%%\Documents\WinPython%%WINPYVER%%\Notebooks" | Add-Content -Path $env:winpython_ini +} +""") + + self.create_batch_script('WinPython_Interpreter_PS.bat', r"""@echo off +rem call "%~dp0env_for_icons.bat" +Powershell.exe -executionpolicy RemoteSigned -noexit -file "%~dp0WinPython_PS_Prompt.ps1" """) self.create_batch_script('env_for_icons.bat', r"""@echo off @@ -766,6 +854,7 @@ def _create_batch_scripts(self): self.create_batch_script('cmd.bat', r"""@echo off call "%~dp0env_for_icons.bat" cmd.exe /k""") + self.create_batch_script('python.bat',r"""@echo off call "%~dp0env_for_icons.bat" cd/D "%WINPYWORKDIR%" diff --git a/portable/icons/powershell.ico b/portable/icons/powershell.ico new file mode 100644 index 00000000..2878c965 Binary files /dev/null and b/portable/icons/powershell.ico differ diff --git a/winpython/data/packages.ini b/winpython/data/packages.ini index f75d52f2..afda1cfa 100644 --- a/winpython/data/packages.ini +++ b/winpython/data/packages.ini @@ -106,6 +106,9 @@ description=Cross-platform colored terminal text [comtypes] description=Pure Python COM package +[commonmark] +description=Python parser for the CommonMark Markdown spec + [configparser] description=This library brings the updated configparser from Python 3.5 to Python 2.6-3.5. @@ -362,6 +365,9 @@ description=A fast and thorough lazy object proxy. [libpython] description=The MinGW import library for Python +[lightfm] +description=A Python implementation of LightFM, a hybrid recommendation algorithm. + [lightning-python] description=A Python client library for the Lightning data visualization server @@ -466,6 +472,9 @@ description=A system for assigning and grading notebooks. [nbpresent] description=Next generation slides from Jupyter Notebooks +[nbsphinx] +description=Jupyter Notebook Tools for Sphinx + [netcdf4] description=python/numpy interface to netCDF library (versions 3 and 4) @@ -808,6 +817,9 @@ description=Provides an abstraction layer on top of the various Qt bindings (PyQ [queuelib] description=Collection of persistent (disk-based) queues +[recommonmark] +description=A markdown parser for docutils + [redis] description=Python client for Redis key-value store