From 2d90087420068e18f6eeaa6d88c2c7bf568d3a3e Mon Sep 17 00:00:00 2001
From: Zooko O'Whielacronx <zooko@zooko.com>
Date: Fri, 5 Dec 2008 17:19:11 -0700
Subject: [PATCH] setup: we require pywin32 if building on Windows (plus some
 formatting and comment fixes)

---
 _auto_deps.py | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/_auto_deps.py b/_auto_deps.py
index e9966dfb..25b3add8 100644
--- a/_auto_deps.py
+++ b/_auto_deps.py
@@ -1,6 +1,6 @@
 install_requires=[
-    # we require 0.6c6 to build, but can handle older versions to run
-    "setuptools >= 0.6c6",
+    # we require 0.6c8 to build, but can handle older versions to run
+    "setuptools >= 0.6c7",
 
                   # pycryptopp < 0.5 had a bug which, using a Microsoft
                   # compiler, or using some versions of g++ while linking
@@ -19,8 +19,21 @@ install_requires=[
                   "foolscap[secure_connections] >= 0.3.1",
                   "Nevow >= 0.6.0",
                   ]
+import platform
+if platform.system() == "Windows":
+    # Twisted requires pywin32 if it is going to offer process management functionality, or if
+    # it is going to offer iocp reactor.  We currently require process management.  It would be
+    # better if Twisted would declare that it requires pywin32 if it is going to offer process
+    # management.  Then the specification and the evolution of Twisted's reliance on pywin32 can
+    # be confined to the Twisted setup data, and Tahoe can remain blissfully ignorant about such
+    # things as if a future version of Twisted requires a different version of pywin32, or if a
+    # future version of Twisted implements process management without using pywin32 at all,
+    # etc..  That is twisted ticket #3238 -- http://twistedmatrix.com/trac/ticket/3238 .  But
+    # until Twisted does that, Tahoe needs to be non-ignorant of the following requirement:
+    install_requires.append('pywin32')
+
 import sys
-if hasattr(sys, 'frozen'):
+if hasattr(sys, 'frozen'): # for py2exe
     install_requires=[]
 
 def require_auto_deps():
-- 
2.45.2