feat: Update release workflow and manifest for improved dependency management and layer handling
This commit is contained in:
27
build.py
27
build.py
@@ -12,10 +12,10 @@ class Platform:
|
||||
blender_tag: str
|
||||
|
||||
|
||||
required_packages = ["SimpleITK==2.3.1",
|
||||
required_packages = ["SimpleITK==2.5.5",
|
||||
"pyometiff==1.0.0",
|
||||
"mrcfile==1.5.1",
|
||||
"h5py==3.11.0",
|
||||
"h5py==3.16.0",
|
||||
"transforms3d==0.4.2",
|
||||
"tifffile==2024.7.24",
|
||||
"matplotlib==3.10.7",
|
||||
@@ -42,7 +42,7 @@ def run_python(args: str):
|
||||
subprocess.run([python] + args.split(" "))
|
||||
|
||||
|
||||
def build_extension(platform: Platform, python_version="3.11") -> None:
|
||||
def build_extension(platform: Platform, python_version: str) -> None:
|
||||
wheel_dirpath = Path("./src/bioxelnodes/wheels")
|
||||
toml_filepath = Path("./src/bioxelnodes/blender_manifest.toml")
|
||||
scipy_ndimage_dirpath = Path("./scipy_ndimage", platform.blender_tag)
|
||||
@@ -52,26 +52,28 @@ def build_extension(platform: Platform, python_version="3.11") -> None:
|
||||
f"-m pip download {' '.join(required_packages)} --dest {wheel_dirpath.as_posix()} --only-binary=:all: --python-version={python_version} --platform={platform.pypi_suffix}"
|
||||
)
|
||||
|
||||
for f in wheel_dirpath.glob('*.whl'):
|
||||
for f in wheel_dirpath.glob("*.whl"):
|
||||
if any([package in f.name for package in packages_to_remove]):
|
||||
f.unlink(missing_ok=True)
|
||||
|
||||
elif platform.blender_tag == "macos-arm64" and \
|
||||
"lxml" in f.name and "universal2" in f.name:
|
||||
f.rename(Path(f.parent,
|
||||
f.name.replace("universal2", "arm64")))
|
||||
elif (
|
||||
platform.blender_tag == "macos-arm64"
|
||||
and "lxml" in f.name
|
||||
and "universal2" in f.name
|
||||
):
|
||||
f.rename(Path(f.parent, f.name.replace("universal2", "arm64")))
|
||||
|
||||
for ndimage_filepath in scipy_ndimage_dirpath.iterdir():
|
||||
to_filepath = Path("./src/bioxelnodes/bioxel/scipy", ndimage_filepath.name)
|
||||
shutil.copy(ndimage_filepath, to_filepath)
|
||||
|
||||
|
||||
# Load the TOML file
|
||||
with toml_filepath.open("r") as file:
|
||||
manifest = tomlkit.parse(file.read())
|
||||
|
||||
manifest["platforms"] = [platform.blender_tag]
|
||||
manifest["wheels"] = [f"./wheels/{f.name}"
|
||||
for f in wheel_dirpath.glob('*.whl')]
|
||||
manifest["wheels"] = [
|
||||
f"./wheels/{f.name}" for f in wheel_dirpath.glob("*.whl")]
|
||||
|
||||
# build.append('generated', generated)
|
||||
# manifest.append('build', build)
|
||||
@@ -84,8 +86,9 @@ def build_extension(platform: Platform, python_version="3.11") -> None:
|
||||
|
||||
def main():
|
||||
platform_name = sys.argv[1]
|
||||
python_version = sys.argv[2] or "3.11"
|
||||
platform = platforms[platform_name]
|
||||
build_extension(platform)
|
||||
build_extension(platform, python_version)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user