8000 papercut without change · LeeXyan/winpython@ccd04f5 · GitHub
[go: up one dir, main page]

Skip to content

Commit ccd04f5

Browse files
committed
papercut without change
1 parent 5e168f5 commit ccd04f5

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed

make.py

Lines changed: 18 additions & 39 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
"""
99
WinPython build script
10-
1110
Created on Sun Aug 12 11:17:50 2012
1211
"""
1312

@@ -22,7 +21,6 @@
2221
from winpython import wppm, utils
2322
import diff
2423

25-
2624
CHANGELOGS_DIR = str(Path(__file__).parent / "changelogs")
2725
assert Path(CHANGELOGS_DIR).is_dir()
2826

@@ -645,17 +643,14 @@ def _create_batch_scripts_initial(self):
645643
646644
rem force default pyqt5 kit for Spyder if PyQt5 module is there
647645
if exist "%WINPYDIR%\Lib\site-packages\PyQt5\__init__.py" set QT_API=pyqt5
648-
649646
""",
650647
do_changes=changes,
651648
)
652649

653650
self.create_batch_script(
654651
"WinPython_PS_Prompt.ps1",
655652
r"""
656-
###############################
657653
### WinPython_PS_Prompt.ps1 ###
658-
###############################
659654
$0 = $myInvocation.MyCommand.Definition
660655
$dp0 = [System.IO.Path]::GetDirectoryName($0)
661656
# $env:PYTHONUTF8 = 1 would create issues in "movable" patching
@@ -682,7 +677,6 @@ def _create_batch_scripts_initial(self):
682677
$env:PYTHON = "%WINPYDIR%\python.exe"
683678
$env:PYTHONPATHz = "%WINPYDIR%;%WINPYDIR%\Lib;%WINPYDIR%\DLLs"
684679
685-
686680
$env:WINPYVER = '"""
687681
+ self.winpyver
688682
+ r"""'
@@ -701,7 +695,6 @@ def _create_batch_scripts_initial(self):
701695
if ($env:WINPYARCH.subString($env:WINPYARCH.length-5, 5) -eq 'amd64') {
702696
$env:WINPYARCH = 'WIN-AMD64' }
703697
704-
705698
if (-not $env:PATH.ToLower().Contains(";"+ $env:WINPYDIR.ToLower()+ ";")) {
706699
$env:PATH = """
707700
+ '"'
@@ -714,11 +707,10 @@ def _create_batch_scripts_initial(self):
714707
715708
# PyQt5 qt.conf creation and winpython.ini creation done via Winpythonini.py (called per env_for_icons.bat for now)
716709
# Start-Process -FilePath $env:PYTHON -ArgumentList ($env:WINPYDIRBASE + '\scripts\WinPythonIni.py')
717-
718710
}
719-
###############################
711+
720712
### Set-WindowSize
721-
###############################
713+
722714
Function Set-WindowSize {
723715
Param([int]$x=$host.ui.rawui.windowsize.width,
724716
[int]$y=$host.ui.rawui.windowsize.heigth,
@@ -735,7 +727,6 @@ def _create_batch_scripts_initial(self):
735727
### Colorize to distinguish
736728
$host.ui.RawUI.BackgroundColor = "Black"
737729
$host.ui.RawUI.ForegroundColor = "White"
738-
739730
""",
740731
do_changes=changes,
741732
)
@@ -805,7 +796,7 @@ def _create_batch_scripts_initial(self):
805796
self.create_batch_script(
806797
"WinPythonIni.py", # Replaces winpython.vbs, and a bit of env.bat
807798
r"""
808-
'prepares a dynamic list of variables settings from a .ini file'
799+
# Prepares a dynamic list of variables settings from a .ini file
809800
import os
810801
import subprocess
811802
from pathlib import Path
@@ -832,8 +823,6 @@ def _create_batch_scripts_initial(self):
832823
#JULIA=%JULIA_HOME%%JULIA_EXE%
833824
#JULIA_PKGDIR=%WINPYDIRBASE%\settings\.julia
834825
#QT_PLUGIN_PATH=%WINPYDIR%\Lib\site-packages\pyqt5_tools\Qt\plugins
835-
836-
837826
'''
838827
839828
def get_file(file_name):
@@ -1111,8 +1100,6 @@ def _create_batch_scripts(self):
11111100
"wpcp.bat",
11121101
r"""@echo off
11131102
call "%~dp0env_for_icons.bat"
1114-
rem cd/D "%WINPYWORKDIR1%"
1115-
rem "%WINPYDIR%\python.exe" -m winpython.controlpanel %*
11161103
if not "%WINPYWORKDIR%"=="%WINPYWORKDIR1%" cd/d %WINPYWORKDIR1%
11171104
cmd.exe /k "echo wppm & wppm"
11181105
""",
@@ -1154,7 +1141,6 @@ def _create_batch_scripts(self):
11541141
) else (
11551142
"code.exe" %*
11561143
))
1157-
11581144
""",
11591145
)
11601146

@@ -1250,12 +1236,12 @@ def make(
12501236
indent=True,
12511237
)
12521238

1253-
# PyPy: get Fullversion from the executable
1239+
# get Fullversion from the executable
12541240
self.python_fullversion = utils.get_python_long_version(
12551241
self.distribution.target
12561242
)
12571243

1258-
# PyPY: Assert that WinPython version and real python version do match
1244+
# Assert that WinPython version and real python version do match
12591245
self._print(
12601246
f"Python version{self.python_fullversion.replace('.','')}"
12611247
+ f"\nDistro Name {self.distribution.target}"
@@ -1268,13 +1254,10 @@ def make(
12681254

12691255
if remove_existing:
12701256
if not self.simulation:
1271-
# self._add_msvc_files() # replaced per msvc_runtime package
12721257
self._create_batch_scripts_initial()
12731258
self._create_batch_scripts()
1274-
# always create all launchers (as long as it is not shimmy-based, to see for after)
12751259
self._create_launchers()
1276-
# PyPY must ensure pip
1277-
# "pypy3.exe -m ensurepip"
1260+
# PyPy must ensure pip via: "pypy3.exe -m ensurepip"
12781261
utils.python_execmodule("ensurepip", self.distribution.target)
12791262

12801263
self.distribution.patch_standard_packages("pip")
@@ -1287,9 +1270,7 @@ def make(
12871270
self._print(f"piping {' '.join(actions)}")
12881271
self.distribution.do_pip_action(actions)
12891272
self.distribution.patch_standard_packages(req)
1290-
# no more directory base package install: use requirements.txt
1291-
# 2019-05-03 removed self._install_all_other_packages()
1292-
print("self.simulation zz", self.simulation)
1273+
print("self.simulation:", self.simulation)
12931274
if not self.simulation:
12941275
self._copy_dev_tools()
12951276
self._copy_dev_docs()
@@ -1313,8 +1294,7 @@ def make(
13131294
self._print_done()
13141295
# Writing package index
13151296
self._print("Writing package index")
1316-
# winpyver2 = need the version without build part
1317-
# but with self.distribution.architecture
1297+
# winpyver2 = the version without build part but with self.distribution.architecture
13181298
self.winpyver2 = f"{self.python_fullversion}.{self.build_number}"
13191299
fname = str(
13201300
Path(self.winpydir).parent
@@ -1344,17 +1324,16 @@ def make(
13441324
self._print_done()
13451325

13461326

1347-
def rebuild_winpython(basedir, targetdir, architecture=64, verbose=False):
1327+
def rebuild_winpython(codedir, targetdir, architecture=64, verbose=False):
13481328
"""Rebuild winpython package from source"""
1349-
basedir = basedir
1350-
packdir = targetdir
1351-
for name in os.listdir(packdir):
1329+
1330+
for name in os.listdir(targetdir):
13521331
if name.startswith("winpython-") and name.endswith((".exe", ".whl", ".gz")):
1353-
os.remove(str(Path(packdir) / name))
1332+
os.remove(str(Path(targetdir) / name))
13541333
# utils.build_wininst is replaced per flit 2023-02-27
13551334
utils.buildflit_wininst(
1356-
str(Path(__file__).resolve().parent),
1357-
copy_to=packdir,
1335+
codedir,
1336+
copy_to=targetdir,
13581337
verbose=verbose,
13591338
)
13601339

@@ -1420,7 +1399,7 @@ def make_all(
14201399

14211400
# Rebuild Winpython in this wheel dir
14221401
rebuild_winpython(
1423-
basedir=basedir,
1402+
codedir=str(Path(__file__).resolve().parent), # winpython source dir
14241403
targetdir=wheeldir,
14251404
architecture=architecture,
14261405
)
@@ -1490,11 +1469,11 @@ def make_all(
14901469
# ,find_links=osp.join(basedir, 'packages.srcreq'))
14911470
if str(create_installer).lower() != "false" and not simulation:
14921471
if "7zip" in str(create_installer).lower():
1493-
dist.create_installer_7zip(".exe") # 7-zip (no licence splash screen)
1472+
dist.create_installer_7zip(".exe")
14941473
if ".7z" in str(create_installer).lower():
1495-
dist.create_installer_7zip(".7z") # 7-zip (no licence splash screen)
1474+
dist.create_installer_7zip(".7z")
14961475
if ".zip" in str(create_installer).lower():
1497-
dist.create_installer_7zip(".zip") # 7-zip (no licence splash screen)
1476+
dist.create_installer_7zip(".zip")
14981477
return dist
14991478

15001479

0 commit comments

Comments
 (0)
0