Skip to content

Commit

Permalink
fixup building
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Jun 13, 2024
1 parent 927d1f9 commit efdba7c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ def download_whls(
toml_path = "molecularnodes/blender_manifest.toml"


def get_version(string):
str_match = r"\d+\.\d+.\d"
return re.search(str_match, string).group()


def update_toml_whls(platform: Platform):
# List all .whl files in the wheels/ subdirectory
wheel_files = glob.glob("./wheels/*.whl", root_dir="molecularnodes")
Expand All @@ -86,7 +91,9 @@ def update_toml_whls(platform: Platform):

# Update the wheels list
manifest["wheels"] = wheel_files
manifest["version"] = "{}-{}".format(manifest["version"], platform.metadata)
manifest["version"] = "{}-{}".format(
get_version(manifest["version"]), platform.metadata
)
manifest["platforms"] = [platform.metadata]

manifest_str = (
Expand All @@ -106,7 +113,7 @@ def reset_toml() -> None:
with open(toml_path, "r") as file:
manifest = tomlkit.parse(file.read())

manifest["version"] = manifest["version"].split("-")[0]
manifest["version"] = get_version(manifest["version"])
manifest["wheels"] = []
manifest["platforms"] = []

Expand All @@ -122,9 +129,10 @@ def zip_extension(platform: Platform) -> None:
# Get the version number, which would have the platform appended onto it
# for bundling for the blender extension platform and remove the platform to
# keep just the version number
version = re.search(r"\d+\.\d+\.\d+", manifest["version"]).group()

zip_file_name = f"molecularnodes-{version}-{platform.metadata}.zip"
zip_file_name = "molecularnodes-{}-{}.zip".format(
get_version(manifest["version"]), platform.metadata
)

# Create the zip file
with zipfile.ZipFile(zip_file_name, "w", zipfile.ZIP_DEFLATED) as zip_file:
Expand Down
2 changes: 1 addition & 1 deletion molecularnodes/blender_manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ schema_version = "1.0.0"
# Example of manifest file for a Blender extension
# Change the values according to your extension
id = "molecularnodes"
version = "4.2.0"
version = "4.2.1"
name = "Molecular Nodes"
tagline = "A toolbox for molecular import and animation in Blender"
maintainer = "Brady Johnston<brady.johnston@me.com>"
Expand Down

0 comments on commit efdba7c

Please sign in to comment.