From 91513f3141aa91f0b20734e2c5624bbd2b045b23 Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 29 Jun 2025 16:24:54 +0200 Subject: [PATCH 1/4] remove all docsdir reference --- generate_winpython_distros313_dot.bat | 3 +-- generate_winpython_distros313_slim.bat | 3 --- generate_winpython_distros313_wheel.bat | 5 ++--- make.py | 10 ++-------- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/generate_winpython_distros313_dot.bat b/generate_winpython_distros313_dot.bat index b0ed9351..a1290cd3 100644 --- a/generate_winpython_distros313_dot.bat +++ b/generate_winpython_distros313_dot.bat @@ -15,6 +15,7 @@ set my_release_level= rem list of installers to create separated per dot: False=none, .zip=zip, .7z=.7z, 7zip=auto-extractible 7z set my_create_installer=7zip.7z.zip +set my_create_installer=7zip.zip set my_preclear_build_directory=Yes @@ -25,11 +26,9 @@ set my_source_dirs=C:\Winp\bd313\packages.win-amd64 set my_find_links=C:\Winp\packages.srcreq set my_toolsdirs=C:\Winp\bdTools\Tools.dot -set my_docsdirs=C:\WinP\bdDocs\docs.dot set my_install_options=--no-index --pre --trusted-host=None call %~dp0\generate_a_winpython_distro.bat - pause \ No newline at end of file diff --git a/generate_winpython_distros313_slim.bat b/generate_winpython_distros313_slim.bat index 7b7a1ffc..e8829c58 100644 --- a/generate_winpython_distros313_slim.bat +++ b/generate_winpython_distros313_slim.bat @@ -30,11 +30,8 @@ set my_toolsdirs=C:\Winp\bdTools\Tools.dot REM 2024-07-13:put back pandoc (so from 598Mo to 518Mo?) set my_toolsdirs=C:\WinP\bdTools\tools64_pandoc_alone -set my_docsdirs=C:\WinP\bdDocs\docs.dot - set my_install_options=--no-index --pre --trusted-host=None call %~dp0\generate_a_winpython_distro.bat - pause \ No newline at end of file diff --git a/generate_winpython_distros313_wheel.bat b/generate_winpython_distros313_wheel.bat index 02edeb99..317d7774 100644 --- a/generate_winpython_distros313_wheel.bat +++ b/generate_winpython_distros313_wheel.bat @@ -15,8 +15,7 @@ set my_release_level= rem list of installers to create separated per dot: False=none, .zip=zip, .7z=.7z, 7zip=auto-extractible 7z set my_create_installer=7zip-mx5.7z-mx7.zip -set my_create_installer=.7z-mx7 - +set my_create_installer=.7z-mx9 set my_preclear_build_directory=Yes set tmp_reqdir=%my_root_dir_for_builds%\bd%my_python_target% @@ -26,12 +25,12 @@ set my_source_dirs=C:\Winp\bd313\packages.win-amd64 set my_find_links=C:\Winp\packages.srcreq set my_toolsdirs=C:\Winp\bdTools\Tools.dot -set my_docsdirs=C:\WinP\bdDocs\docs.dot set my_install_options=--no-index --pre --trusted-host=None rem set addlockfile=dot +set wheelhousereq=C:\Winp\bd313\dot_requirements.txt set wheelhousereq=C:\Winp\bd313\requirements64_whl.txt diff --git a/make.py b/make.py index 5781ad67..22ad0b37 100644 --- a/make.py +++ b/make.py @@ -58,7 +58,7 @@ class WinPythonDistributionBuilder: """Builds a WinPython distribution.""" def __init__(self, build_number: int, release_level: str, target_directory: Path, wheels_directory: Path, - tools_directories: list[Path] = None, documentation_directories: list[Path] = None, verbose: bool = False, + tools_directories: list[Path] = None, verbose: bool = False, base_directory: Path = None, install_options: list[str] = None, flavor: str = ""): """ Initializes the WinPythonDistributionBuilder. @@ -68,7 +68,6 @@ def __init__(self, build_number: int, release_level: str, target_directory: Path target_directory: The base directory where WinPython will be created. wheels_directory: Directory containing wheel files for packages. tools_directories: List of directories containing development tools to include. - documentation_directories: List of directories containing documentation to include. verbose: Enable verbose output. base_directory: Base directory for building (optional, for relative paths). install_options: Additional pip install options. @@ -79,7 +78,6 @@ def __init__(self, build_number: int, release_level: str, target_directory: Path self.target_directory = Path(target_directory) self.wheels_directory = Path(wheels_directory) self.tools_directories = tools_directories or [] - self.documentation_directories = documentation_directories or [] self.verbose = verbose self.winpython_directory: Path | None = None self.distribution: wppm.Distribution | None = None @@ -242,7 +240,7 @@ def rebuild_winpython_package(source_directory: Path, target_directory: Path, ar def make_all(build_number: int, release_level: str, pyver: str, architecture: int, basedir: Path, verbose: bool = False, rebuild: bool = True, create_installer: str = "True", install_options=["--no-index"], flavor: str = "", requirements: str | list[Path] = None, find_links: str | list[Path] = None, - source_dirs: Path = None, toolsdirs: str | list[Path] = None, docsdirs: str | list[Path] = None, + source_dirs: Path = None, toolsdirs: str | list[Path] = None, python_target_release: str = None, # e.g. "37101" for 3.7.10 ): """ @@ -262,14 +260,12 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in find_links: package directories (r'D:\Winpython\packages.srcreq') source_dirs: the python.zip + rebuilt winpython wheel package directory toolsdirs: Directory with development tools r'D:\WinPython\basedir34\t.Slim' - docsdirs: Directory with documentation r'D:\WinPython\basedir34\docs.Slim' python_target_release: Target Python release (str). """ assert basedir is not None, "The *basedir* directory must be specified" assert architecture in (32, 64) tools_dirs_list = parse_list_argument(toolsdirs, ",") - docs_dirs_list = parse_list_argument(docsdirs, ",") install_options_list = parse_list_argument(install_options, " ") find_links_dirs_list = parse_list_argument(find_links, ",") requirements_files_list = [Path(f) for f in parse_list_argument(requirements, ",") if f] @@ -285,7 +281,6 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in builder = WinPythonDistributionBuilder( build_number, release_level, build_directory, wheels_directory=source_dirs, tools_directories=[Path(d) for d in tools_dirs_list], - documentation_directories=[Path(d) for d in docs_dirs_list], verbose=verbose, base_directory=basedir, install_options=install_options_list + find_links_options, flavor=flavor @@ -321,5 +316,4 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in find_links=r"D:\Winpython\packages.srcreq", source_dirs=r"D:\WinPython\basedir34\packages.win-amd64", toolsdirs=r"D:\WinPython\basedir34\t.Slim", - docsdirs=r"D:\WinPython\basedir34\docs.Slim", ) From 2654b816427346a7fc85f23826c9daa5d0b63a90 Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 29 Jun 2025 16:42:31 +0200 Subject: [PATCH 2/4] update broken toolchain --- generate_a_winpython_distro.bat | 38 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/generate_a_winpython_distro.bat b/generate_a_winpython_distro.bat index cbb74682..474babc6 100644 --- a/generate_a_winpython_distro.bat +++ b/generate_a_winpython_distro.bat @@ -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=b4 +if "%my_release_level%"=="" set my_release_level= if "%my_create_installer%"=="" set my_create_installer=True rem Set archive directory and log file @@ -25,10 +25,10 @@ rem 2021-04-22 : path PyPy3 (as we don't try to copy PyPy3.exe to Python.exe) 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=31210& set my_release=1 -if %my_python_target%==313 set my_python_target_release=3133& set my_release=1 -if %my_python_target%==314 set my_python_target_release=3140& set my_release=0 +if %my_python_target%==311 set my_python_target_release=3119& set my_release=2 +if %my_python_target%==312 set my_python_target_release=31210& set my_release=2 +if %my_python_target%==313 set my_python_target_release=3135& set my_release=1 +if %my_python_target%==314 set my_python_target_release=3140& set my_release=1 echo -------------------------------------- >>%my_archive_log% echo (%date% %time%) preparing winPython for %my_pyver% (%my_python_target%)release %my_release%%my_flavor% (%my_release_level%) *** %my_arch% bit ***>>%my_archive_log% @@ -59,7 +59,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%', pyver='%my_pyver%', basedir=r'%my_basedir%', verbose=True, architecture=%my_arch%, 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%', docsdirs=r'%my_docsdirs%', 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%', pyver='%my_pyver%', basedir=r'%my_basedir%', verbose=True, architecture=%my_arch%, 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% REM Check infrastructure is in place echo "(%date% %time%) Check infrastructure">>%my_archive_log% @@ -99,7 +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)" +python -c "from wppm import wppm;dist=wppm.Distribution(r'%WINPYDIR%');dist.patch_standard_packages('spyder', to_movable=True)" REM Add Wheelhouse (to replace per pip lock direct ? would allow paralellism) echo -------------------------------------- >>%my_archive_log% @@ -125,13 +125,19 @@ set pip_lock_includedweb=%LOCKDIR%pylock.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOC set req_lock_includedlocal=%LOCKDIR%requirement.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_includedwheelslocal.txt set req_lock_includedweb=%LOCKDIR%requirement.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_includedwheels.txt +set pip_lock_includedlocal=%LOCKDIR%pylock.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_wheelslocal.toml +set pip_lock_includedweb=%LOCKDIR%pylock.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_wheels.toml +set req_lock_includedlocal=%LOCKDIR%requir.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_wheelslocal.txt +set req_lock_includedweb=%LOCKDIR%requir.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_wheels.txt + + if not "Z%wheelhousereq%Z"=="ZZ" if exist "%wheelhousereq%" ( echo JOYYYwheelhousereq=%wheelhousereq% echo z%pip_lock_includedlocal%z=%pip_lock_includedlocal% rem no winpython in it naturally, with deps python.exe -m pip lock --no-index --trusted-host=None --find-links=%my_find_links% -c C:\WinP\constraints.txt -r "%wheelhousereq%" -o %pip_lock_includedlocal% rem generating also classic requirement with hash-256, from obtained pylock.toml -python.exe -c "from winpython import wheelhouse as wh;wh.pylock_to_req(r'%pip_lock_includedlocal%', r'%req_lock_includedlocal%')" +python.exe -c "from wppm import wheelhouse as wh;wh.pylock_to_req(r'%pip_lock_includedlocal%', r'%req_lock_includedlocal%')" rem same with frozen web from local python.exe -m pip lock --no-deps --require-hashes -c C:\WinP\constraints.txt -r "%req_lock_includedlocal%" -o %pip_lock_includedweb% @@ -154,20 +160,17 @@ set LOCKDIR=%WINPYDIRBASE%\..\ set WINPYVERLOCK=%WINPYVER2:.=_% set req=%LOCKDIR%requirement.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_raw.txt set wanted_req=%LOCKDIR%requirement.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%.txt -set pip_lock_web=%LOCKDIR%pylock.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%.toml -set pip_lock_local=%LOCKDIR%pylock.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_local.toml -set req_lock_web=%LOCKDIR%requirement.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%.txt -set req_lock_local=%LOCKDIR%requirement.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_local.txt set pip_lock_web=%LOCKDIR%pylock.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%.toml set pip_lock_local=%LOCKDIR%pylock.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_local.toml -set req_lock_web=%LOCKDIR%requirement.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%.txt -set req_lock_local=%LOCKDIR%requirement.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_local.txt +set req_lock_web=%LOCKDIR%requir.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%.txt +set req_lock_local=%LOCKDIR%requir.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%_local.txt set my_archive_lockfile=%my_archive_dir%\pylock.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_%date:/=-%at_%my_time%.toml set my_archive_lockfile_local=%my_archive_dir%\pylock.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%_%date:/=-%at_%my_time%.local.toml -set my_changelog_lockfile=%~dp0changelogs\pylock.%my_flavor%-%WINPYARCH%bit-%WINPYVERLOCK%.toml +set my_changelog_lockfile=%~dp0changelogs\pylock.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%.toml +set my_changelog_reqfile=%~dp0changelogs\requir.%WINPYARCH%-%WINPYVERLOCK%%my_flavor%%my_release_level%.txt python.exe -m pip freeze>%req% findstr /v "winpython" %req% > %wanted_req% @@ -180,14 +183,15 @@ rem pip lock from local WheelHouse, from the frozen req python.exe -m pip lock --no-deps --no-index --trusted-host=None --find-links=C:\WinP\packages.srcreq -c C:\WinP\constraints.txt -r "%wanted_req%" -o %pip_lock_local% rem generating also classic requirement with hash-256, from obtained pylock.toml -python.exe -c "from winpython import wheelhouse as wh;wh.pylock_to_req(r'%pip_lock_web%', r'%req_lock_web%')" -python.exe -c "from winpython import wheelhouse as wh;wh.pylock_to_req(r'%pip_lock_local%', r'%req_lock_local%')" +python.exe -c "from wppm import wheelhouse as wh;wh.pylock_to_req(r'%pip_lock_web%', r'%req_lock_web%')" +python.exe -c "from wppm import wheelhouse as wh;wh.pylock_to_req(r'%pip_lock_local%', r'%req_lock_local%')" rem compare the two (result from pypi and local Wheelhouse must be equal) fc "%req_lock_web%" "%req_lock_local%" copy/Y %pip_lock_web% %my_archive_lockfile% copy/Y %pip_lock_web% %my_changelog_lockfile% +copy/Y %req_lock_web% %my_changelog_reqfile% REM Archive success From 7aa01fb338f4e22dbaf2e96d90b9f6d1c2e06734 Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 29 Jun 2025 16:52:47 +0200 Subject: [PATCH 3/4] clean-up make.py --- make.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/make.py b/make.py index 22ad0b37..12b5d149 100644 --- a/make.py +++ b/make.py @@ -230,13 +230,6 @@ def build(self, rebuild: bool = True, requirements_files_list=None, winpy_dirnam shutil.copyfile(output_markdown_filename, str(Path(CHANGELOGS_DIRECTORY) / Path(output_markdown_filename).name)) diff.write_changelog(self.winpyver2, None, CHANGELOGS_DIRECTORY, self.flavor, self.distribution.architecture, basedir=self.winpython_directory.parent) -def rebuild_winpython_package(source_directory: Path, target_directory: Path, architecture: int = 64, verbose: bool = False): - """Rebuilds the winpython or wppm package from source using flit.""" - for file in target_directory.glob("w*p*-*.*"): - if file.suffix in (".exe", ".whl", ".gz"): - file.unlink() - utils.buildflit_wininst(source_directory, copy_to=target_directory, verbose=True) - def make_all(build_number: int, release_level: str, pyver: str, architecture: int, basedir: Path, verbose: bool = False, rebuild: bool = True, create_installer: str = "True", install_options=["--no-index"], flavor: str = "", requirements: str | list[Path] = None, find_links: str | list[Path] = None, @@ -275,8 +268,6 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in if rebuild: utils.print_box(f"Making WinPython {architecture}bits at {Path(basedir) / ('bu' + flavor)}") os.makedirs(build_directory, exist_ok=True) - # use source_dirs as the directory to re-build Winpython wheel - winpython_source_dir = Path(__file__).resolve().parent builder = WinPythonDistributionBuilder( build_number, release_level, build_directory, wheels_directory=source_dirs, From d579fc060bb72889da4453fe3527069b8f92f82e Mon Sep 17 00:00:00 2001 From: stonebig Date: Sun, 29 Jun 2025 19:51:37 +0200 Subject: [PATCH 4/4] remove requirements handling in make.py --- make.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/make.py b/make.py index 12b5d149..e7b0fafb 100644 --- a/make.py +++ b/make.py @@ -182,7 +182,7 @@ def _create_initial_batch_scripts(self): with open(self.winpython_directory / "scripts" / "env.ini", "w") as f: f.writelines([f'{a}={b}\n' for a, b in init_variables]) - def build(self, rebuild: bool = True, requirements_files_list=None, winpy_dirname: str = None): + def build(self, rebuild: bool = True, winpy_dirname: str = None): """Make or finalise WinPython distribution in the target directory""" print(f"Building WinPython with Python archive: {self.python_zip_file.name}") if winpy_dirname is None: @@ -205,7 +205,6 @@ def build(self, rebuild: bool = True, requirements_files_list=None, winpy_dirnam self._create_initial_batch_scripts() utils.python_execmodule("ensurepip", self.distribution.target) self.distribution.patch_standard_packages("pip") - essential_packages = ["pip", "setuptools", "wheel", "wppm"] for package_name in essential_packages: actions = ["install", "--upgrade", "--pre", package_name] + self.install_options @@ -213,13 +212,6 @@ def build(self, rebuild: bool = True, requirements_files_list=None, winpy_dirnam self.distribution.do_pip_action(actions) self.distribution.patch_standard_packages(package_name) - if requirements_files_list: - for req in requirements_files_list: - actions = ["install", "-r", req] + (self.install_options or []) - self._print_action(f"Piping: {' '.join(actions)}") - self.distribution.do_pip_action(actions) - self.distribution.patch_standard_packages() - self._print_action("Writing package index") self.winpyver2 = f"{self.python_full_version}.{self.build_number}" output_markdown_filename = str(self.winpython_directory.parent / f"WinPython{self.flavor}-{self.distribution.architecture}bit-{self.winpyver2}.md") @@ -232,7 +224,7 @@ def build(self, rebuild: bool = True, requirements_files_list=None, winpy_dirnam def make_all(build_number: int, release_level: str, pyver: str, architecture: int, basedir: Path, verbose: bool = False, rebuild: bool = True, create_installer: str = "True", install_options=["--no-index"], - flavor: str = "", requirements: str | list[Path] = None, find_links: str | list[Path] = None, + flavor: str = "", find_links: str | list[Path] = None, source_dirs: Path = None, toolsdirs: str | list[Path] = None, python_target_release: str = None, # e.g. "37101" for 3.7.10 ): @@ -249,7 +241,6 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in create_installer: Type of installer to create (str). install_options: pip options (r'--no-index --pre --trusted-host=None') flavor: WinPython flavor (str). - requirements: package lists for pip (r'D:\requirements.txt') find_links: package directories (r'D:\Winpython\packages.srcreq') source_dirs: the python.zip + rebuilt winpython wheel package directory toolsdirs: Directory with development tools r'D:\WinPython\basedir34\t.Slim' @@ -261,7 +252,6 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in tools_dirs_list = parse_list_argument(toolsdirs, ",") install_options_list = parse_list_argument(install_options, " ") find_links_dirs_list = parse_list_argument(find_links, ",") - requirements_files_list = [Path(f) for f in parse_list_argument(requirements, ",") if f] find_links_options = [f"--find-links={link}" for link in find_links_dirs_list + [source_dirs]] build_directory = Path(basedir) / ("bu" + flavor) @@ -286,7 +276,7 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in else: winpython_dirname = f"WPy{architecture}-{pyver.replace('.', '')}{python_minor_version_str}{build_number}{release_level}" - builder.build(rebuild=rebuild, requirements_files_list=requirements_files_list, winpy_dirname=winpython_dirname) + builder.build(rebuild=rebuild, winpy_dirname=winpython_dirname) for commmand in create_installer.lower().replace("7zip",".exe").split('.'): installer_type, compression = (commmand + "-").split("-")[:2] @@ -302,7 +292,6 @@ def make_all(build_number: int, release_level: str, pyver: str, architecture: in verbose=True, architecture=64, flavor="Barebone", - requirements=r"D:\Winpython\basedir34\barebone_requirements.txt", install_options=r"--no-index --pre --trusted-host=None", find_links=r"D:\Winpython\packages.srcreq", source_dirs=r"D:\WinPython\basedir34\packages.win-amd64",