8000 Remove the typing module by ericpre · Pull Request #686 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

Remove the typing module #686

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

Closed
wants to merge 1 commit into from

Conversation

ericpre
Copy link
@ericpre ericpre commented Nov 1, 2018

Remove the typing module since this is a standard python library since 3.5 and it seems to conflict with python 3.7.

See https://docs.python.org/3/library/typing.html and this appveyor build failure.

@stonebig
Copy link
Contributor
stonebig commented Nov 1, 2018

well:

  • this is an entry in the list of names of packages, so not the solution,
  • I see "altair" required this : Collecting typing (from altair->-r C:\Winp\bd36\Qt5_requirements.txt (line 202),
  • we must evicerate it at source, or at build time.

@stonebig
Copy link
Contributor
stonebig commented Nov 1, 2018

for the moment:

@ericpre
Copy link
Author
ericpre commented Nov 1, 2018

Thanks for quick reply!
I haven't work out how winpython is built and I was naively hoping that this list of packages is used at build time to defined what needs to be installed!

for the moment:

Sounds a very good plan to me! Shall I close this PR?

@stonebig
Copy link
Contributor
stonebig commented Nov 1, 2018

winpython package pre-loading is mainly done via a big pip install requirements.txt.
If any package in the list requires "typing", an obvious error starting python-3.6, then typing is included.

The fix is:

  • to ask a correction to any package that requires it.
  • to add a "safety/corrective belt" in the mean time, like it is done for "enum34".

So your issue is correct, but your proposed fix is uncorrect.


rem * ===================
echo remove typing from altair (2018-11-01)
rem * ===================
if exist  "%WINPYDIR%\Lib\site-packages\typing.py" "%WINPYDIR%\scripts\pip.exe" uninstall -y typing

@stonebig
Copy link
Contributor
stonebig commented Nov 1, 2018

I shall move that [ugly] post-fix part "run_complement.bat" in the github directory someday. Currently you don't see it.

@stonebig stonebig closed this Nov 1, 2018
@stonebig
Copy link
Contributor
stonebig commented Nov 1, 2018

run_complement.bat:

@echo off 
rem %1 is WINPYDIR being prepared
rem this .bat is placed at root (buildir34, buildir34\FlavorJulia, ...)
set origin=%~dp0
set new_winpydir=%1


cd /d %new_winpydir%

call scripts\env.bat
@echo on

rem 2018-01-19 no more needeed https://github.com/jupyter-widgets/ipywidgets/pull/1911/files
rem if exist  "%WINPYDIR%\Lib\site-packages\IPython" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py widgetsnbextension
rem if exist  "%WINPYDIR%\Lib\site-packages\IPython" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix widgetsnbextension

rem *===========================
echo Python 3.5 has no mingwpy
rem *===========================
if not exist "%WINPYDIR%\Lib\site-packages\mingwpy" set pydistutils_cfg=%WINPYDIR%\..\settings\pydistutils.cfg
if not exist "%WINPYDIR%\Lib\site-packages\mingwpy" echo [config]>%pydistutils_cfg%
 
rem * =================
echo PyQt5.6 remove non-existing options examples
rem * =================
set qt56=%WINPYDIR%\Lib\site-packages\PyQt5
if exist  "%qt56%" (
rem  if not exist  "%qt56%\examples" copy "%origin%\PyQt56\examples" "%qt56%\examples"
if not exist  "%qt56%\examples" del %WINPYDIR%\..\"Qt Demo.exe"
rem 2070122-keepforQt4 if not exist  "%qt56%\designer.exe" del %WINPYDIR%\..\"Qt Designer.exe"
rem 2070122-keepforQt4 if not exist  "%qt56%\linguist.exe" del %WINPYDIR%\..\"Qt Linguist.exe"
if not exist  "%qt56%\assistant.exe" del %WINPYDIR%\..\"Qt Assistant.exe"
)

rem * =================
echo patch PyQt5.6.0 wheel
rem * =================
set qt56p=%WINPYDIR%\Lib\site-packages\PyQt5-5.6.dist-info
if exist  "%qt56p%" ( 
if not exist  "%qt56%\icudtl.dat" copy "%qt56%\Qt\resources\*u*.*" "%qt56%"
)

rem * =================
echo configure ipython-parallel
rem * =================
@echo on
if exist  "%WINPYDIR%\Lib\site-packages\IPython"  "%WINPYDIR%\Scripts\jupyter-notebook.exe" --generate-config

rem starting Jupyter 5+, use ipcluster
if exist "%WINPYDIR%\Scripts\ipcluster.exe" "%WINPYDIR%\Scripts\ipcluster.exe" nbextension enable

rem 2018-03-10
if exist "%WINPYDIR%\Scripts\ipcluster.exe" jupyter nbextension install --sys-prefix --py ipyparallel
if exist "%WINPYDIR%\Scripts\ipcluster.exe" jupyter nbextension enable --sys-prefix --py ipyparallel


rem    if not exist "ipcluster.exe" echo c.NotebookApp.server_extensions.append('ipyparallel.nbextension')>>"%winpydir%\..\settings\.jupyter\jupyter_notebook_config.py"


@echo on
rem * =================
echo finish install of jupyterlab
rem * =================
rem 2018-01-15 node-gyp experience 2018-01-19removetest
rem npm config set python "C:/WinPython/basedir27/buildZero/winpython-32bit-2.7.x.2/python-2.7.13/python.exe"
rem npm config set PYTHON "C:/WinP/bd27/buildZero/winpython-32bit-2.7.x.2/python-2.7.13/python.exe"
                                                
rem "%WINPYDIR%\..\tools\n\node_modules\npm\bin\node-gyp-bin\node-gyp.cmd" configure --msvs_version=2015
rem if exist  "%WINPYDIR%\Lib\site-packages\jupyterlab" "%WINPYDIR%\Scripts\jupyter.exe" serverextension enable --py  jupyterlab --sys-prefix 


rem * ===================
echo jupyterlab manager (if npm there)
rem * ==================
@echo on
rem jupyter lab clean
rem jupyter labextension list
rem 2018-07-07 for jupyterlab-0.32.x: https://www.npmjs.com/package/@jupyter-widgets/jupyterlab-manager
if exist  "%WINPYDIR%\Lib\site-packages\jupyterlab"  "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build @jupyter-widgets/jupyterlab-manager

rem jupyter labextension install --no-build @jupyter-widgets/base
rem jupyter labextension install --no-build @jupyter-widgets/controls
rem jupyter labextension install --no-build @jupyter-widgets/html-manager
rem jupyter labextension install --no-build @jupyter-widgets/output
rem jupyter labextension install --no-build @jupyter-widgets/notebook-manager


rem * =================
echo finish install of bqplot
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\bqplot" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix bqplot

echo finish install of bqplot for jupyterlab (2017-09-23)
rem 2018-01-05a simplification
if exist  "%WINPYDIR%\Lib\site-packages\bqplot" "%WINPYDIR%\Scripts\jupyter.exe"  labextension install --no-build bqplot

rem * =================
echo finish install of bokeh for jupyterlab (2017-09-16)
rem * =================
rem 2018-01-05a simplification
if exist  "%WINPYDIR%\Lib\site-packages\bokeh" "%WINPYDIR%\Scripts\jupyter.exe"  labextension install --no-build jupyterlab_bokeh

rem * =================
echo finish install of ipydatawidgets (2018-03-10)
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\ipydatawidgets" "%WINPYDIR%\Scripts\jupyter.exe" nbextension install --py  --sys-prefix  ipydatawidgets
if exist  "%WINPYDIR%\Lib\site-packages\ipydatawidgets" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py  --sys-prefix  ipydatawidgets
if exist  "%WINPYDIR%\Lib\site-packages\ipydatawidgets" "%WINPYDIR%\Scripts\jupyter.exe"  labextension install --no-build jupyterlab-datawidgets

rem * =================
echo finish install of ipyleaflet
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\ipyleaflet" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix  ipyleaflet

rem 20171210 standardized
rem 2018-01-05a simplification
if exist  "%WINPYDIR%\Lib\site-packages\ipyleaflet" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build jupyter-leaflet

rem * =================
echo finish install of pythreejs
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\pythreejs" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py  --sys-prefix  pythreejs

rem 2017-12-24
rem 2018-01-05a simplification
if exist  "%WINPYDIR%\Lib\site-packages\pythreejs" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build jupyter-threejs



rem * =================
echo finish install of ipyvolume / ipywebrtc
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\ipywebrtc" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py  --sys-prefix  ipywebrtc
if exist  "%WINPYDIR%\Lib\site-packages\ipyvolume" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py  --sys-prefix  ipyvolume

echo finish install of ipyvolume / ipywebrtc (lab 2018-10-06)
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\ipywebrtc" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build jupyter-webrtc
if exist  "%WINPYDIR%\Lib\site-packages\ipywebrtc" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build ipyvolume

rem * =================
echo finish install of altair
rem * =================
rem if exist  "%WINPYDIR%\Lib\site-packages\vega" "%WINPYDIR%\Scripts\jupyter.exe" nbextension install --py --sys-prefix vega
rem 2018-08-16 # not needed in notebook >= 5.3 :
rem if exist  "%WINPYDIR%\Lib\site-packages\vega" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix vega 



rem * =================
echo finish install of pdvega
rem * =================
rem if exist  "%WINPYDIR%\Lib\site-packages\vega3" "%WINPYDIR%\Scripts\jupyter.exe" nbextension install --sys-prefix --py vega3 # not needed in notebook >= 5.3
if exist  "%WINPYDIR%\Lib\site-packages\vega3" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix vega3

rem 2018-02-24a addition ?
rem 2018-08-16 unneeed  since jlab-0.33.2
rem if exist  "%WINPYDIR%\Lib\site-packages\vega3" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build @jupyterlab/vega3-extension


rem * =================
echo finish install of rise
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\rise" "%WINPYDIR%\Scripts\jupyter.exe" nbextension install rise --py --sys-prefix
if exist  "%WINPYDIR%\Lib\site-packages\rise" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix rise 


rem * =================
echo finish install of ipympl (2017-10-29)
rem * =================
rem if exist  "%WINPYDIR%\Lib\site-packages\ipympl" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build jupyter-matplotlib
if exist  "%WINPYDIR%\Lib\site-packages\ipympl" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix ipympl

rem 2018-01-05a simplification
if exist  "%WINPYDIR%\Lib\site-packages\ipympl" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build jupyter-matplotlib



rem * =================
echo finish install of holoviews jupyterlab 2018-02-27 
rem * =================
rem 2018-07-07 no more holoviews plugin direct
rem if exist  "%WINPYDIR%\Lib\site-packages\holoviews" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build @pyviz/jupyterlab_holoviews

if exist  "%WINPYDIR%\Lib\site-packages\holoviews" "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build @pyviz/jupyterlab_pyviz


rem * =================
echo finish install seaborn iris example
rem * =================
if exist  "%WINPYDIR%\Lib\site-packages\seaborn" "%WINPYDIR%\python.exe" -c "import seaborn as sns;sns.set();sns.load_dataset('iris')"


rem * =================
echo finish install PyQtdoc
rem * =================
if exist  "%WINPYDIR%\Scripts\PyQtdoc_win_post_install.bat" "%WINPYDIR%\Scripts\PyQtdoc_win_post_install.bat" "-install"


rem * =================
echo finish install of xonsh
rem * =================
if not exist  "%WINPYDIR%\Lib\site-packages\xonsh" goto no_xonsh

rem we don't suppose console_colors.reg is used
rem echo $INTENSIFY_COLORS_ON_WIN = False>>"%winpydir%\..\settings\.xonshrc"
rem echo $PROMPT = $PROMPT.replace('INTENSE_','').replace('CYAN','BLUE')>>"%winpydir%\..\settings\.xonshrc"
if exist  "%WINPYDIR%\Lib\site-packages\win_unicode_console" echo $WIN_UNICODE_CONSOLE = True>>"%winpydir%\..\settings\.xonshrc"

:no_xonsh


rem * ==================
echo opengl PyQt5 patch 2018-01-06
rem * ==================
set qt56p=%WINPYDIR%\Lib\site-packages\PyQt5\Qt\bin
set qt56dest=%WINPYDIR%\Lib\site-packages\PyQt5\Qt\bin\opengl32sw.dll
if exist  "%qt56p%" if not exist "%qt56dest%" ( 
if "%WINPYARCH%"=="WIN32" copy "C:\WinPython\bd35\patch_qt570\opengl32sw-32\opengl32sw.dll" "%WINPYDIR%\Lib\site-packages\PyQt5\Qt\bin\opengl32sw.dll"
)
if not "%WINPYARCH%"=="WIN32" copy "C:\WinPython\bd35\patch_qt570\opengl32sw-64\opengl32sw.dll" "%WINPYDIR%\Lib\site-packages\PyQt5\Qt\bin\opengl32sw.dll"
)




rem rem * =================
rem echo temporay 3.6b2 distlib patch 
rem rem * =================
rem if not "%WINPYVER:~0,3%"=="3.6" goto no_distlib24_patch
rem copy /Y "C:\WinPython\bd36\patch_distlib24\distlib-0.2.4-py2.py3-none-any\distlib" "%WINPYDIR%\Lib\site-packages\pip\_vendor\distlib"
rem pause
:no_distlib24_patch


rem *===========================
echo 2017-02-07
echo .spyder3\temp.py suspected of creating issue east of Italia
echo see https://groups.google.com/forum/#!topic/spyderlib/dH5VXlTc30s
rem *===========================
if  exist "%WINPYDIR%\..\settings\.spyder-py3\temp.py" del  "%WINPYDIR%\..\settings\.spyder-py3\temp.py"


rem * ====================
echo patch spyder update reflex (2017-03-25)
rem * ====================

%WINPYDIR%\python.exe -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%WINPYDIR%\Lib\site-packages\spyderlib\config\main.py', ' '+chr(39)+'check_updates_on_startup'+chr(39)+': True', ' '+chr(39)+'check_updates_on_startup'+chr(39)+': False' )"

rem * ===================
echo patch pandas-0.18.1 incompatibility with scipy-0.19.0 (2017-03-25)
rem * ==================
rem %WINPYDIR%\python.exe -c "from winpython.utils import patch_sourcefile;patch_sourcefile(r'%WINPYDIR%\Lib\site-packages\pandas\core\window.py', 'return sig.get_window(win_type, window).astype(float)', 'return sig.get_window(win_type, window, False).astype(float)'  )"

