Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ jobs:
python -m pip install --upgrade pip
- name: Install Mathics3 with full Python dependencies
run: |
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
# We can comment out after next Mathics-Scanner release
# python -m pip install Mathics-Scanner[full]
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ubuntu-bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install pytest-benchmark
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
# python -m pip install Mathics-Scanner[full]
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ubuntu-cython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ jobs:
run: |
sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev tesseract-ocr
python -m pip install --upgrade pip
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
pip install -e .
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ jobs:
- name: Install Mathics3 with full dependencies
run: |
python -m pip install --upgrade pip
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
# We can comment out after next Mathics-Scanner release
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
git clone --depth 1 https://github.com/Mathics3/mathics-scanner.git
# git clone --single-branch --branch operator-refactor-part1.5 https://github.com/Mathics3/mathics-scanner.git
cd mathics-scanner/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ jobs:
set LLVM_DIR="C:\Program Files\LLVM"
- name: Install Mathics3 with Python dependencies
run: |
# First install our patched version of stopit
git clone --depth 1 https://github.com/Mathics3/stopit.git
cd stopit/
pip install -e .
cd ..
# We can comment out after next Mathics-Scanner release
# python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full]
pip install -e .
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/procedural.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ def eval(self, n, evaluation: Evaluation): # pylint: disable=unused-argument
except ValueError:
evaluation.message("Pause", "numnm", Expression(SymbolPause, n))
return

eval_pause(sleep_time, evaluation)
return SymbolNull

Expand Down
4 changes: 2 additions & 2 deletions mathics/eval/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def eval_pause(sleeptime: float, evaluation):


if sys.platform == "emscripten":
# from stopit import SignalTimeout as TimeoutHandler
# from timed_threads import SignalTimeout as TimeoutHandler

def eval_timeconstrained(
expr: BaseElement, timeout: float, failexpr: BaseElement, evaluation: Evaluation
Expand All @@ -75,7 +75,7 @@ def eval_timeconstrained(
evaluation.message("TimeConstrained", "tcns")

else:
from stopit import ThreadingTimeout as TimeoutHandler
from timed_threads import ThreadingTimeout as TimeoutHandler

def eval_timeconstrained(
expr: BaseElement, timeout: float, failexpr: BaseElement, evaluation: Evaluation
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ dependencies = [
"requests",
"scipy",
"setuptools",
# stopit is needed in TimeRemaining[]
"stopit; platform_system != 'Emscripten'",
# Timed-Threads is needed in TimeRemaining[]
"Timed-Threads",
"sympy>=1.13",
]
license = "GPL-3.0-or-later"
Expand Down
12 changes: 8 additions & 4 deletions test/builtin/test_datentime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@
import pytest

try:
from stopit import __version__ as stopit_version
from timed_threads import __version__ as stopit_version
except ImportError:
have_stopit_for_timeconstrained = False
have_timed_threads_for_timeconstrained = False
else:
have_stopit_for_timeconstrained = stopit_version.split(".")[:3] >= ["1", "1", "3"]
have_timed_threads_for_timeconstrained = stopit_version.split(".")[:3] >= [
"1",
"1",
"3",
]


@pytest.mark.skipif(
Expand Down Expand Up @@ -154,7 +158,7 @@ def test_private_doctests_datetime(str_expr, msgs, str_expected, fail_msg):


@pytest.mark.skipif(
sys.platform in ("emscripten",) or not have_stopit_for_timeconstrained,
sys.platform in ("emscripten",) or not have_timed_threads_for_timeconstrained,
reason="TimeConstrained[] is not supported in Pyodide or an unpatched 'stopit'",
)
@pytest.mark.parametrize(
Expand Down
Loading