Skip to content

Commit

Permalink
Fix pypy 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed Aug 31, 2024
1 parent 149110f commit b16d9f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions coconut/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def get_path_env_var(env_var, default):
and not (PYPY and PY39)
and (PY38 or not PY36)
)
NUMPY = (
not PYPY
and (PY2 or PY34)
)

py_version_str = sys.version.split()[0]

Expand Down
3 changes: 2 additions & 1 deletion coconut/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from coconut.constants import (
CPYTHON,
PY34,
NUMPY,
IPY,
MYPY,
XONSH,
Expand Down Expand Up @@ -249,7 +250,7 @@ def everything_in(req_dict):
"docs": unique_wrt(get_reqs("docs"), requirements),
"tests": uniqueify_all(
get_reqs("tests"),
extras["numpy"],
extras["numpy"] if NUMPY else [],
extras["jupyter"] if IPY else [],
extras["mypy"] if MYPY else [],
extras["xonsh"] if XONSH else [],
Expand Down
9 changes: 4 additions & 5 deletions coconut/tests/src/extras.coco
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ os.environ["COCONUT_USE_COLOR"] = "False"
from coconut.__coconut__ import consume as coc_consume
from coconut.constants import (
IPY,
PY2,
PY34,
NUMPY,
PY35,
PY36,
PY39,
Expand Down Expand Up @@ -762,13 +761,13 @@ def test_xarray() -> bool:


def test_extras() -> bool:
if not PYPY and (PY2 or PY34):
if NUMPY:
assert test_numpy() is True
print(".", end="")
if not PYPY and PY36:
if NUMPY and PY36:
assert test_pandas() is True # .
print(".", end="")
if not PYPY and PY39:
if NUMPY and PY39:
assert test_xarray() is True # ..
print(".") # newline bc we print stuff after this
assert test_setup_none() is True # ...
Expand Down

0 comments on commit b16d9f7

Please sign in to comment.