8000 remove no-more-used markdown property and rebuild flag by stonebig · Pull Request #1671 · winpython/winpython · GitHub
[go: up one dir, main page]

Skip to content

remove no-more-used markdown property and rebuild flag #1671

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2025
Merged
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
61 changes: 22 additions & 39 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

# Define constant paths for clarity
PORTABLE_DIRECTORY = Path(__file__).parent / "portable"
NODEJS_RELATIVE_PATH = "n" # Relative path within WinPython dir

# Ensure necessary directories exist at the start
assert PORTABLE_DIRECTORY.is_dir(), f"Portable directory not found: {PORTABLE_DIRECTORY}"
Expand Down Expand Up @@ -81,17 +80,6 @@ def _get_python_zip_file(self) -> Path:
return source_item
raise RuntimeError(f"Could not find Python zip package in {self.wheels_directory}")

@property
def package_index_markdown(self) -> str:
"""Generates a Markdown formatted package index page."""
return self.distribution.generate_package_index_markdown(
self.python_executable_directory,
self.winpyver2,
self.flavor,
self.architecture_bits,
self.release_level
)

@property
def winpython_version_name(self) -> str:
"""Returns the full WinPython version string."""
Expand Down Expand Up @@ -150,38 +138,36 @@ 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, winpy_dir: Path = None):
def build(self, winpy_dir: Path = None):
"""Make or finalise WinPython distribution in the target directory"""
print(f"Building WinPython with Python archive: {self.python_zip_file.name}")
if winpy_dir is None:
raise RuntimeError("WinPython base directory to create is undefined")
self.winpython_directory = winpy_dir

if rebuild:
self._print_action(f"Creating WinPython {self.winpython_directory} base directory")
if self.winpython_directory.is_dir():
shutil.rmtree(self.winpython_directory)
os.makedirs(self.winpython_directory, exist_ok=True)
# preventive re-Creation of settings directory
(self.winpython_directory / "settings" / "AppData" / "Roaming").mkdir(parents=True, exist_ok=True)
self._extract_python_archive()
self._print_action(f"Creating WinPython {self.winpython_directory} base directory")
if self.winpython_directory.is_dir():
shutil.rmtree(self.winpython_directory)
os.makedirs(self.winpython_directory, exist_ok=True)
# preventive re-Creation of settings directory
(self.winpython_directory / "settings" / "AppData" / "Roaming").mkdir(parents=True, exist_ok=True)
self._extract_python_archive()

self.distribution = wppm.Distribution(self.python_executable_directory, verbose=self.verbose)

if rebuild:
self._copy_essential_files()
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
self._print_action(f"Piping: {' '.join(actions)}")
self.distribution.do_pip_action(actions)
self.distribution.patch_standard_packages(package_name)
self._copy_essential_files()
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
self._print_action(f"Piping: {' '.join(actions)}")
self.distribution.do_pip_action(actions)
self.distribution.patch_standard_packages(package_name)

def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
verbose: bool = False, rebuild: bool = True, install_options=["--no-index"],
verbose: bool = False, install_options=["--no-index"],
flavor: str = "", find_links: str | list[Path] = None,
source_dirs: Path = None, toolsdirs: str | list[Path] = None,
):
Expand All @@ -192,7 +178,6 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
release_level: release level (e.g. 'beta1', '') [str]
basedir_wpy: top directory of the build (c:\...\Wpy...)
verbose: Enable verbose output (bool).
rebuild: Whether to rebuild the distribution (bool).
install_options: pip options (r'--no-index --pre --trusted-host=None')
flavor: WinPython flavor (str).
find_links: package directories (r'D:\Winpython\packages.srcreq')
Expand All @@ -207,18 +192,16 @@ def make_all(build_number: int, release_level: str, basedir_wpy: Path = None,
find_links_options = [f"--find-links={link}" for link in find_links_dirs_list + [source_dirs]]
winpy_dir = Path(basedir_wpy)

if rebuild:
utils.print_box(f"Making WinPython at {winpy_dir}")
os.makedirs(winpy_dir, exist_ok=True)

utils.print_box(f"Making WinPython at {winpy_dir}")
os.makedirs(winpy_dir, exist_ok=True)
builder = WinPythonDistributionBuilder(
build_number, release_level, winpy_dir.parent, wheels_directory=source_dirs,
tools_directories=[Path(d) for d in tools_dirs_list],
verbose=verbose,
install_options=install_options_list + find_links_options,
flavor=flavor
)
builder.build(rebuild=rebuild, winpy_dir=winpy_dir)
builder.build(winpy_dir=winpy_dir)


if __name__ == "__main__":
Expand Down
0