It would be great if pywin32 could be distributed as a binary wheel. This is the last remaining dependency of Twisted on Windows which requires manual intervention and installation.
This should be listed as a "Feature Request", rather than a "Bug".
I issued a 'Feature Request': https://sourceforge.net/p/pywin32/feature-requests/110/
Sorry, not packaging for python (bdist_wininst is NOT packaging for python) is a bug.
For what it's worth, python setup.py bdist_wheel almost works. I tweaked the .pth file to append the directories with the DLLs in it to os.environ["PATH"], and everything seems to work reasonably well.
python setup.py bdist_wheel
This would probably help solve https://tahoe-lafs.org/trac/tahoe-lafs/ticket/142
You can see my binary wheel here: https://glyph.im/pywin32/index/pywin32/index.html
I screwed up the version information (".glyph" is apparently not a valid version suffix) so pip has a little trouble with it, you have to identify it just right to install it, but it otherwise works reasonably well.
So is there any chance that pywin32 could be installed via pip one day? Problem is that .exe installers couldn't be installed from command line.
To be clear, there is almost no development work to do here; it is, at most, a one-line change. The issue is that someone with an interest in this problem needs to be granted access to the PyPI packages. I am "glyph" on PyPI and would gladly do the legwork necessary to upload binary wheels that would allow pip to install pywin32. If someone would grant me access to the project I could probably have it done in under a week.
If it is a matter of volunteers with compilers, count me in.
Since there has been no action on this for over six months, I have created a different distribution on PyPI:
You can "pip install pypiwin32" now into virtualenvs and the like, and that should work.
I know it's a "slippery slope" type of request, but any chance of Python 3.4 builds as well, Glyph?
It's also worth noting that (as far as I can tell) "wheel convert" on the pywin32 wininst exes works fine as well. So you don't even need a build environment.
I can give you upload credentials to the project on PyPI if that would be helpful.
Glyph - I'd be happy to wheel convert the existing wininst builds and upload them there. But I just tried to use "pip wheel" to build a Python 3.4 wheel from source, and it failed with errors I don't have time to diagnose. If wheel converted wheels are acceptable, though, I'll take up your offer, thanks.
What's your PyPI username?
Doh. Yeah, that would help - pf_moore.
Done. You should be able to upload wheels.
Thanks. Just looking further at the wheel you created for pypiwin32, I see that you have given it a name (in the metadata, as well as the project name) of pypiwin32. Presumably that means that it won't satisfy any dependencies on pywin32 specified in other projects. Was that intentional? I doubt it'll matter though as projects won't be specifying pywin32 as a dependency because of the fact that it's not on PyPI...
One reason I ask is that wheel convert doesn't allow changing the name, so it'll need some extra work to do that. But I'll sort that out and upload the Python 3 wheels.
OK, we have (minimally tested) Python 3.x wheels uploaded.
I would certainly have preferred to upload wheels as "pywin32" but a mismatch between what's on PyPI and what's in the wheel itself will break pip. I hope you didn't actually change the name of the wheels? The package still imports under the same name.
(If I could upload wheels to pywin32, i would have just done it and we wouldn't be having this conversation :))
What I did was "wheel convert pywin32*.exe" which gives wheels called pywin32-bla-blah.whl. I then put together a script that modified those wheels: (a) renamed them to pypiwin32, (b) modified the metadata files to change the project name to pypiwin32, (c) changed the dist-info directory name to pypiwin32.dist-info and (d) patched up the RECORD file to reflect the changes. I also patched the pth file as you did in your wheel (in the process I "accidentally" renamed the pth file to pypiwin32.pth, but that doesn't matter so I left it like that.
I can upload the script somewhere if it's useful to others. It's a bit of a quick hack but it does the job.
Huh. Where did you get the .exe's? I take it you didn't build them from the sdist I put on pyPI?
Uploading that script and pointing to it from the PyPI page would be helpful, just to facilitate if someone with greater interest wants to maintain it :).
It might also be interesting for me to make the other builds using "wheel convert" rather than my own hackery. However, without changes to the '.pth' files, the wheels won't actually work inside a virtualenv - did you test 'pip install' first? Ideally on a machine without a compiler?
I got the exes from here (the official pywin32 ones). I'll find somewhere to put the script and then link to it. Actually, I just made a gist for it - https://gist.github.com/pfmoore/fd09fff11b4fa5f8cb25
I thought I said above - I made the pth file changes in the script too.
For testing I installed in a clean virtualenv (I used pip -vvv to see the details and checked it was using the wheel and not compiling) and then just created a MessageBox. That should confirm the basic functionality. Stuff like COM might not work, because it needs stuff registered with the system, but I suspect that would be true of your build as well (it's what the postinstall script does, and wheel installs don't support postinstall scripts).
If you have a more comprehensive set of tests that your wheel passes, I'll happily run them on my builds.
Hmm, not sure I can add the script link to the PyPI page without putting it into the distribution metadata, which means editing the sources, which (in turn) means having to build from source. So never mind, I'll just leave the link here (above).
Log in to post a comment.