DylanLukes / renkon

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Fix/Workaround GitHub Actions on Windows (disabled/ignored for now) #28

Closed DylanLukes closed 1 month ago

DylanLukes commented 9 months ago

GitHub Actions does not work properly on Windows, and seems to be refusing to do command substitution (both with bash and the default pwsh):

With the following exploded out script for debugging purposes:

[envs.lint.scripts]
typing = [
    'hatch -q -e default run python -c "import sys; print(sys.executable)" > python-exec-path.tmp',
    'cat python-exec-path.tmp',
    'mypy --install-types --non-interactive --python-executable="$(cat python-exec-path.tmp)" {args:.}',
    'rm python-exec-path.tmp',
]

We get:

cmd [3] | hatch -q -e default run python -c "import sys; print(sys.executable)" > python-exec-path.tmp
cmd [4] | cat  python-exec-path.tmp
C:\Users\runneradmin\AppData\Local\hatch\env\virtual\renkon\TNkmYhed\renkon\Scripts\python.exe
cmd [5] | mypy --install-types --non-interactive --python-executable="$(cat python-exec-path.tmp)" .
mypy: Invalid python executable '$(cat python-exec-path.tmp)': No such file or directory

This is either an upstream bug in the runner, or there's something missing, as it does work using a local installation of Powershell (for Mac) just fine.

Not having Windows CI is rather unfortunate, as it has already helped catch some bugs which affected Linux/MacOS, just more subtly.