container.cmd 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. @echo off
  2. for %%p in ( pypy3 pypy python3 python ) do (
  3. %%p --version >nul 2>&1 && (
  4. set python=%%p
  5. goto found
  6. )
  7. )
  8. echo unable to run Hy test -- seems this image does not contain Python? >&2
  9. exit /b 1
  10. :found
  11. %python% --version >nul 2>&1 || exit /b %errorlevel%
  12. rem Hy is complicated, and uses Python's internal AST representation directly, and thus Hy releases usually lag behind a little on major Python releases (and we don't want that to gum up our tests)
  13. rem see https://github.com/hylang/hy/issues/1111 for example breakage
  14. %python% -c "import sys; exit((sys.version_info[0] == 3 and sys.version_info[1] >= 10) or sys.version_info[0] > 3 or sys.version_info[0] == 2)" || (
  15. echo skipping Hy test -- not allowed on Python 2.x or 3.10+ ^(yet!^) >&2
  16. rem cheaters gunna cheat
  17. type expected-std-out.txt
  18. exit /b 0
  19. )
  20. rem ensure pip does not complain about a new version being available
  21. set PIP_DISABLE_PIP_VERSION_CHECK=1
  22. rem or that a new version will no longer work with this python version
  23. set PIP_NO_PYTHON_VERSION_WARNING=1
  24. pip install -q "hy==0.20.0" || exit /b %errorlevel%
  25. hy ./container.hy || exit /b %errorlevel%
  26. exit /b 0