Skip to content

Fix #6957: Replace OS-specific bash commands with cross-platform inline Python - #211

Open
Kaynup wants to merge 1 commit into
explosion:v3from
Kaynup:fix-6957-cross-os
Open

Fix #6957: Replace OS-specific bash commands with cross-platform inline Python#211
Kaynup wants to merge 1 commit into
explosion:v3from
Kaynup:fix-6957-cross-os

Conversation

@Kaynup

@Kaynup Kaynup commented Aug 20, 2026

Copy link
Copy Markdown

Resolves explosion/spaCy#6957

Description

I have replaced the hardcoded OS-specific bash commands (mkdir -p and rm -rf) inside the project.yml files with cross-platform inline Python equivalents. This ensures Windows users to not to manually run utility scripts or edit the YAML themselves.

Following the guidance discussed in PR #69 and #73, my approach avoids creating external utility scripts (which add clutter) by instead using lightweight python -c commands.
To ensure this solution bypasses the string parsing errors encountered in PR #42, I verified the inline python commands natively.

# Testing directory creation `mkdir`
python -c "import os; os.makedirs('test_dir', exist_ok=True); print('Created test_dir')"
# Output: Created test_dir

# Testing `rm -rf`
python -c "import shutil, os; shutil.rmtree('test_dir', ignore_errors=True); print('deleted test_dir')"
# Output: deleted test_dir
  • Total commands replaced: 74 occurrences across 22 files.
  • I ensured the YAML syntax remains completely valid (fixing the parsing issues noted earlier in #6957).

(Note: This is my first open-source PR. Please let me know if I missed any repository conventions or if you'd like me to format anything differently.)

Types of change

  • Bug fix
  • Enhancement

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • I ran the update scripts in the .github folder, and all the configs and docs are up-to-date.

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.

Example projects not cross-OS

1 participant