To: vim_dev@googlegroups.com Subject: Patch 8.0.1385 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1385 Problem: Python 3.5 is getting old. Solution: Make Python 3.6 the default. (Ken Takata, closes #2429) Files: runtime/doc/if_pyth.txt, src/INSTALLpc.txt, src/Make_cyg_ming.mak, src/Make_mvc.mak, src/bigvim.bat *** ../vim-8.0.1384/runtime/doc/if_pyth.txt 2017-11-09 19:56:00.853332902 +0100 --- runtime/doc/if_pyth.txt 2017-12-10 18:09:51.667761597 +0100 *************** *** 1,4 **** ! *if_pyth.txt* For Vim version 8.0. Last change: 2016 Sep 01 VIM REFERENCE MANUAL by Paul Moore --- 1,4 ---- ! *if_pyth.txt* For Vim version 8.0. Last change: 2017 Nov 09 VIM REFERENCE MANUAL by Paul Moore *************** *** 17,22 **** --- 17,23 ---- 9. Dynamic loading |python-dynamic| 10. Python 3 |python3| 11. Python X |python_x| + 12. Building with Python support |python-building| {Vi does not have any of these commands} *************** *** 174,181 **** :py tagList = vim.eval('taglist("eval_expr")') < The latter will return a python list of python dicts, for instance: ! [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ! 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] vim.bindeval(str) *python-bindeval* Like |python-eval|, but returns special objects described in --- 175,182 ---- :py tagList = vim.eval('taglist("eval_expr")') < The latter will return a python list of python dicts, for instance: ! [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~ ! 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~ vim.bindeval(str) *python-bindeval* Like |python-eval|, but returns special objects described in *************** *** 733,741 **** console window type "path" to see what directories are used. The 'pythondll' or 'pythonthreedll' option can be also used to specify the Python DLL. ! The name of the DLL must match the Python version Vim was compiled with. ! Currently the name is "python24.dll". That is for Python 2.4. To know for ! sure edit "gvim.exe" and search for "python\d*.dll\c". Unix ~ --- 734,744 ---- console window type "path" to see what directories are used. The 'pythondll' or 'pythonthreedll' option can be also used to specify the Python DLL. ! The name of the DLL should match the Python version Vim was compiled with. ! Currently the name for Python 2 is "python27.dll", that is for Python 2.7. ! That is the default value for 'pythondll'. For Python 3 it is python36.dll ! (Python 3.6). To know for sure edit "gvim.exe" and search for ! "python\d*.dll\c". Unix ~ *************** *** 819,825 **** 11. Python X *python_x* *pythonx* Because most python code can be written so that it works with python 2.6+ and ! python 3 the pyx* functions and commands have been writen. They work exactly the same as the Python 2 and 3 variants, but select the Python version using the 'pyxversion' setting. --- 822,828 ---- 11. Python X *python_x* *pythonx* Because most python code can be written so that it works with python 2.6+ and ! python 3 the pyx* functions and commands have been written. They work exactly the same as the Python 2 and 3 variants, but select the Python version using the 'pyxversion' setting. *************** *** 867,873 **** it is not available then Python 2. If 'pyxversion' is 2 or 3, it tests only Python 2 or 3 respectively. ! Note that for has('pythonx') to work it may try to dynamically load Python 3 or 2. This may have side effects, especially when Vim can only load one of the two. --- 870,876 ---- it is not available then Python 2. If 'pyxversion' is 2 or 3, it tests only Python 2 or 3 respectively. ! Note that for `has('pythonx')` to work it may try to dynamically load Python 3 or 2. This may have side effects, especially when Vim can only load one of the two. *************** *** 880,883 **** --- 883,908 ---- endif ============================================================================== + 12. Building with Python support *python-building* + + A few hints for building with Python 2 or 3 support. + + UNIX + + See src/Makefile for how to enable including the Python interface. + + On Ubuntu you will want to install these packages for Python 2: + python + python-dev + For Python 3: + python3 + python3-dev + For Python 3.6: + python3.6 + python3.6-dev + + If you have more than one version of Python 3, you need to link python3 to the + one you prefer, before running configure. + + ============================================================================== vim:tw=78:ts=8:ft=help:norl: *** ../vim-8.0.1384/src/INSTALLpc.txt 2017-11-05 16:04:36.472687126 +0100 --- src/INSTALLpc.txt 2017-12-10 18:09:51.667761597 +0100 *************** *** 438,455 **** ================================ For building with MSVC 2008 the "Windows Installer" from www.python.org ! works fine. Python 3.4 is recommended. When building, you need to set the following variables at least: ! PYTHON3: Where Python3 is installed. E.g. C:\Python34 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes. ! PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak ! PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34 8. Building with Racket or MzScheme support --- 438,468 ---- ================================ For building with MSVC 2008 the "Windows Installer" from www.python.org ! works fine. Python 3.6 is recommended. When building, you need to set the following variables at least: ! PYTHON3: Where Python3 is installed. E.g. C:\Python36 DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes. ! PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X. E.g. When using MSVC (as one line): nmake -f Make_mvc.mak ! PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 ! ! ! When using msys2 and link with Python3 bundled with msys2 (as one line): ! ! mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64 ! PYTHON3_HOME=c:/msys64/mingw64 ! PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m ! DYNAMIC_PYTHON3=yes ! PYTHON3_VER=36 ! DYNAMIC_PYTHON3_DLL=libpython3.6m.dll ! STATIC_STDCPLUS=yes ! ! (This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.) 8. Building with Racket or MzScheme support *************** *** 684,704 **** --- 697,729 ---- There is no need to build whole Ruby, just config.h is needed. If you use 32-bit MSVC 2015, the config.h is generated in the .ext\include\i386-mswin32_140 directory. + If you use 64-bit MSVC 2015, the config.h is generated in the + .ext\include\x64-mswin64_140 directory. 3) Install the generated config.h. + For 32-bit version: + xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0 + For 64-bit version: + + xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0 + Note that 2.4.0 is Ruby API version of Ruby 2.4.X. You may need to close the console and reopen it to pick up the new $PATH. 4) Build Vim. Note that you need to adjust some variables (as one line): + For 32-bit version: + nmake -f Make_mvc.mak RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt WINVER=0x501 + For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64. + If you set WINVER explicitly, it must be set to >=0x500, when building with Ruby 2.1 or later. (Default is 0x501.) When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt *************** *** 713,718 **** --- 738,744 ---- RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 WINVER=0x501 + For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64. If you set WINVER explicitly, it must be set to >=0x500, when building with Ruby 2.1 or later. (Default is 0x501.) *** ../vim-8.0.1384/src/Make_cyg_ming.mak 2017-11-18 22:13:04.757908578 +0100 --- src/Make_cyg_ming.mak 2017-12-10 18:09:51.671761574 +0100 *************** *** 316,329 **** # Python3 interface: # PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) ! # PYTHON3_VER=[Python3 version, eg 31, 32] (default is 35) ifdef PYTHON3 ifndef DYNAMIC_PYTHON3 DYNAMIC_PYTHON3=yes endif ifndef PYTHON3_VER ! PYTHON3_VER=35 endif ifndef DYNAMIC_PYTHON3_DLL DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll --- 316,329 ---- # Python3 interface: # PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak) # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) ! # PYTHON3_VER=[Python3 version, eg 31, 32] (default is 36) ifdef PYTHON3 ifndef DYNAMIC_PYTHON3 DYNAMIC_PYTHON3=yes endif ifndef PYTHON3_VER ! PYTHON3_VER=36 endif ifndef DYNAMIC_PYTHON3_DLL DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll *** ../vim-8.0.1384/src/Make_mvc.mak 2017-11-18 22:13:04.757908578 +0100 --- src/Make_mvc.mak 2017-12-10 18:09:51.671761574 +0100 *************** *** 67,73 **** # Python3 interface: # PYTHON3=[Path to Python3 directory] # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) ! # PYTHON3_VER=[Python3 version, eg 30, 31] (default is 35) # # Ruby interface: # RUBY=[Path to Ruby directory] --- 67,73 ---- # Python3 interface: # PYTHON3=[Path to Python3 directory] # DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically) ! # PYTHON3_VER=[Python3 version, eg 30, 31] (default is 36) # # Ruby interface: # RUBY=[Path to Ruby directory] *************** *** 906,912 **** # PYTHON3 interface !ifdef PYTHON3 !ifndef PYTHON3_VER ! PYTHON3_VER = 35 !endif !message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)" !if "$(DYNAMIC_PYTHON3)" == "yes" --- 906,912 ---- # PYTHON3 interface !ifdef PYTHON3 !ifndef PYTHON3_VER ! PYTHON3_VER = 36 !endif !message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)" !if "$(DYNAMIC_PYTHON3)" == "yes" *** ../vim-8.0.1384/src/bigvim.bat 2017-10-08 17:56:52.223266888 +0200 --- src/bigvim.bat 2017-12-10 18:08:42.956153691 +0100 *************** *** 1,5 **** :: command to build big Vim with OLE, Lua, Perl, Python, Racket, Ruby and Tcl SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\" SET TOOLDIR=E:\ ! %VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes --- 1,5 ---- :: command to build big Vim with OLE, Lua, Perl, Python, Racket, Ruby and Tcl SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\" SET TOOLDIR=E:\ ! %VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes *** ../vim-8.0.1384/src/version.c 2017-12-10 15:25:12.510523225 +0100 --- src/version.c 2017-12-10 18:10:21.047594147 +0100 *************** *** 773,774 **** --- 773,776 ---- { /* Add new patch number below this line */ + /**/ + 1385, /**/ -- From "know your smileys": :-D Big smile /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///