-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Currently we heavily rely on bash in our tox.ini:
-
cover.sh(Removing cover.sh and folding into tox config. #1237) -
custom_pip_install.sh(Removing use of wheelhouse and relying on Travis caching. #1350) -
merge.sh(Removing merge.sh. #1364Only run from).travis.yml, no longer needed after Removing use of wheelhouse and relying on Travis caching. #1350 is in sincemerge.shonly delegates toupdate_docs.shafter the fact -
pep8_on_repo.sh(Updating lint tox rule #1348) -
run_system_tests.sh(Move system test runner from bash to Python #1349) -
update_docs.sh(Only run frommerge.sh) -
update_wheels_project.sh(Removing use of wheelhouse and relying on Travis caching. #1350) -
Makefile
We could do this by re-thinking those commands and just using shell-agnostic commands in tox.ini or we could get someone who knows Windows well to write a PowerShell equivalent for us.
A nice tox tricks and patterns post suggests using a foo.cmd file and then
#!/bin/bash -eE
:<<"::batch"
@echo off
powershell -ExecutionPolicy ByPass -File foo.ps1 %*
goto :end
::batch
foo.sh $*
exit $?
:<<"::done"
:end
::donewhere foo.ps1 is PowerShell and foo.sh is bash.
This way the ::batch heredoc gets run on Windows and skips over the foo.sh part via goto :end, while on *nix systems the ::done heredoc is skipped due to the exit $?
UPDATE: I wasn't sure what the : did before the heredocs but I see that it acts as a way to comment them out in bash. This helps explain the Windows side of things; the lines starting with : and :: are ignored, but those with : can be jumped to while the others can't.