Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions generate_a_winpython_distro.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rem generate_a_winpython_distro.bat: to be launched from a winpython directory,
@echo on

REM Initialize variables
if "%my_release_level%"=="" set my_release_level=b2
if "%my_release_level%"=="" set my_release_level=b3
if "%my_create_installer%"=="" set my_create_installer=True

rem Set archive directory and log file
Expand All @@ -26,8 +26,8 @@ if "%target_python_exe%"=="" set target_python_exe=python.exe

rem Set Python target release based on my_python_target
if %my_python_target%==311 set my_python_target_release=3119& set my_release=1
if %my_python_target%==312 set my_python_target_release=3129& set my_release=1
if %my_python_target%==313 set my_python_target_release=3132& set my_release=1
if %my_python_target%==312 set my_python_target_release=31210& set my_release=0
if %my_python_target%==313 set my_python_target_release=3133& set my_release=0
if %my_python_target%==314 set my_python_target_release=3140& set my_release=0

echo -------------------------------------- >>%my_archive_log%
Expand Down Expand Up @@ -99,6 +99,7 @@ echo -------------------------------------- >>%my_archive_log%
echo "(%date% %time%) Add requirement packages">>%my_archive_log%
echo -------------------------------------- >>%my_archive_log%
python -m pip install -r %my_requirements% -c %my_constraints% --pre --no-index --trusted-host=None --find-links=%my_find_links% >>%my_archive_log%
python -c "from winpython import wppm;dist=wppm.Distribution(r'%WINPYDIR%');dist.patch_standard_packages('spyder', to_movable=True)"

REM Archive success
echo -------------------------------------- >>%my_archive_log%
Expand Down
2 changes: 1 addition & 1 deletion winpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
OTHER DEALINGS IN THE SOFTWARE.
"""

__version__ = '15.1.20250405'
__version__ = '15.2.20250412'
__license__ = __doc__
__project_url__ = 'http://winpython.github.io/'
37 changes: 11 additions & 26 deletions winpython/wppm.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,14 @@ def patch_standard_packages(self, package_name="", to_movable=True):
"""patch Winpython packages in need"""
import filecmp

# Adpating to PyPy
if "pypy3" in Path(utils.get_python_executable(self.target)).name:
site_package_place = "\\site-packages\\"
else:
site_package_place = "\\Lib\\site-packages\\"
# 'pywin32' minimal post-install (pywin32_postinstall.py do too much)
if package_name.lower() == "pywin32" or package_name == "":
origin = self.target + site_package_place + "pywin32_system32"

destin = self.target
if Path(origin).is_dir():
origin = Path(self.target) / "site-packages" / "pywin32_system32"
destin = Path(self.target)
if origin.is_dir():
for name in os.listdir(origin):
here, there = (
str(Path(origin) / name),
str(Path(destin) / name),
)
if not Path(there).exists() or not filecmp.cmp(here, there):
here, there = (origin / name), (destin / name)
if not there.exists() or not filecmp.cmp(here, there):
shutil.copyfile(here, there)
# 'pip' to do movable launchers (around line 100) !!!!
# rational: https://github.com/pypa/pip/issues/2328
Expand All @@ -171,27 +162,21 @@ def patch_standard_packages(self, package_name="", to_movable=True):
sheb_mov1 = " executable = os.path.join(os.path.basename(get_executable()))"
sheb_mov2 = " executable = os.path.join('..',os.path.basename(get_executable()))"

# Adpating to PyPy
the_place = site_package_place + r"pip\_vendor\distlib\scripts.py"
the_place = Path(self.target ) / "lib" / "site-packages" / "pip" / "_vendor" / "distlib" / "scripts.py"
print(the_place)
if to_movable:
utils.patch_sourcefile(self.target + the_place, sheb_fix, sheb_mov1)
utils.patch_sourcefile(self.target + the_place, sheb_mov2, sheb_mov1)
utils.patch_sourcefile(the_place, sheb_fix, sheb_mov1)
utils.patch_sourcefile(the_place, sheb_mov2, sheb_mov1)
else:
utils.patch_sourcefile(self.target + the_place, sheb_mov1, sheb_fix)
utils.patch_sourcefile(self.target + the_place, sheb_mov2, sheb_fix)
utils.patch_sourcefile(the_place, sheb_mov1, sheb_fix)
utils.patch_sourcefile(the_place, sheb_mov2, sheb_fix)

# create movable launchers for previous package installations
self.patch_all_shebang(to_movable=to_movable)
if package_name.lower() == "spyder" or package_name == "":
# spyder don't goes on internet without I ask
utils.patch_sourcefile(
self.target + (site_package_place + r"spyderlib\config\main.py"),
"'check_updates_on_startup': True,",
"'check_updates_on_startup': False,",
)
utils.patch_sourcefile(
self.target + (site_package_place + r"spyder\config\main.py"),
Path(self.target) / "lib" / "site-packages" / "spyder" / "config" /"main.py",
"'check_updates_on_startup': True,",
"'check_updates_on_startup': False,",
)
Expand Down