Skip to content

Commit de884a5

Browse files
authored
Merge pull request #2644 from Kodiologist/no-pyodide-testing
Remove Pyodide testing
2 parents 40ec325 + 6505c8b commit de884a5

File tree

16 files changed

+28
-70
lines changed

16 files changed

+28
-70
lines changed

.github/workflows/tests.yaml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
name-prefix: ['']
1414
os: [ubuntu-latest]
15-
python: [3.9, '3.10', 3.11, 3.12, 3.13, pypy-3.10, pyodide]
15+
python: [3.9, '3.10', 3.11, 3.12, 3.13, pypy-3.10]
1616
include:
1717
# To keep the overall number of runs low, we test Windows and MacOS
1818
# only on the latest CPython.
@@ -34,36 +34,20 @@ jobs:
3434
steps:
3535
- run: git config --global core.autocrlf false
3636
- uses: actions/checkout@v4
37-
- if: matrix.python != 'pyodide'
38-
uses: actions/setup-python@v5
37+
- uses: actions/setup-python@v5
3938
with:
4039
python-version: ${{ matrix.python }}
41-
- if: matrix.python == 'pyodide'
42-
uses: actions/setup-python@v5
43-
with: {python-version: 3.12}
44-
- if: matrix.python == 'pyodide'
45-
uses: actions/setup-node@v4
4640
- name: Install
4741
shell: bash
4842
run: |
49-
if [[ ${{ matrix.python }} = pyodide ]] ; then
50-
npm install pyodide
51-
pip install pyodide-build
52-
pyodide venv .venv-pyodide
53-
source .venv-pyodide/bin/activate
54-
fi
5543
pip install .
5644
rm -r hy
5745
# We want to be sure we're testing the installed version,
5846
# instead of running from the source tree.
5947
pip install pytest
6048
- name: Test
6149
shell: bash
62-
run: |
63-
if [[ ${{ matrix.python }} = pyodide ]] ; then
64-
source .venv-pyodide/bin/activate
65-
fi
66-
python -m pytest tests
50+
run: python -m pytest tests
6751

6852
docs:
6953
# Try building the manual, ensuring that Sphinx doesn't produce

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ Comprehensions
663663
The last argument of ``for`` can be an ``(else …)`` form. This form is
664664
executed after the last iteration of the ``for``\'s outermost iteration
665665
clause, but only if that outermost loop terminates normally. If it's jumped
666-
out of with e.g. ``break``, the ``else`` is ignored. ::
666+
out of with e.g. :hy:func:`break`, the ``else`` is ignored. ::
667667

668668
(for [x [1 2 3]]
669669
(print x)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Ultimately this will only appear on the page itself. The actual HTML title
2525
# will be simplified in post-processing.
2626

27-
hyrule_version = 'v0.8.0'
27+
hyrule_version = 'v1.0.0'
2828

2929
source_suffix = '.rst'
3030
master_doc = 'index'

docs/macros.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ A better approach is to use :hy:func:`hy.gensym` to choose your variable name::
119119
(setv ~g (.upper ~arg))
120120
(+ ~g ~g)))
121121

122-
Hyrule provides some macros that make using gensyms more convenient, like :hy:func:`defmacro! <hyrule.defmacro!>` and :hy:func:`with-gensyms <hyrule.with-gensyms>`.
122+
Hyrule provides some macros that make using gensyms more convenient, like :hy:func:`defmacro! <hyrule.defmacro!>` and :hy:func:`def-gensyms <hyrule.def-gensyms>`.
123123

124124
On the other hand, you can write a macro that advertises a specific name (or set of names) as part of its interface. For example, Hyrule's `anaphoric macro <https://en.wikipedia.org/wiki/Anaphoric_macro>`_ :hy:func:`ap-if <hyrule.ap-if>` assigns the result of a test form to ``it``, and allows the caller to include forms that refer to ``it``::
125125

docs/versioning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Versioning and compatibility
44

55
Starting with Hy 1.0.0, Hy is `semantically versioned <https://semver.org>`_. Refer to `the NEWS file <https://github.com/hylang/hy/blob/master/NEWS.rst>`_ for a summary of user-visible changes brought on by each version, and how to update your code in case of breaking changes. Be sure you're reading the version of this manual (shown at the top of each page) that matches the version of Hy you're running.
66

