Skip to content

fix: Replace BSD sed with Python for cross-platform version injection#8

Merged
mogglemoss merged 1 commit intomasterfrom
fix/workflow-sed-compatibility
Feb 28, 2026
Merged

fix: Replace BSD sed with Python for cross-platform version injection#8
mogglemoss merged 1 commit intomasterfrom
fix/workflow-sed-compatibility

Conversation

@mogglemoss
Copy link
Owner

Summary

Replaces the OS-specific sed command with a cross-platform Python one-liner in the GitHub Actions workflow.

Context

The recent change to automatically inject version numbers into __init__.py during the build used sed -i . This syntax is specific to the BSD version of sed (default on macOS). However, the GitHub runners for Linux and Windows use GNU sed, which misinterpreted the empty quotes as a filename, resulting in a build crash (sed: can't read : No such file or directory).

Approach

Replaced the sed command with a simple Python string replacement one-liner. Since Python is already guaranteed to be installed and available in the environment, this ensures the version is injected reliably across macOS, Linux, and Windows without dealing with shell dialect inconsistencies.

The  command used to inject the version tag into  is specific to BSD/macOS and fails on GNU/Linux and Windows runners in GitHub Actions with 'sed: can't read : No such file or directory'.
Using Python string replacement ensures the version tag is correctly injected across all runner environments.
@mogglemoss mogglemoss merged commit bd32460 into master Feb 28, 2026
0 of 3 checks passed
@mogglemoss mogglemoss deleted the fix/workflow-sed-compatibility branch February 28, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant