Any tips to tell sprinter at PyCon about developing on Windows?
This year at PyCon, sprint coaches are giving tutorials up to three hours long the night before sprinting starts. Being the sprint coach on the core means that I get to be that person for the core. Here is to hoping people wait for me for dinner that night. Anyway, to make the tutorial as useful as possible I need to worry about Windows users. But being an OS X/UNIX user, I don't know how to help these people. =) As or right now I am going to point them to the readme.txt file in PCbuild for build instructions. But I don't know if there is any tips or tricks I should be pointing out to them in terms of developing on Python. I mean I assume they can use the build executable from their svn checkout and have it pick up changes they make to code in the checkout, right? I honestly don't know how different it is to develop on Windows than on UNIX. So any info that people can give me to cover would be helpful. -Brett
Brett Cannon wrote:
Anyway, to make the tutorial as useful as possible I need to worry about Windows users. But being an OS X/UNIX user, I don't know how to help these people. =) As or right now I am going to point them to the readme.txt file in PCbuild for build instructions. But I don't know if there is any tips or tricks I should be pointing out to them in terms of developing on Python. I mean I assume they can use the build executable from their svn checkout and have it pick up changes they make to code in the checkout, right? I honestly don't know how different it is to develop on Windows than on UNIX.
So any info that people can give me to cover would be helpful.
I can provide some guidance for the poor Windows souls. :] The VS 2008 Express Edition makes it easy to compile Python on Windows. There is no need to install any extra SDK packages, additional compilers or whatsoever. Windows users need: Visual Studio Express Edition (VS C++ 2008) http://www.microsoft.com/express/ Tortoise SVN (integrates into the explorer) http://tortoisesvn.net/ Putty for writable checkouts (I highly recommend to use the agent) http://www.chiark.greenend.org.uk/~sgtatham/putty/ Not required but very useful ---------------------------- Notepad++ to edit Python files http://notepad-plus.sourceforge.net/ Total Commander (best Norton Commander clone for Windows) http://ghisler.com/ SVN command line program http://subversion.tigris.org/project_packages.html Unix for Windows http://cygwin.com/ The PCbuild directory contains several helper bat files. The most important files are build_env.bat and rt.bat. Build_env.bat opens a command prompt and sets several env vars. rt.bat is a wrapper for the unit test suite. I normally use "rt -q" or "rt -q -v test_egg test_spam". build.bat must be run inside build_env command prompt. build_pgo won't work with the express edition. The Windows developers should checkout the sources in a directory without non ASCII chars and without spaces. I'm using the directory c:\dev\python\ as root for development on Windows. Checkout the trunk and py3k in the directory as well as the external dependencies. You don't need Perl for the ssl package but Express Edition users must compile BSDDB manually for Win32 Release|db_static and Win32 Debug|db_static. build_tkinter.py builds the Tkinter dependencies. I'm trying to hang out on IRC during PyCon so I might be able to assist with Windows questions. It would be really cool if you can recruit some experienced Windows developers. :] Christian
Christian Heimes wrote:
I can provide some guidance for the poor Windows souls. :] The VS 2008 Express Edition makes it easy to compile Python on Windows. There is no need to install any extra SDK packages, additional compilers or whatsoever.
[... snip loads of useful info ...]
The PCbuild directory contains several helper bat files. The most important files are build_env.bat and rt.bat. Build_env.bat opens a command prompt and sets several env vars.
Just a note for those using the Express Edition: the build.bat file which builds the Python project on the command line assumes that the name of the executable is devenv.exe. In fact, for "Visual Studio Express 2008 for C++" (or whatever it's called) the executable is vcexpress.exe. Basically, whatever .exe the Start Menu shortcut for Visual Studio Express points to, that's your filename. Change it in the build.bat file and Bob's Your Uncle! Thanks again to Christian for all the work he's put in to support VS 2008 (Express). TJG
Tim Golden wrote:
Christian Heimes wrote:
I can provide some guidance for the poor Windows souls. :] The VS 2008 Express Edition makes it easy to compile Python on Windows. There is no need to install any extra SDK packages, additional compilers or whatsoever.
[... snip loads of useful info ...]
The PCbuild directory contains several helper bat files. The most important files are build_env.bat and rt.bat. Build_env.bat opens a command prompt and sets several env vars.
Just a note for those using the Express Edition: the build.bat file which builds the Python project on the command line assumes that the name of the executable is devenv.exe. In fact, for "Visual Studio Express 2008 for C++" (or whatever it's called) the executable is vcexpress.exe. Basically, whatever .exe the Start Menu shortcut for Visual Studio Express points to, that's your filename. Change it in the build.bat file and Bob's Your Uncle!
Thanks again to Christian for all the work he's put in to support VS 2008 (Express).
Hear hear. It's good to see that the whole burden no longer falls on Tim and Martin. Does VS2008 (Express) coexist peacefully with VS2005, which I need to retain for certain client projects? regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/
Steve Holden wrote:
Does VS2008 (Express) coexist peacefully with VS2005, which I need to retain for certain client projects?
I've VS2005 and VS2008 (both professional) on my box. I haven't run into problems and they are living happily together. Christian
Does VS2008 (Express) coexist peacefully with VS2005, which I need to retain for certain client projects?
Depends on the installation order. For most purposes (executable files, include files, libraries, etc), they live in different file and registry spaces, so they coexist fine. The only issue is file name extensions: what happens if you double-click .sln. VS2008 comes with a version selector that checks the contents of the file before launching a specific visual studio, so if you install that second, it will still open old projects with VS 2005. VS2005 also shipped with a version selector; I'm unsure whether that tool would also support future versions (ie. vs2008), so its better to make sure the 2008 selector gets used. I don't know whether simultaneous installation of the express and full versions of VS 2008 is supported (but that was not your question). Regards, Martin
Tim Golden wrote:
Just a note for those using the Express Edition: the build.bat file which builds the Python project on the command line assumes that the name of the executable is devenv.exe. In fact, for "Visual Studio Express 2008 for C++" (or whatever it's called) the executable is vcexpress.exe. Basically, whatever .exe the Start Menu shortcut for Visual Studio Express points to, that's your filename. Change it in the build.bat file and Bob's Your Uncle!
Does the VS Express Edition have the "vcbuild" command? The build bots are using vcbuild instead of devenv. The professional edition has it. c:\dev\python\trunk\PCbuild>vcbuild /useenv pcbuild.sln "Release|Win32" Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022 Christian
Christian Heimes wrote:
Tim Golden wrote:
Just a note for those using the Express Edition: the build.bat file which builds the Python project on the command line assumes that the name of the executable is devenv.exe. In fact, for "Visual Studio Express 2008 for C++" (or whatever it's called) the executable is vcexpress.exe. Basically, whatever .exe the Start Menu shortcut for Visual Studio Express points to, that's your filename. Change it in the build.bat file and Bob's Your Uncle!
Does the VS Express Edition have the "vcbuild" command? The build bots are using vcbuild instead of devenv. The professional edition has it.
c:\dev\python\trunk\PCbuild>vcbuild /useenv pcbuild.sln "Release|Win32" Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022
It does (under vc\vcpackages). My development laptop's upstairs but I'll try out the command above when I get a chance later. While you're there, the HEAD version of Lib\distutils\command\build_ext.py still refers to pcbuild9 instead of pcbuild which is preventing extensions from finding python26.dll. It's a trivial fix so you could probably get it in faster than I can build and submit the patch. (I'll check later on and put a patch in if you haven't had a chance). Thanks TJG
Tim Golden wrote:
Christian Heimes wrote:
Does the VS Express Edition have the "vcbuild" command? The build bots are using vcbuild instead of devenv. The professional edition has it.
c:\dev\python\trunk\PCbuild>vcbuild /useenv pcbuild.sln "Release|Win32" Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022
To confirm: this works under VS 2008 Express. I updated my build.bat file to read: set cmd=vcbuild /useenv pcbuild.sln "%conf%|%platf%" and it worked a charm. Thanks, Christian. TJG
Tim Golden wrote:
Christian Heimes wrote:
Does the VS Express Edition have the "vcbuild" command? The build bots are using vcbuild instead of devenv. The professional edition has it.
c:\dev\python\trunk\PCbuild>vcbuild /useenv pcbuild.sln "Release|Win32" Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022
It does (under vc\vcpackages). My development laptop's upstairs but I'll try out the command above when I get a chance later. While you're there, the HEAD version of Lib\distutils\command\build_ext.py still refers to pcbuild9 instead of pcbuild which is preventing extensions from finding python26.dll. It's a trivial fix so you could probably get it in faster than I can build and submit the patch. (I'll check later on and put a patch in if you haven't had a chance).
OK. I've just picked up the svn update and it works ok. Only thing is that the /build parameter is now invalid (although ignored). The default seems to be equivalent to "/build" while you have to specify "/rebuild" if that's what you want. Works ok because vcbuild ignores "/build" and moves on. Thanks for the prompt response. TJG
On Feb 2, 2008 7:34 PM, Christian Heimes
Brett Cannon wrote:
Anyway, to make the tutorial as useful as possible I need to worry about Windows users. But being an OS X/UNIX user, I don't know how to help these people. =) As or right now I am going to point them to the readme.txt file in PCbuild for build instructions. But I don't know if there is any tips or tricks I should be pointing out to them in terms of developing on Python. I mean I assume they can use the build executable from their svn checkout and have it pick up changes they make to code in the checkout, right? I honestly don't know how different it is to develop on Windows than on UNIX.
So any info that people can give me to cover would be helpful.
I can provide some guidance for the poor Windows souls. :] The VS 2008 Express Edition makes it easy to compile Python on Windows. There is no need to install any extra SDK packages, additional compilers or whatsoever.
Windows users need:
Visual Studio Express Edition (VS C++ 2008) http://www.microsoft.com/express/
Tortoise SVN (integrates into the explorer) http://tortoisesvn.net/
Putty for writable checkouts (I highly recommend to use the agent) http://www.chiark.greenend.org.uk/~sgtatham/putty/
Not required but very useful ----------------------------
Notepad++ to edit Python files http://notepad-plus.sourceforge.net/
Total Commander (best Norton Commander clone for Windows) http://ghisler.com/
SVN command line program http://subversion.tigris.org/project_packages.html
Unix for Windows http://cygwin.com/
The PCbuild directory contains several helper bat files. The most important files are build_env.bat and rt.bat. Build_env.bat opens a command prompt and sets several env vars. rt.bat is a wrapper for the unit test suite. I normally use "rt -q" or "rt -q -v test_egg test_spam". build.bat must be run inside build_env command prompt. build_pgo won't work with the express edition.
PCbuild/readme.txt says that pressing F6 will also build everything fine. Is that true as well? And what is the best way to just launch an interpreter? Just double-click the built executable? I assume sys.path will still be set up properly to use the checkout.
The Windows developers should checkout the sources in a directory without non ASCII chars and without spaces. I'm using the directory c:\dev\python\ as root for development on Windows. Checkout the trunk and py3k in the directory as well as the external dependencies. You don't need Perl for the ssl package but Express Edition users must compile BSDDB manually for Win32 Release|db_static and Win32 Debug|db_static. build_tkinter.py builds the Tkinter dependencies.
I'm trying to hang out on IRC during PyCon so I might be able to assist with Windows questions.
Great! I am going to expect people to already know how to use svn aand have a compiler set up, just not necessarily started a compile yet. So I suspect most issues will just be best practices stuff.
It would be really cool if you can recruit some experienced Windows developers. :]
That's the point in all of this. =) -Brett
Brett Cannon wrote:
PCbuild/readme.txt says that pressing F6 will also build everything fine. Is that true as well?
And what is the best way to just launch an interpreter? Just double-click the built executable? I assume sys.path will still be set up properly to use the checkout.
Build solution is F7 now. It's often faster to select the pythoncore project and select build from the right click menu if the developer only modifies a core file. You can set up the python project as startup project. F5 launches the startup project in a debug environment. Double clicking on the exe works, too. sys.path is set up properly. Christian
On Feb 3, 2008 2:21 PM, Christian Heimes
Brett Cannon wrote:
PCbuild/readme.txt says that pressing F6 will also build everything fine. Is that true as well?
And what is the best way to just launch an interpreter? Just double-click the built executable? I assume sys.path will still be set up properly to use the checkout.
Build solution is F7 now. It's often faster to select the pythoncore project and select build from the right click menu if the developer only modifies a core file.
You can set up the python project as startup project. F5 launches the startup project in a debug environment. Double clicking on the exe works, too. sys.path is set up properly.
Great! Just let me know if/when the vcbuild change is made to the build.bat file and the Windows part of the slides are done. I will post them online as a PDF for people to look over. I will also try to make sure no matter their state to have them up before the next bug day (which is when?). -Brett
participants (5)
-
"Martin v. Löwis"
-
Brett Cannon
-
Christian Heimes
-
Steve Holden
-
Tim Golden