rem * ===========================
echo FreeImage plugin of Imageio (replace sckit-image shim, 2017-08-07)
rem * ===========================
rem no more sure, as Pillow did improve a lot
rem if exist  "%WINPYDIR%\Lib\site-packages\imageio"  %WINPYDIR%\python.exe -c "import imageio;imageio.plugins.freeimage.download()"


rem * ===================
echo 2018-03-25 Jupyterlab simplified wrap-up (https://github.com/jupyter/notebook/pull/3116#issuecomment-355672998)
rem * ===================
rem 2018-03*25 speed-up
if exist  "%WINPYDIR%\Lib\site-packages\jupyterlab" jupyter labextension list

rem 2018-03-25 try  reduce time by bilding only once
rem before at each extension do:
rem   "%WINPYDIR%\Scripts\jupyter.exe" labextension install --no-build 
rem and at the end:

if exist  "%WINPYDIR%\Lib\site-packages\jupyterlab" "%WINPYDIR%\Scripts\jupyter.exe" lab build

rem see result
if exist  "%WINPYDIR%\Lib\site-packages\jupyterlab" jupyter labextension list

rem 2018-01-15 node-gyp experience
rem npm config set python "C:\WinPython\bd27\buildZero\winpython-32bit-2.7.x.2\python-2.7.13"
rem npm config delete python 

rem * ===================
echo remove enum34 from Tensorfow (2017-12-22)
rem * ===================

if exist  "%WINPYDIR%\Lib\site-packages\enum" "%WINPYDIR%\scripts\pip.exe" uninstall -y enum34

rem "C:\WinPython\bd36\buildQt5\winpython-64bit-3.6.x.1\python-3.6.3.amd64\Scripts\pip.exe" uninstall -y enum34

rem * ===================
echo remove typing from altair (2018-11-01)
rem * ===================
if exist  "%WINPYDIR%\Lib\site-packages\typing.py" "%WINPYDIR%\scripts\pip.exe" uninstall -y typing

rem * ===================
echo clear jupyterlab staging (2018-03-09)
rem * ===================

if exist "%WINPYDIR%\share\jupyter\lab\staging"  rmdir /S /Q "%WINPYDIR%\share\jupyter\lab\staging"


rem * ===================
echo clear Pyside2 QML (2018-04-29 : it's too big)
rem * ===================

if exist  "%WINPYDIR%\Lib\site-packages\PySide2\qml"  rmdir /S /Q "%WINPYDIR%\Lib\site-packages\PySide2\qml"


@echo on
goto the_end

rem ====================
rem installation via requirements.txt, requirements2.txt and requirements3.txt files
rem ====================

rem pip install cvxpy --no-index --find-links=C:\WinPython\packages.srcreq --trusted-host=None

set link_srcreq=--find-links=%origin%packages.srcreq

set my_req=%origin%requirements.txt
if exist %my_req% pip install -r %my_req% --no-index %link_srcreq% --trusted-host=None

set my_req=%origin%requirements2.txt
if exist %my_req% pip install -r %my_req% --no-index %link_srcreq% --trusted-host=None

set my_req=%origin%requirements3.txt
if exist %my_req% pip install -r %my_req% --no-index %link_srcreq% --trusted-host=None

:the_end

@stonebig
Copy link
Contributor
stonebig commented Nov 1, 2018

Typing module as been Rewritten in python-3.7, so the issue appears only in 3.7.

I will re-spin an rc2 with that correction at least.

@stonebig
Copy link
Contributor
stonebig commented Nov 2, 2018

Remarks on hyperspy:

  • "strlen_8192" and "TextReplace" may no longer be needed, if I remember well, because I moved the PATH "treatment" in the "env.bat"
  • coming WinPython will uses Inno Setup, it may affect hyperspy-bundle for unzipping:
    • with NSIS: WinPython32-3.7.0.2Zero.exe /S /D=Z:\WPy-3702
    • with Inno: WinPython32-3.7.1.0Zero.exe /VERYSILENT /DIR=Z:\WPy-3710

@ericpre
Copy link
Author
ericpre commented Nov 4, 2018

Thanks @stonebig!
I was cleaning up a bit the hyperpsy-bundle and your remarks are very welcome!

On the slightly different topic, what are the motivations to move from NSIS to Inno?

@ericpre ericpre deleted the remove_typing_module branch November 4, 2018 11:24
@stonebig
Copy link
Contributor
stonebig commented Nov 4, 2018

Because:

  • NSIS-2.46 can't compress more than 2.2 Go,
  • core packages keep growing : numpy-mkl, PyQt/Pyside2, Tensorflow/PyTorch
    ==> Winpython 64 bit cannot fit in that limit anymore, without starting to drop things.

Inno removes that limit, and looks more modern/maintained/popular/easy to me.

I kept the existing code, so using Inno is just matter of calling "dist.create_installer()" instead of
"dist.create_installer_inno()" in the make.py file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0