#2028 closed defect (fixed)

Twisted endpoints introduce a dependency on pywin32

Reported by: daira Owned by: daira
Priority: normal Milestone: 1.11.0
Component: packaging Version: 1.10.0
Keywords: pywin32 windows twisted usability regression review-needed openitp-packaging setuptools Cc:
Launchpad Bug:

Description (last modified by zooko)

In #1274 we managed to eliminate Tahoe's problematic dependency on pywin32, which significantly complicated building on Windows. However this dependency seems to have crept in again via Twisted's endpoints code:

On 10/07/13 18:44, Mike Nation wrote:
>      File "C:\tahoe\support\Lib\site-packages\twisted-12.3.0-py2.7-win-amd64.egg\twisted\internet\endpoints.py", line 25, in <module>
>     from twisted.internet import stdio
>      File "C:\tahoe\support\Lib\site-packages\twisted-12.3.0-py2.7-win-amd64.egg\twisted\internet\stdio.py", line 28, in <module>
>     from twisted.internet import _win32stdio
>      File "C:\tahoe\support\Lib\site-packages\twisted-12.3.0-py2.7-win-amd64.egg\twisted\internet\_win32stdio.py", line 7, in <module>
>     import win32api
>
> exceptions.ImportError: No module named win32api
>
> Failed to load application: No module named win32api

Note that we probably didn't detect this earlier because of #1334.

Change History (21)

comment:1 Changed at 2013-07-17T14:53:14Z by daira

  • Keywords twisted added

comment:2 Changed at 2013-07-17T14:59:24Z by daira

Workaround: manually install the pywin32 package from http://sourceforge.net/projects/pywin32/files/. Make sure to get the correct file for the version of Python you are using -- e.g. ending in "py2.7.exe" for Python v2.7. If using 64-bit Windows, the file should have "win-amd64" in its name.

comment:3 follow-up: Changed at 2014-02-20T22:19:06Z by daira

  • Keywords usability regression added
  • Owner set to daira
  • Status changed from new to assigned

Options:

  1. Update docs/quickstart.rst to point to downloads of pywin32 (and describe how to select the right one). We used to have this information; adding it back is a usability regression.
  2. Build eggs of pywin32 for 32-bit and 64-bit Python 2.7, and make sure they are used by a quickstart build. This may be hampered by #142.
  3. Submit a patch to Twisted to remove the hard dependency on pywin32. Update src/allmydata/_auto_deps.py to allow only versions of Twisted that don't have the hard dependency (either before endpoints, or after the fix), when running on Windows.
  4. Update src/allmydata/_auto_deps.py to allow only versions of Twisted that are before endpoints, when running on Windows.

comment:4 Changed at 2014-02-20T22:42:53Z by zooko

  • Description modified (diff)

comment:5 in reply to: ↑ 3 Changed at 2014-02-20T22:44:07Z by zooko

Let's do option 4 now, and then work on option 3.

comment:6 Changed at 2014-02-21T22:34:10Z by daira

  • Keywords review-needed added
  • Owner changed from daira to zooko
  • Status changed from assigned to new
Last edited at 2014-02-21T22:39:44Z by daira (previous) (diff)

comment:9 Changed at 2014-05-23T15:08:22Z by daira

  • Milestone changed from undecided to 1.11.0

comment:10 Changed at 2014-06-30T21:39:17Z by zooko

I think the dependency on pywin32 is part of, or even maybe most of, #1093 (win32 build hell).

comment:11 Changed at 2014-06-30T21:47:32Z by zooko

This interacts with https://github.com/twisted/nevow/issues/43 (why does Nevow depend on Twisted >= 13.0?).

comment:12 Changed at 2014-06-30T21:48:05Z by zooko

Last edited at 2014-06-30T21:48:22Z by zooko (previous) (diff)

comment:13 Changed at 2014-08-30T00:09:41Z by daira

The combination of this problem, #2193, and #2249, are making it almost impossible to install or build on Windows :-(

Last edited at 2014-08-30T00:10:33Z by daira (previous) (diff)

comment:14 Changed at 2014-09-02T17:43:17Z by daira

  • Owner changed from zooko to daira
  • Status changed from new to assigned

comment:15 Changed at 2014-09-07T17:10:46Z by daira

  • Keywords openitp-packaging added

comment:16 Changed at 2014-10-08T11:45:57Z by Daira Hopwood <daira@…>

In b0b76a7c5b89c3fed5a65ef6732dc45e578f12f4/trunk:

Improve comments in _auto_deps.py. refs #2249, #2028, #2193, #2005, #1258

Signed-off-by: Daira Hopwood <daira@…>

comment:17 Changed at 2014-10-08T11:53:06Z by daira

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed by [ec188d254cbb77204d1898d6a0dd8727e0f9bd6d/trunk], kind-of, but only by excluding Twisted >= 12.2.0 on Windows. We should revisit this if the upstream http://twistedmatrix.com/trac/ticket/6032 is fixed.

Last edited at 2015-05-05T20:54:35Z by daira (previous) (diff)

comment:18 Changed at 2015-10-29T00:44:14Z by daira

  • Resolution fixed deleted
  • Status changed from closed to reopened

Magic Folder requires Twisted >= 15.2.0, so we can no longer use the above workaround once that is landed.

http://twistedmatrix.com/trac/ticket/6032 shows no sign of progress. Note that the pypiwin32 package mentioned there is a wheel distribution, therefore not compatible with zetuptoolz.

comment:19 Changed at 2015-10-29T00:50:23Z by daira

  • Keywords setuptools added
  • Status changed from reopened to new

comment:20 Changed at 2015-10-29T00:53:35Z by daira

See also #2044 and #2077.

comment:21 Changed at 2016-03-26T23:05:07Z by warner

  • Milestone changed from 1.10.1 to 1.11.0
  • Resolution set to fixed
  • Status changed from new to closed

We are now ok with the dependency on pypiwin32, because we've switched to modern pip/setuptools/virtualenv, so the wheels work correctly.

Note: See TracTickets for help on using tickets.