Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

move zip logic out of make.py#1666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
stonebig merged 1 commit intowinpython:masterfromstonebig:master
Jul 6, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
19 changes: 13 additions & 6 deletionsgenerate_a_winpython_distro.bat
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,7 @@ call %my_buildenv%\scripts\env.bat

REM Create basic build infrastructure
echo "(%date% %time%) Create basic build infrastructure">>%my_archive_log%
python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', basedir_wpy=r'%my_WINPYDIRBASE%', verbose=True, flavor='%my_flavor%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', toolsdirs=r'%my_toolsdirs%', create_installer='False', python_target_release='%my_python_target_release%')">>%my_archive_log%
python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', basedir_wpy=r'%my_WINPYDIRBASE%', verbose=True, flavor='%my_flavor%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', toolsdirs=r'%my_toolsdirs%', create_installer='False')">>%my_archive_log%

REM Check infrastructure is in place
echo "(%date% %time%) Check infrastructure">>%my_archive_log%
Expand All@@ -70,7 +70,7 @@ set WINPYDIRBASE=%my_WINPYDIRBASE%
if not exist %my_WINPYDIRBASE%\scripts\env.bat (
@echo off
echo as %my_WINPYDIRBASE%\scripts\env.bat does not exist
echo please check and correct my_python_target_release=%my_python_target_release%
echo please check and correct:
echo my_arch=%my_arch%
echo my_python_target_release=%my_python_target_release%
echo my_release=%my_release%
Expand DownExpand Up@@ -206,12 +206,19 @@ call %my_WINPYDIRBASE%\scripts\env.bat

REM Generate changelog and binaries
echo "(%date% %time%) Generate changelog and binaries">>%my_archive_log%
set path=%my_original_path%
cd /D %~dp0
call %my_buildenv%\scripts\env.bat

python.exe -c "from make import *;make_all(%my_release%, '%my_release_level%', basedir_wpy=r'%my_WINPYDIRBASE%', verbose=True, flavor='%my_flavor%', install_options=r'%my_install_options%', find_links=r'%my_find_links%', source_dirs=r'%my_source_dirs%', create_installer='%my_create_installer%', rebuild=False, python_target_release='%my_python_target_release%')" >> %my_archive_log%
rem markdowm and markdown diff
set mdn=WinPython%my_flavor%-%my_arch%bit-%WINPYVER2%.md
%target_python_exe% -m wppm -md>%my_basedir%\bu%my_flavor%\%mdn%
copy/y %my_basedir%\bu%my_flavor%\%mdn% %~dp0changelogs\%mdn%

set out=WinPython%my_flavor%-%my_arch%bit-%WINPYVER2%_History.md
%target_python_exe% -c "from wppm import diff ;a=(diff.compare_package_indexes(r'%WINPYVER2%', searchdir=r'%~dp0changelogs',flavor=r'%my_flavor%',architecture=%my_arch%));f=open(r'%my_basedir%\bu%my_flavor%\%out%','w', encoding='utf-8');f.write(a);f.close()"
copy/y %my_basedir%\bu%my_flavor%\%out% %~dp0changelogs\%out%

rem compress
set stem=WinPython%my_arch%-%WINPYVER2%%my_flavor%
%target_python_exe% -c "from wppm import utils;utils.command_installer_7zip(r'%my_WINPYDIRBASE%', r'%my_WINPYDIRBASE%\..',r'%stem%', r'%my_create_installer%')"

echo -------------------------------------- >>%my_archive_log%
echo "(%date% %time%) END OF CREATION">>%my_archive_log%
Expand Down
21 changes: 0 additions & 21 deletionsmake.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -119,24 +119,6 @@ def architecture_bits(self) -> int:
"""Returns the architecture (32 or 64 bits) of the distribution."""
return self.distribution.architecture if self.distribution else 64

def create_installer_7zip(self, installer_type: str = "exe", compression= "mx5"):
"""Creates a WinPython installer using 7-Zip: "exe", "7z", "zip")"""
self._print_action(f"Creating WinPython installer ({installer_type})")
DISTDIR = self.winpython_directory
filename_stem = f"Winpython{self.architecture_bits}-{self.python_full_version}.{self.build_number}{self.flavor}{self.release_level}"
fullfilename = DISTDIR.parent / (filename_stem + "." + installer_type)
if installer_type not in ["exe", "7z", "zip"]:
return
sfx_option = "-sfx7z.sfx" if installer_type == "exe" else ""
zip_option = "-tzip" if installer_type == "zip" else ""
compress_level = "mx5" if compression == "" else compression
command = f'"{utils.find_7zip_executable()}" {zip_option} -{compress_level} a "{fullfilename}" "{DISTDIR}" {sfx_option}'
print(f'Executing 7-Zip script: "{command}"')
try:
subprocess.run(command, shell=True, check=True, stderr=sys.stderr, stdout=sys.stderr)
except subprocess.CalledProcessError as e:
print(f"Error executing 7-Zip script: {e}", file=sys.stderr)

def _print_action(self, text: str):
"""Prints an action message with progress indicator."""
if self.verbose:
Expand DownExpand Up@@ -254,9 +236,6 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,

builder.build(rebuild=rebuild, winpy_dir=winpy_dir)

for commmand in create_installer.lower().replace("7zip",".exe").split('.'):
installer_type, compression = (commmand + "-").split("-")[:2]
builder.create_installer_7zip(installer_type, compression)

if __name__ == "__main__":
# DO create only one Winpython distribution at a time
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp