mirror of
https://github.com/clearlinux/official-images.git
synced 2026-08-29 01:15:40 +00:00
a553f496cc
Also, now that Python 3.10 is "frozen" (https://pythoninsider.blogspot.com/2021/09/python-3100rc2-is-available.html), allow it to run the tests on Linux.
35 lines
1.2 KiB
Batchfile
35 lines
1.2 KiB
Batchfile
@echo off
|
|
|
|
for %%p in ( pypy3 pypy python3 python ) do (
|
|
%%p --version >nul 2>&1 && (
|
|
set python=%%p
|
|
goto found
|
|
)
|
|
)
|
|
echo unable to run Hy test -- seems this image does not contain Python? >&2
|
|
exit /b 1
|
|
|
|
:found
|
|
%python% --version >nul 2>&1 || exit /b %errorlevel%
|
|
|
|
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)
|
|
rem see https://github.com/hylang/hy/issues/1111 for example breakage
|
|
rem https://github.com/hylang/hy/pull/2115 -- Python 3.10 + Windows == sad pyreadline
|
|
%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)" || (
|
|
echo skipping Hy test -- not allowed on Python 2.x or 3.10+ ^(yet!^) >&2
|
|
rem cheaters gunna cheat
|
|
type expected-std-out.txt
|
|
exit /b 0
|
|
)
|
|
|
|
rem ensure pip does not complain about a new version being available
|
|
set PIP_DISABLE_PIP_VERSION_CHECK=1
|
|
rem or that a new version will no longer work with this python version
|
|
set PIP_NO_PYTHON_VERSION_WARNING=1
|
|
rem https://pypi.org/project/hy/#history
|
|
pip install -q "hy==1.0a3" || exit /b %errorlevel%
|
|
|
|
hy ./container.hy || exit /b %errorlevel%
|
|
|
|
exit /b 0
|