Skip to content

Commit

Permalink
Switch to version file for eventual muti-language targets
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed Oct 25, 2024
1 parent ca5bac6 commit 5920445
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.0
12 changes: 8 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,17 @@ def compile_wrappers():
def update_styxdefs_version():
import re
file_path = PATH_OUTPUT / "../../pyproject.toml"
new_version = styxdefs_compat()
styxdefs_version = styxdefs_compat()
with open("VERSION", 'r', encoding="utf-8") as file:
package_version = file.read().strip()
with open(file_path, 'r', encoding="utf-8") as file:
content = file.read()
pattern = r'(styxdefs\s*=\s*")[^"]+"'
updated_content = re.sub(pattern, f'\\1{new_version}"', content)
content = re.sub(pattern, f'\\g<1>{styxdefs_version}"', content)
pattern = r'(version\s*=\s*")[^"]+"'
content = re.sub(pattern, f'\\g<1>{package_version}"', content)
with open(file_path, 'w') as file:
file.write(updated_content)
file.write(content)


def update_python_metadata():
Expand Down Expand Up @@ -232,7 +236,7 @@ def update_readme():
assert PATH_DESCRIPTORS.exists() and PATH_PACKAGES.exists()

print("=== COMPILE WRAPPERS ===")
compile_wrappers()
#compile_wrappers()

print("=== UPDATE PYTHON METADATA ===")
update_python_metadata()
Expand Down

0 comments on commit 5920445

Please sign in to comment.