Issue2298

classification
Title: [windows] ubiquitous sys.platform=='win32' checks in setuptools
Type: Severity: critical
Components: Core Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: Each, zyasoft
Priority: urgent Keywords:

Created on 2015-03-26.18:44:43 by Each, last changed 2015-04-10.01:55:51 by zyasoft.

Messages
msg9712 (view) Author: Aleksei Kulakov (Each) Date: 2015-03-26.18:44:43
Because of this, for example,  setuptools from bundled ensurepipe module generates unix exec files in bin, instead of exe:
jython -m ensurepip
jython pip install yolk

result: 
bin\yolk file created instead of bin\yolk.exe

reason:
systemtools detects windows platform by checking sys.platform for 'win32', while jython sets it to 'java'.
I was able to fix this by adding (os.name == 'java' and os._name == 'nt') everywhere in setuptools sources.

It is huge dealbreaker for windows users who want to use others work
msg9713 (view) Author: Jim Baker (zyasoft) Date: 2015-03-26.21:36:53
I have tried this out, and it does not work per Aleksei's report:

#!C:\jythondev\jython27\dist\bin\jython.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'yolk==0.4.3','console_scripts','yolk'
__requires__ = 'yolk==0.4.3'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('yolk==0.4.3', 'console_scripts', 'yolk')()
    )

(It has to be a self executing zip archive to work on Windows.)

Nose, for example, does install correctly on Windows. Different code path presumably.

I have done some work here in the forked versions of pip used by Jython in https://github.com/jythontools/ If you have a patch you would like to contribute against setuptools, that would be useful and you post here.

Next step, we should create a fork of https://bitbucket.org/pypa/setuptools in https://github.com/jythontools/setuptools, which we will bundle as part of the ensurepip bundle; then we can apply, with the eventual goal of upstreaming. (This is very very slow, even for simple stuff.)
msg9716 (view) Author: Aleksei Kulakov (Each) Date: 2015-03-26.22:38:59
Ok, i will prepare PR on github today
msg9717 (view) Author: Jim Baker (zyasoft) Date: 2015-03-27.17:11:34
Aleksei, I have created a fork of setuptools at https://github.com/jythontools/setuptools, so please submit your PR there. Thanks!
msg9747 (view) Author: Jim Baker (zyasoft) Date: 2015-04-01.19:28:47
Fixed as of https://hg.python.org/jython/rev/cbb7baea2f3e
History
Date User Action Args
2015-04-10 01:55:51zyasoftsetstatus: pending -> closed
2015-04-01 19:28:47zyasoftsetstatus: open -> pending
assignee: zyasoft
resolution: accepted -> fixed
messages: + msg9747
2015-03-30 21:38:42zyasoftsettitle: [windows] ubiquitous sys.platform=='win32' checks in PyPI packages -> [windows] ubiquitous sys.platform=='win32' checks in setuptools
2015-03-27 17:11:35zyasoftsetmessages: + msg9717
2015-03-26 22:38:59Eachsetmessages: + msg9716
2015-03-26 21:36:53zyasoftsetpriority: urgent
resolution: accepted
messages: + msg9713
nosy: + zyasoft
2015-03-26 18:44:43Eachcreate