7-
Hy is tested on `all released and currently maintained versions of CPython <https://devguide.python.org/versions>`_ (on Linux, Windows, and Mac OS), and on recent versions of `PyPy <https://pypy.org>`_ and `Pyodide <https://pyodide.org>`_. We usually find that for Hy, unlike most Python packages, we need to change things to fully support each new 3.x release of Python. We may drop compatibility with a version of Python after the CPython guys cease maintaining it. Note that we construe such a change as non-breaking, so we won't bump Hy's major version for it. But we will at least bump the minor version, and ``python_requires`` in Hy's ``setup.py`` should prevent you from installing a Hy version that won't work with your Python version.
7+
Hy is tested on `all released and currently maintained versions of CPython <https://devguide.python.org/versions>`_ (on Linux, Windows, and Mac OS), and on recent versions of `PyPy <https://pypy.org>`_. (`Pyodide <https://pyodide.org>`_ is also supported, as for `Try Hy <http://hylang.org/try-hy>`_, but is no longer tested, since the testing infrastructure was a maintenance burden and failed to reveal any compatibility issues in Hy itself.) We usually find that for Hy, unlike most Python packages, we need to change things to fully support each new 3.x release of Python. We may drop compatibility with a version of Python after the CPython guys cease maintaining it. Note that we construe such a change as non-breaking, so we won't bump Hy's major version for it. But we will at least bump the minor version, and ``python_requires`` in Hy's ``setup.py`` should prevent you from installing a Hy version that won't work with your Python version.
88

99
Starting with Hy 1.0.0, each version of Hy also has a nickname, such as "Afternoon Review". Nicknames are used in alphabetical order, with a nickname starting with "Z" then wrapping around to "A". Nicknames are provided mostly for the amusement of the maintainer, but can be useful as a conspicuous sign that you're not using the version you expected. In code, you can get the current nickname as a string (or ``None``, for unreleased commits of Hy) with ``hy.nickname``.

hy/compat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
PY3_12_6 = sys.version_info >= (3, 12, 6)
99
PY3_13 = sys.version_info >= (3, 13)
1010
PYPY = platform.python_implementation() == "PyPy"
11-
PYODIDE = platform.system() == "Emscripten"
1211

1312

1413
if "def" in ast.unparse(ast.parse("𝕕𝕖𝕗 = 1")):

hy/core/util.hy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
8383
An exceptional case is if the macro is a core macro that returns one of Hy's internal compiler result objects instead of a real model. Then, you just get the original back, as if the macro hadn't been expanded.
8484
85-
The optional arguments ``module`` and ``macros`` can be provided to control where macros are looked up, as with :hy:func:`hy.eval`.
85+
As with :hy:func:`hy.eval`, the optional arguments ``module`` and ``macros`` can be provided to control where macros are looked up, and local macros are invisible unless provided via e.g. ``:macros (local-macros)``.
8686
8787
See also :hy:func:`hy.macroexpand`."
8888
(_macroexpand model (or module (calling-module)) macros :once True))

tests/importer/test_importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_basics():
1818
"Make sure the basics of the importer work"
1919

2020
resources_mod = importlib.import_module("tests.resources")
21-
assert hasattr(resources_mod, "can_test_async")
21+
assert resources_mod.in_init == "chippy"
2222

2323
bin_mod = importlib.import_module("tests.resources.bin")
2424
assert hasattr(bin_mod, "_null_fn_for_import_test")

tests/native_tests/comprehensions.hy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
(import
22
types
33
asyncio
4-
pytest
5-
tests.resources [async-test])
4+
pytest)
65

76

87
(defn test-comprehension-types []
@@ -386,7 +385,7 @@
386385
(assert (= x 3)))
387386

388387

389-
(defn [async-test] test-for-async []
388+
(defn test-for-async []
390389
(defn :async numbers []
391390
(for [i [1 2]]
392391
(yield i)))
@@ -399,7 +398,7 @@
399398
(assert (= x 3))))))
400399

401400

