Overview
Some requirements must be met to build the "official" Win32 twisted. The official build produces two files with the following features:
- One of the builds is for python 2.5, the other is for python 2.4.
- There is a shortcut cut in the Start menu for the twisted command prompt which is a standard Windows Command Prompt with path and environment variables set up to invoke the twisted commands the same way you wowould on UNIX; e.g. "mktap ".
There are two ways to get twisted installed from source. One is to do the bare minimum necessary so that 'import Twisted' works; the other is the official method.
Bare minimum
This method is only necessary if you are trying to install twisted from e.g. The Subversion repository, and you don't want to acquire all things ls necessary to do the official build.
- Install either Python 2.4 or Python 2.5
- Install zopeinterface 3.3.0 or later for python
With msvc
Without cygwin installed, you need msvc installed for the cl.exe compiler, which is the default on Windows. Just issue the command: $ Python setup. py install
With mingw
The easiest way to build the extensions without msvc is to install mingw, for example using
Automated Installer. Then, create a distutils. cfg file in your distutils installation path (for example, c: \ python2.5 \ Lib \ distutils. cfg), and put the following content:
[build]compiler=mingw32
And then issue$ Python setup. py install. You can also pass-- Compiler = mingw32Option to the build command instead of using distutils. cfg.
With cygwin
With cygwin installed, you need to make sure these two packages are installed:
Once that's done, just issue the command:
python setup.py build --compiler=mingw32 install
If for some reason extensions won't build, try this instead:
python setup.py build_py build_scripts install --skip-build
Official
The official twisted is built with native Python 2.3 (latest), not thecygwin version of Python, however it is built with the help of cygwinpackages.
- Python 2.5 and Python 2.4
You need both.
Download and install it for both versions of Python.
This is what actually does the building.
Http://www.a-a-p.org/download.html
After installing it, make sure the file AAP. bat is in your system path, using (for example) the environment variable applet.
You need this little module:
Http://www.rutherfurd.net/python/winreg/
You will need cygwin, with the GCC-mingw package installed. Get cygwin:
Http://cygwin.com
Do not install cygwin python!
Do not install cygwin python!
(Install Native Windows python .)
This creates nice self-installers with uninstall functionality:
Http://www.jrsoftware.org/isinfo.php
You need version 4.0.8 or above. (5.0.8 or later preferred .)
You will need an existing installation of twisted, as the build script uses some utilities within twisted. The "bare minimum" Install described abve will suffice.
Bring up a cygwin prompt. Change directories to the root of your twisted source tree. It shoshould contain the directory "Win32/". Now run the following:
aap.bat -f win32/build.aap
The four distributable files will be in DIST/when this is done.
Troubleshooting
If you have trouble building the official build, try the following:
- Remove "C: \ winnt \ AAP. Bat" or "C: \ WINDOWS \ AAP. Bat" which will have incorrect contents.
- Make sure that your system path has des c: \ Program Files \ AAP \ Exec
- Make sure your cygwin. bash_profile isn' t clobbering this system path
- Make sure you don't have cygwin's Python package installed.
- Make sure both Python 2.5 and Python 2.4 are installed.
- If you're doing an official release, see maintainer-notes.txt.
Windows maintainer instructions
- Wait for an official release of some kind
- Download the twisted tarball for that release. Do not download subpackage tarbils, download only the full twisted release.
- Unpack this tarball.
- In the unpacked sumo directory, SVN Co SVN + SSH: // svn.twistedmatrix.com/svn/twisted/trunk/win32
- AAP-F Win32/build. AAP
- Rename twisted. PTH-> twisted. PTH _ SO twisted is not in the python path
- Install Dist/FIG * 2.4 *. exe \
- Run twisted Command Prompt
- Run mktap, twistd with no args. Observe no errors.
- Repeat steps 7, 8, 9 for Dist/twisted * 2.5 *. exe
- Rename twisted. PTH _-> twisted. PTH \
- Bug someone to give you g + W to/twisted/releases/twisted/2 .?
- Upload Dist/*. EXE to twistedmatrix.com:/twisted/releases/twisted/2 .?
- Make sure uploaded files are mode 664, group CVS-twisted
- Update the Wiki front page and
Twistedproject page with the new URLs.
- Repeat at step 1.