Skip to content

Commit 18af19e

Browse files
authored
Merge pull request #2461 from Kodiologist/pypy-update
Update PyPy testing
2 parents e4b00cb + 15abf28 commit 18af19e

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
name-prefix: ['']
1212
os: [ubuntu-latest]
13-
python: [3.8, 3.9, '3.10', 3.11, 3.12-dev, pypy-3.9, pyodide]
13+
python: [3.8, 3.9, '3.10', 3.11, 3.12-dev, pypy-3.10, pyodide]
1414
include:
1515
# To keep the overall number of runs low, we test Windows and MacOS
1616
# only on the latest CPython.

docs/interop.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,16 @@ You can use :ref:`hy2py` to convert a Hy program to Python. The output will
4242
still import ``hy``, and thus require Hy to be installed in order to run; see
4343
:ref:`implicit-names` for details and workarounds.
4444

45-
To execute Hy code from a string, use :func:`hy.read` to convert it to
46-
:ref:`models <models>` and then :func:`hy.eval` to evaluate it. There is no Hy
47-
equivalent of :func:`exec` because :func:`hy.eval` works even when the input
48-
isn't equivalent to a single Python expression.
45+
To execute Hy code from a string, use :hy:func:`hy.read-many` to convert it to
46+
:ref:`models <models>` and then :hy:func:`hy.eval` to evaluate it:
47+
48+
.. code-block:: python
49+
50+
>>> hy.eval(hy.read_many("(setv x 1) (+ x 1)"))
51+
2
52+
53+
There is no Hy equivalent of :func:`exec` because :hy:func:`hy.eval` works
54+
even when the input isn't equivalent to a single Python expression.
4955

5056
You can use :meth:`hy.REPL.run` to launch the Hy REPL from Python, as in
5157
``hy.REPL(locals = locals()).run()``.

hy/cmdline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from pathlib import Path
1313

1414
import hy
15-
from hy._compat import PY3_9, PYPY
15+
from hy._compat import PY3_9
1616
from hy.compiler import hy_compile, hy_eval
1717
from hy.errors import HyLanguageError, filtered_hy_exceptions, hy_exc_handler
1818
from hy.importer import runhy
@@ -270,7 +270,7 @@ def proc_opt(opt, arg=None, item=None, i=None):
270270
set_path(filename)
271271
# Ensure __file__ is set correctly in the code we're about
272272
# to run.
273-
if PY3_9 and not PYPY:
273+
if PY3_9:
274274
if not filename.is_absolute():
275275
filename = Path.cwd() / filename
276276
if platform.system() == "Windows":

tests/test_bin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import pytest
1313

14-
from hy._compat import PY3_9, PYODIDE, PYPY
14+
from hy._compat import PY3_9, PYODIDE
1515

1616
if PYODIDE:
1717
pytest.skip(
@@ -681,7 +681,6 @@ def test_output_buffering(tmp_path):
681681
assert tf.read_text().splitlines() == ["line 1", "line 2"]
682682

683683

684-
@pytest.mark.skipif(PYPY, reason = 'https://foss.heptapod.net/pypy/pypy/-/issues/3881')
685684
def test_uufileuu(tmp_path, monkeypatch):
686685
# `__file__` should be set the same way as in Python.
687686
# https://github.com/hylang/hy/issues/2318
@@ -691,7 +690,7 @@ def test_uufileuu(tmp_path, monkeypatch):
691690
(tmp_path / "realdir" / "pyex.py").write_text('print(__file__)')
692691

693692
def file_is(arg, expected_py3_9):
694-
expected = expected_py3_9 if PY3_9 and not PYPY else Path(arg)
693+
expected = expected_py3_9 if PY3_9 else Path(arg)
695694
output, _ = run_cmd(["python3", arg + "pyex.py"])
696695
assert output.rstrip() == str(expected / "pyex.py")
697696
output, _ = run_cmd(["hy", arg + "hyex.hy"])

0 commit comments

Comments
 (0)