Skip to content

Commit 67bdf83

Browse files
committed
Merge pull request #60 from stonebig/master
ensure easy_install.exe + pep8
2 parents 28cb577 + 9fa646d commit 67bdf83

File tree

3 files changed

+71
-52
lines changed

3 files changed

+71
-52
lines changed

make.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
#
3636
# go to https://github.com/numpy/numpy/wiki/Mingw-static-toolchain
3737
# for 32 bit, download mingw32static-2014-11.7z and unzip it
38-
# copy mingw32static-2014-11\mingw32static
38+
# copy mingw32static-2014-11\mingw32static
3939
# to %WINPYTHONBASEDIR%\tools.win32\mingw32
4040
# (so you have a %WINPYTHONBASEDIR%\tools.win32\mingw32\bin)
4141
# for 64 bit, download mingw64static-2014-11.7z and unzip it
42-
# copy mingw64static-2014-11\mingw32static
42+
# copy mingw64static-2014-11\mingw32static
4343
# to %WINPYTHONBASEDIR%\tools.win-amd64\mingw32
4444
# (so you have a %WINPYTHONBASEDIR%\tools.win-amd64\mingw32\bin)
4545

@@ -579,7 +579,7 @@ def _create_launchers(self):
579579
ipython_exe,
580580
args=' notebook --matplotlib=inline',
581581
workdir=r'${WINPYDIR}\..\notebooks')
582-
# --notebook-dir=%~dp0
582+
# --notebook-dir=%~dp0
583583
# workdir='${WINPYDIR}\Scripts')
584584
if osp.isfile(self.winpydir + self.THG_PATH):
585585
self.create_launcher('TortoiseHg.exe', 'tortoisehg.ico',
@@ -697,7 +697,7 @@ def _create_batch_scripts(self):
697697
echo --------------------
698698
rem (not working as of july 18th, 2014:
699699
rem https://github.com/JuliaLang/IJulia.jl/issues/206 )
700-
rem echo to enable use of julia from python (the first time):
700+
rem echo to enable use of julia from python (the first time):
701701
rem echo launch winpython command prompt
702702
rem echo cd ..\settings\.julia\v0.3\IJulia\python
703703
rem echo python setup.py install
@@ -721,15 +721,15 @@ def _create_batch_scripts(self):
721721
end If
722722
723723
Set colArgs = WScript.Arguments
724-
Add_or_removeLine colArgs(0), colArgs(1), colArgs(2)
724+
Add_or_removeLine colArgs(0), colArgs(1), colArgs(2)
725725
726726
function Add_or_removeLine(strFilename, strFind, strAction)
727727
Set inputFile = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFilename, 1)
728728
a_change = False
729729
Do Until inputFile.AtEndOfStream
730730
strLine = inputFile.ReadLine
731731
If InStr(strLine, strFind) = 0 Then
732-
result_text= result_text & strLine & vbNewLine
732+
result_text= result_text & strLine & vbNewLine
733733
else
734734
a_change = True
735735
if strAction <> "-remove" then result_text= result_text & strLine & vbNewLine & strAction & vbNewLine
@@ -741,7 +741,7 @@ def _create_batch_scripts(self):
741741
Set outputFile = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFilename,2,true)
742742
outputFile.Write result_text
743743
outputFile.Close
744-
end if
744+
end if
745745
end function
746746
""")
747747

@@ -776,21 +776,21 @@ def _create_batch_scripts(self):
776776
pause
777777
778778
rem Handle case when winpython.ini is not already created
779-
if exist "%WINPYDIR..%\settings\winpython.ini" goto ini_exists
779+
if exist "%WINPYDIR..%\settings\winpython.ini" goto ini_exists
780780
781781
echo [debug]>"%WINPYDIR..%\settings\winpython.ini"
782782
echo state = disabled>>"%WINPYDIR..%\settings\winpython.ini"
783783
echo [environment]>>"%WINPYDIR..%\settings\winpython.ini"
784784
785-
:ini_exists
785+
:ini_exists
786786
%~dp0Add_or_removeLine.vbs %WINPYDIR..%\settings\winpython.ini "R_HOME = " -remove
787787
%~dp0Add_or_removeLine.vbs %WINPYDIR..%\settings\winpython.ini "[environment]" "R_HOME = %R_HOME%"
788788
goto r_end
789789
790-
:r_bad
790+
:r_bad
791791
792792
echo directory "%WINPYDIR..%\tools\%tmp_Rdirectory%\bin" not found
793-
echo please install R at "%WINPYDIR..%\tools\%tmp_Rdirectory%"
793+
echo please install R at "%WINPYDIR..%\tools\%tmp_Rdirectory%"
794794
pause
795795
796796
:r_end
@@ -1155,33 +1155,33 @@ def make_all(build_number, release_level, pyver,
11551155
# DO create only what version at a time
11561156
# You may have to manually delete previous build\winpython-.. directory
11571157

1158-
#make_all(1, '', pyver='3.4', rootdir=r'D:\Winpython',
1159-
# verbose=False, archis=(32, ))
1160-
#make_all(1, '', pyver='3.4', rootdir=r'D:\Winpython',
1158+
make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
1159+
verbose=False, archis=(32, ))
1160+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11611161
# verbose=False, archis=(64, ), flavor='')
1162-
#make_all(6, '', pyver='3.3', rootdir=r'D:\Winpython',
1162+
#make_all(7, '', pyver='3.3', rootdir=r'D:\Winpython',
11631163
# verbose=False, archis=(32, ))
1164-
#make_all(6, '', pyver='3.3', rootdir=r'D:\Winpython',
1164+
#make_all(7, '', pyver='3.3', rootdir=r'D:\Winpython',
11651165
# verbose=False, archis=(64, ))
1166-
#make_all(3, '', pyver='2.7', rootdir=r'D:\Winpython',
1166+
#make_all(4, '', pyver='2.7', rootdir=r'D:\Winpython',
11671167
# verbose=False, archis=(32, ))
1168-
#make_all(3, '', pyver='2.7', rootdir=r'D:\Winpython',
1168+
#make_all(4, '', pyver='2.7', rootdir=r'D:\Winpython',
11691169
# verbose=False, archis=(64, ))
1170-
#make_all(3, '', pyver='2.7', rootdir=r'D:\Winpython',
1170+
#make_all(4, '', pyver='2.7', rootdir=r'D:\Winpython',
11711171
# verbose=False, archis=(64, ), flavor='FlavorRfull')
1172-
#make_all(1, '', pyver='3.4', rootdir=r'D:\Winpython',
1172+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11731173
# verbose=False, archis=(64, ), flavor='FlavorIgraph')
1174-
#make_all(1, '', pyver='3.4', rootdir=r'D:\Winpython',
1174+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11751175
# verbose=False, archis=(32, ), flavor='FlavorKivy')
1176-
#make_all(15, '', pyver='3.4', rootdir=r'D:\Winpython',
1176+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11771177
# verbose=False, archis=(32, ), flavor='FlavorRfull')
1178-
#make_all(15, '', pyver='3.4', rootdir=r'D:\Winpython',
1178+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11791179
# verbose=False, archis=(64, ), flavor='FlavorRfull')
1180-
# make_all(1, '', pyver='3.4', rootdir=r'D:\Winpython',
1180+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11811181
# verbose=False, archis=(32, ), flavor='FlavorJulia')
11821182
#make_all(3, '', pyver='2.7', rootdir=r'D:\Winpython',
11831183
# verbose=False, archis=(32, ), flavor='FlavorJulia')
1184-
make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
1185-
verbose=False, archis=(64, ), flavor='FlavorJulia')
1186-
#make_all(1, '', pyver='3.4', rootdir=r'D:\Winpython',
1184+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
1185+
# verbose=False, archis=(64, ), flavor='FlavorJulia')
1186+
#make_all(2, '', pyver='3.4', rootdir=r'D:\Winpython',
11871187
# verbose=False, archis=(32, ), flavor='FlavorRJulia')

winpython/data/packages.ini

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ description=Rebuild a new abstract syntax tree from Python's ast (required for p
44
[astroml]
55
description=tools for machine learning and data mining in Astronomy
66
7+
[backports.ssl_match_hostname]
8+
description=The ssl.match_hostname() function from Python 3.4
9+
710
[baresql]
811
description=playing SQL directly on Python datas
912
@@ -257,6 +260,9 @@ description=Python-PostgreSQL Database Adapter
257260
[pulp]
258261
description=PuLP is an LP modeler written in python. PuLP can generate MPS or LP files and call GLPK, COIN CLP/CBC, CPLEX, and GUROBI to solve linear problems
259262

263+
[pybars3]
264+
description=Handlebars.js templating for Python 3 and 2
265+
260266
[pydicom]
261267
description=Pure python package for working with DICOM files (medical imaging)
262268
url=http://code.google.com/p/pydicom
@@ -292,16 +298,30 @@ category=dataproc
292298
[PyHive]
293299
description=PyHive is a collection of Python DB-API and SQLAlchemy interfaces for Presto and Hive.
294300

295-
[pyparsing]
296-
description=A Python Parsing Module
297-
url=http://pyparsing.wikispaces.com/
301+
[pylearn2]
302+
description=A Machine Learning library based on Theano
303+
304+
[pylint]
305+
description=Logilab code analysis module: analyzes Python source code looking for bugs and signs of poor quality
306+
url=http://www.logilab.org/project/pylint
298307
category=util
299308

309+
[PyMeta3]
310+
description=Pattern-matching language based on OMeta for Python 3 and 2
311+
312+
[pyodbc]
313+
description=DB API Module for ODBC
314+
300315
[pyopengl]
301316
description=Cross platform Python binding to OpenGL and related APIs
302317
url=http://pyopengl.sourceforge.net
303318
category=visu3d
304319

320+
[pyparsing]
321+
description=A Python Parsing Module
322+
url=http://pyparsing.wikispaces.com/
323+
category=util
324+
305325
[pyqt]
306326
description=Cross-platform Application Framework: GUI, widgets, SQL, OpenGL, XML, Unicode...
307327
url=http://www.riverbankcomputing.co.uk/software/pyqt/intro
@@ -328,14 +348,6 @@ description=2D plotting library (set of Python bindings for the Qwt library feat
328348
url=http://pyqwt.sourceforge.net
329349
category=plot
330350

331-
[pylint]
332-
description=Logilab code analysis module: analyzes Python source code looking for bugs and signs of poor quality
333-
url=http://www.logilab.org/project/pylint
334-
category=util
335-
336-
[pyodbc]
337-
description=DB API Module for ODBC
338-
339351
[pyreadline]
340352
description=IPython needs this module to display color text in Windows command window
341353
url=http://ipython.org/pyreadline.html
@@ -499,6 +511,9 @@ category=scientific
499511
[terminado]
500512
description=Terminals served to term.js using Tornado websockets
501513

514+
[theano]
515+
description=Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs.
516+
502517
[tornado]
503518
description=Scalable, non-blocking web server and tools (required for IPython notebook)
504519

@@ -536,6 +551,9 @@ description=A built-package format for Python.
536551
description=WinPython distribution tools, including WPPM (package manager)
537552
url=http://winpython.github.io/
538553

554+
[wsgiref]
555+
description=WSGI (PEP 333) Reference Library
556+
539557
[xlrd]
540558
description=Extract data from Microsoft Excel spreadsheet files
541559
category=dataproc

winpython/wppm.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def install(self, package, install_options=None):
371371
package.save_log(self.logdir)
372372
if tmp_fname is not None:
373373
os.remove(tmp_fname)
374-
374+
375375
# We minimal post-install pywin (pywin32_postinstall.py do too much)
376376
if package.name == "pywin32":
377377
origin = self.target + (r"\Lib\site-packages\pywin32_system32")
@@ -386,22 +386,23 @@ def install(self, package, install_options=None):
386386
# self.exec_script
387387
my_script_is = osp.join(self.target, 'Scripts', 'get-pip.py')
388388
self.install_script(my_script_is, install_options=None)
389-
# change of method 2014-05-08:
389+
# change of method 2014-05-08:
390390
# touching pip at installation seems not working anymore
391391
# so brute force method is applied
392-
if package.name == "pip" or package.name == "get-pip" or 1==1:
392+
if package.name == "pip" or package.name == "get-pip" or 1 == 1:
393393
import glob
394394
for ffname in glob.glob(r'%s\Scripts\*.exe' % self.target):
395395
utils.patch_shebang_line(ffname)
396-
# ensure pip.exe
397-
if (not osp.exists(r'%s\Scripts\pip.exe' % self.target) and
398-
osp.exists(r'%s\Scripts\pip3.exe' % self.target)):
399-
shutil.copyfile(r'%s\Scripts\pip3.exe' % self.target,
400-
r'%s\Scripts\pip.exe' % self.target)
401-
if (not osp.exists(r'%s\Scripts\pip.exe' % self.target) and
402-
osp.exists(r'%s\Scripts\pip2.exe' % self.target)):
403-
shutil.copyfile(r'%s\Scripts\pip2.exe' % self.target,
404-
r'%s\Scripts\pip.exe' % self.target)
396+
# ensure pip.exe and easy_install.exe
397+
problems = [('pip', 'pip'), ('easy_install', 'easy_install-')]
398+
solutions = [('%s.%s' % sys.version_info[:2]),
399+
('%s' % sys.version_info[0])]
400+
for p in problems:
401+
problem = r'%s\Scripts\%s.exe' % (self.target, p[0])
402+
for s in solutions:
403+
solution = r'%s\Scripts\%s%s.exe' % (self.target, p[1], s)
404+
if not osp.exists(problem) and osp.exists(solution):
405+
shutil.copyfile(solution, problem)
405406

406407
if package.name == "pip" or package.name == "get-pip":
407408
utils.patch_sourcefile(
@@ -413,9 +414,9 @@ def install(self, package, install_options=None):
413414
if package.name == "ipython":
414415
utils.patch_sourcefile(
415416
self.target + r"\Lib\site-packages\IPython\kernel\kernelspec.py",
416-
r" kernel_dict = json.load(f)",
417+
r" kernel_dict = json.load(f)",
417418
r" kernel_dict = json.loads(('\n'.join(f.readlines())).replace('[WINPYDIR]',(os.environ['WINPYDIR']).replace('\\','\\\\')))"+
418-
";" + "from winpython.utils import patch_julia03; patch_julia03()")
419+
";" + "from winpython.utils import patch_julia03; patch_julia03()")
419420

420421
def handle_specific_packages(self, package):
421422
"""Packages requiring additional configuration"""

0 commit comments

Comments
 (0)