MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / archive_python_package

Function archive_python_package

win/build-all-win.py:96–110  ·  view source on GitHub ↗
(python_version: str, python_path: Path)

Source from the content-addressed store, hash-verified

94
95
96def archive_python_package(python_version: str, python_path: Path) -> None:
97 python_version_major_minor = "".join(python_version.split(".")[:2])
98 site_packages = python_path / "Lib" / "site-packages"
99 package_path = site_packages / "ifcopenshell"
100
101 # Clean cache.
102 for file in package_path.rglob("*.pyc"):
103 file.unlink()
104
105 zip_name = ZIP_TEMPLATE.format(package_name=f"ifcopenshell-python-{python_version_major_minor}")
106 with ZipFile(OUTPUT_DIR / zip_name, "w", compression=zipfile.ZIP_DEFLATED) as zipf:
107 for file in package_path.rglob("*"):
108 arcname = file.relative_to(site_packages)
109 zipf.write(file, arcname=arcname)
110 print(f"{package_path} -> {zip_name}")
111
112
113def archive_python_packages() -> None:

Callers 1

archive_python_packagesFunction · 0.85

Calls 6

printFunction · 0.85
splitMethod · 0.80
formatMethod · 0.80
joinMethod · 0.45
unlinkMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected