Skip to content

[WP-724] Fix python-redline plugin for linux and MacOS #2

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
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions build_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def main():
print("Building for Windows...")
run_command('dotnet publish ./csproj -c Release -r win-x64 --self-contained')

# Build for macOS
print("Building for macOS...")
run_command('dotnet publish ./csproj -c Release -r osx-x64 --self-contained')

# Compress the Linux build
linux_build_dir = './csproj/bin/Release/net8.0/linux-x64'
compress_files(linux_build_dir, f"./dist/linux-x64-{version}.tar.gz")
Expand All @@ -60,6 +64,10 @@ def main():
windows_build_dir = './csproj/bin/Release/net8.0/win-x64'
compress_files(windows_build_dir, f"./dist/win-x64-{version}.zip")

# Compress the macOS build
macos_build_dir = './csproj/bin/Release/net8.0/osx-x64'
compress_files(macos_build_dir, f"./dist/osx-x64-{version}.tar.gz")

print("Build and compression complete.")


Expand Down
Binary file modified dist/linux-x64-0.0.1.tar.gz
Binary file not shown.
Binary file added dist/osx-x64-0.0.1.tar.gz
Binary file not shown.
Binary file modified dist/win-x64-0.0.1.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions src/python_redlines/engines.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ def _unzip_binary(self):
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(target_path)

elif os_name == 'darwin':
zip_name = f"osx-{arch}-{__version__}.tar.gz"
binary_name = 'osx-x64/redlines'
zip_path = os.path.join(binaries_path, zip_name)
if not os.path.exists(zip_path):
with tarfile.open(zip_path, 'r:gz') as tar_ref:
tar_ref.extractall(target_path)

else:
raise EnvironmentError("Unsupported OS")

Expand Down