402-
(defn [async-test] test-for-async-else []
401+
(defn test-for-async-else []
403402
(defn :async numbers []
404403
(for [i [1 2]]
405404
(yield i)))

tests/native_tests/decorators.hy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(import
2-
asyncio
3-
tests.resources [async-test])
2+
asyncio)
43

54

65
(defn test-decorated-1line-function []
@@ -53,7 +52,7 @@
5352
(assert (= l ["dec" "arg" "foo" "foo fn" "bar body" 1])))
5453

5554

56-
(defn [async-test] test-decorated-defn-a []
55+
(defn test-decorated-defn-a []
5756
(defn decorator [func] (fn :async [] (/ (await (func)) 2)))
5857

5958
(defn :async [decorator] coro-test []

tests/native_tests/functions.hy

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
(import
44
asyncio
55
typing [List]
6-
pytest
7-
tests.resources [async-test])
6+
pytest)
87

98

109
(defn test-fn []
@@ -25,7 +24,7 @@
2524
(assert (= (fn-test) None)))
2625

2726

28-
(defn [async-test] test-fn-async []
27+
(defn test-fn-async []
2928
(assert (= (asyncio.run ((fn :async [] (await (asyncio.sleep 0)) [1 2 3])))
3029
[1 2 3])))
3130

@@ -182,14 +181,14 @@
182181
(setv x [#* spam] y 1)))
183182

184183

185-
(defn [async-test] test-defn-async []
184+
(defn test-defn-async []
186185
(defn :async coro-test []
187186
(await (asyncio.sleep 0))
188187
[1 2 3])
189188
(assert (= (asyncio.run (coro-test)) [1 2 3])))
190189

191190

192-
(defn [async-test] test-no-async-gen-return []
191+
(defn test-no-async-gen-return []
193192
; https://github.com/hylang/hy/issues/2523
194193
(defn :async runner [gen]
195194
(setv vals [])

tests/native_tests/import.hy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
os.path [exists isdir isfile]
77
sys :as systest
88
sys
9-
pytest
10-
hy.compat [PYODIDE])
9+
pytest)
1110

1211

1312
(defn test-imported-bits []

tests/native_tests/with.hy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
asyncio
33
unittest.mock [Mock]
44
pytest
5-
tests.resources [async-test]
65
tests.resources.pydemo [AsyncWithTest async-exits])
76

87
(defn test-context []
@@ -39,7 +38,7 @@
3938
(assert (= out [1 2 3]))
4039
(assert (= exits [4 3 2 1])))
4140

42-
(defn [async-test] test-single-with-async []
41+
(defn test-single-with-async []
4342
(.clear async-exits)
4443
(setv out [])
4544
(asyncio.run
@@ -49,7 +48,7 @@
4948
(assert (= out [1]))
5049
(assert (= async-exits [1])))
5150

52-
(defn [async-test] test-quince-with-async []
51+
(defn test-quince-with-async []
5352
(.clear async-exits)
5453
(setv out [])
5554
(asyncio.run
@@ -63,7 +62,7 @@
6362
(assert (= out [1 2 3]))
6463
(assert (= async-exits [4 3 2 1])))
6564

66-
(defn [async-test] test-with-mixed-async []
65+
(defn test-with-mixed-async []
6766
(setv (cut exits) [])
6867
(setv out [])
6968
(asyncio.run

tests/resources/__init__.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
11
import pytest
22

3-
from hy.compat import PYODIDE
4-
53
in_init = "chippy"
64

75

86
def function_with_a_dash():
97
pass
10-
11-
12-
can_test_async = not PYODIDE
13-
async_test = pytest.mark.skipif(
14-
not can_test_async, reason="`asyncio.run` not implemented"
15-
)

tests/test_bin.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111

1212
import pytest
1313

14-
from hy.compat import PYODIDE
15-
16-
if PYODIDE:
17-
pytest.skip(
18-
'`subprocess.Popen` not implemented on Pyodide',
19-
allow_module_level = True)
20-
2114

2215
def pyr(s=""):
2316
return "hy --repl-output-fn=repr " + s

tests/test_hy2py.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,17 @@
88

99
import hy.importer
1010
from hy import mangle
11-
from hy.compat import PYODIDE
1211

1312

1413
def test_direct_import():
1514
import tests.resources.pydemo
16-
from tests.resources import can_test_async
17-
assert_stuff(tests.resources.pydemo, can_test_async)
15+
assert_stuff(tests.resources.pydemo)
1816

1917

20-
@pytest.mark.skipif(PYODIDE, reason="subprocess.check_call not implemented on Pyodide")
2118
def test_hy2py_import():
2219
import contextlib
2320
import os
2421
import subprocess
25-
from tests.resources import can_test_async
2622

2723
path = "tests/resources/pydemo_as_py.py"
2824
env = dict(os.environ)
@@ -38,10 +34,10 @@ def test_hy2py_import():
3834
finally:
3935
with contextlib.suppress(FileNotFoundError):
4036
os.remove(path)
41-
assert_stuff(m, can_test_async)
37+
assert_stuff(m)
4238

4339

44-
def assert_stuff(m, can_test_async):
40+
def assert_stuff(m):
4541

4642
# This makes sure that automatically imported builtins go after docstrings.
4743
assert m.__doc__ == "This is a module docstring."
@@ -168,10 +164,9 @@ class C:
168164
assert m.pys_accum == [0, 1, 2, 3, 4]
169165
assert m.py_accum == "01234"
170166

171-
if can_test_async:
172-
m.async_exits.clear()
173-
assert asyncio.run(m.coro()) == list("abcdef")
174-
assert m.async_exits == ["b"]
167+
m.async_exits.clear()
168+
assert asyncio.run(m.coro()) == list("abcdef")
169+
assert m.async_exits == ["b"]
175170

176171
assert m.cheese == [1, 1]
177172
assert m.mac_results == ["x", "x"]

0 commit comments

Comments
 (0)