Skip to content

Commit daeea55

Browse files
committed
Merge pull request #54 from stonebig/master
Ipython3 icon, optional R and Julia launchers
2 parents 66ee6c8 + 613e100 commit daeea55

File tree

7 files changed

+31
-29
lines changed

7 files changed

+31
-29
lines changed

make.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ def _run_complement_batch_scripts(self):
918918
print('launch "%s" for "%s"' % (filepath, self.winpydir))
919919
try:
920920
retcode = subprocess.call('"%s" "%s"' % (filepath, self.winpydir),
921-
shell=True, stdout=sys.stderr)
921+
shell=True, stdout=sys.stderr)
922922
if retcode < 0:
923923
print("Child was terminated by signal", -retcode, file=sys.stderr)
924924
except OSError as e:
@@ -1045,7 +1045,7 @@ def make_winpython(build_number, release_level, architecture,
10451045
os.mkdir(builddir)
10461046

10471047
# Create 1 wheel directory to receive all packages whished for build
1048-
wheeldir = osp.join(builddir, 'wheels_tmp' + suffix)
1048+
wheeldir = osp.join(builddir, 'wheels_tmp' + suffix)
10491049
if osp.isdir(wheeldir):
10501050
shutil.rmtree(wheeldir, onerror=utils.onerror)
10511051
os.mkdir(wheeldir)
@@ -1054,7 +1054,7 @@ def make_winpython(build_number, release_level, architecture,
10541054
osp.join(basedir, 'packages.src'),
10551055
osp.join(basedir, flavor, 'packages' + suffix),
10561056
osp.join(basedir, flavor, 'packages.src')]
1057-
for m in list(set(source_dirs)):
1057+
for m in list(set(source_dirs)):
10581058
if osp.isdir(m):
10591059
src_files = os.listdir(m)
10601060
for file_name in src_files:
@@ -1090,9 +1090,9 @@ def make_winpython(build_number, release_level, architecture,
10901090
for flavor_docs in [docsdir3, docsdir4]:
10911091
if osp.isdir(flavor_docs):
10921092
docsdirs.append(flavor_docs)
1093-
1094-
install_options=['--no-index' , '--find-links=%s' % wheeldir]
1095-
1093+
1094+
install_options = ['--no-index', '--find-links=%s' % wheeldir]
1095+
10961096
dist = WinPythonDistribution(build_number, release_level,
10971097
builddir, wheeldir, toolsdirs,
10981098
verbose=verbose, simulation=simulation,

portable/icons/ijulia.ico

97.3 KB
Binary file not shown.

portable/icons/julia.ico

40.4 KB
Binary file not shown.

portable/icons/jupyter.ico

33.7 KB
Binary file not shown.

portable/icons/r.ico

1.37 KB
Binary file not shown.

winpython/utils.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ def get_env(name, current=True):
108108
break
109109

110110

111-
112111
def set_env(name, value, current=True):
113112
"""Set HKCU/HKLM environment variables"""
114113
root = winreg.HKEY_CURRENT_USER if current else winreg.HKEY_LOCAL_MACHINE
@@ -275,7 +274,7 @@ def get_python_infos(path):
275274

276275

277276
def get_python_long_version(path):
278-
"""Return long version (X.Y.Z) for the Python distribution located in
277+
"""Return long version (X.Y.Z) for the Python distribution located in
279278
*path*"""
280279
ver = python_query("import sys; print('%d.%d.%d' % "
281280
"(sys.version_info.major, sys.version_info.minor,"
@@ -284,6 +283,7 @@ def get_python_long_version(path):
284283
ver = None
285284
return ver
286285

286+
287287
# =============================================================================
288288
# Patch chebang line (courtesy of Christoph Gohlke)
289289
# =============================================================================
@@ -324,7 +324,7 @@ def patch_sourcefile(fname, in_text, out_text, silent_mode=False):
324324
new_content = content.replace(in_text, out_text)
325325
if not new_content == content:
326326
if not silent_mode:
327-
print("patching " , fname, "from", in_text, "to", out_text)
327+
print("patching ", fname, "from", in_text, "to", out_text)
328328
with io.open(fname, 'wt') as fh:
329329
fh.write(new_content)
330330

@@ -352,12 +352,13 @@ def extract_msi(fname, targetdir=None, verbose=False):
352352
args += ['/qn']
353353
args += ['TARGETDIR=%s' % targetdir]
354354
subprocess.call([extract]+args, cwd=osp.dirname(fname))
355-
print ('fname=%s' % fname)
356-
print ('TARGETDIR=%s' % targetdir)
355+
print('fname=%s' % fname)
356+
print('TARGETDIR=%s' % targetdir)
357357
# ensure pip if it's not 3.3
358358
if '-3.3' not in targetdir:
359-
subprocess.call([r'%s\%s' %(targetdir, 'python.exe'), '-m' , 'ensurepip'],
360-
cwd=osp.dirname(r'%s\%s' %(targetdir, 'pythons.exe')))
359+
subprocess.call(
360+
[r'%s\%s' % (targetdir, 'python.exe'), '-m', 'ensurepip'],
361+
cwd=osp.dirname(r'%s\%s' % (targetdir, 'pythons.exe')))
361362
# We patch ensurepip live (shame) !!!!
362363
# rational: https://github.com/pypa/pip/issues/2328
363364
import glob
@@ -442,7 +443,7 @@ def build_wininst(root, python_exe=None, copy_to=None,
442443
archstr = 'win32' if architecture == 32 else 'win-amd64'
443444
cmd += ['--plat-name=%s' % archstr]
444445
cmd += [installer]
445-
# root = a tmp dir in windows\tmp,
446+
# root = a tmp dir in windows\tmp,
446447
if verbose:
447448
subprocess.call(cmd, cwd=root)
448449
else:
@@ -468,13 +469,13 @@ def build_wininst(root, python_exe=None, copy_to=None,
468469
# for wheels (winpython here)
469470
match = re.match(SOURCE_PATTERN, distname)
470471
if match is not None:
471-
break
472+
break
472473
match = re.match(WHEELBIN_PATTERN, distname)
473474
if match is not None:
474475
break
475476
else:
476477
raise RuntimeError("Build failed: not a pure Python package? %s" %
477-
distdir)
478+
distdir)
478479
src_fname = osp.join(distdir, distname)
479480
if copy_to is None:
480481
return src_fname
@@ -507,7 +508,7 @@ def build_wheel(this_whl, python_exe=None, copy_to=None,
507508
assert osp.isfile(python_exe)
508509
myroot = os.path.dirname(python_exe)
509510

510-
#cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
511+
# cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
511512
cmd = [python_exe, '-m', 'pip', 'install']
512513
if install_options:
513514
cmd += install_options # typically ['--no-deps']
@@ -539,14 +540,14 @@ def do_script(this_script, python_exe=None, copy_to=None,
539540
assert osp.isfile(python_exe)
540541
myroot = os.path.dirname(python_exe)
541542

542-
#cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
543+
# cmd = [python_exe, myroot + r'\Scripts\pip-script.py', 'install']
543544
cmd = [python_exe]
544545
if install_options:
545546
cmd += install_options # typically ['--no-deps']
546547
print('script install_options', install_options)
547548
cmd += [this_script]
548-
# print('build_wheel', myroot, cmd)
549-
print("Executing " , cmd)
549+
# print('build_wheel', myroot, cmd)
550+
print("Executing ", cmd)
550551

551552
if verbose:
552553
subprocess.call(cmd, cwd=myroot)
@@ -559,7 +560,8 @@ def do_script(this_script, python_exe=None, copy_to=None,
559560
if verbose:
560561
print("Executed " % cmd)
561562
return 'ok'
562-
563+
564+
563565
def wheel_to_wininst(fname, python_exe=None,
564566
architecture=None, verbose=False, install_options=None):
565567
"""Just install a wheel !"""

winpython/wppm.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ def get_package_metadata(database, name):
3737
metadata = dict(description='', url='http://pypi.python.org/pypi/' + name)
3838
for key in metadata:
3939
name1 = name.lower()
40-
# wheel replace '-' per '_' in key
40+
# wheel replace '-' per '_' in key
4141
for name2 in (name1, name1.split('-')[0],
42-
'-'.join(name1.split('_'))):
42+
'-'.join(name1.split('_'))):
4343
try:
4444
metadata[key] = db.get(name2, key)
4545
break
@@ -233,7 +233,7 @@ def __init__(self, target, verbose=False, indent=False):
233233
self.init_log_dir()
234234
self.to_be_removed = [] # list of directories to be removed later
235235
self.version, self.architecture = utils.get_python_infos(target)
236-
236+
237237
def clean_up(self):
238238
"""Remove directories which couldn't be removed when building"""
239239
for path in self.to_be_removed:
@@ -242,7 +242,7 @@ def clean_up(self):
242242
except WindowsError:
243243
print("Directory %s could not be removed" % path,
244244
file=sys.stderr)
245-
245+
246246
def remove_directory(self, path):
247247
"""Try to remove directory -- on WindowsError, remove it later"""
248248
try:
@@ -371,20 +371,20 @@ 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")
378378
destin = self.target
379379
for name in os.listdir(origin):
380380
print("shutil.copy ", osp.join(origin, name), " ", osp.join(destin, name))
381-
shutil.copyfile(osp.join(origin, name), osp.join(destin, name))
381+
shutil.copyfile(osp.join(origin, name), osp.join(destin, name))
382382

383383
# We patch pip live (around line 100) !!!!
384384
# rational: https://github.com/pypa/pip/issues/2328
385385
if package.name == "get-pip":
386386
# self.exec_script
387-
my_script_is=osp.join(self.target, 'Scripts', 'get-pip.py')
387+
my_script_is = osp.join(self.target, 'Scripts', 'get-pip.py')
388388
self.install_script(my_script_is, install_options=None)
389389
if package.name == "pip" or package.name == "get-pip":
390390
import glob
@@ -527,7 +527,7 @@ def install_script(self, script, install_options=None):
527527
if not self.verbose:
528528
print("Failed!")
529529
raise
530-
530+
531531
def install_bdist_msi(self, package):
532532
"""Install a distutils package built with the bdist_msi option
533533
(binary distribution, .msi file)"""

0 commit comments

Comments
 (0)