diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f01336da0..fa02854d3 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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] diff --git a/.github/workflows/ubuntu-bench.yml b/.github/workflows/ubuntu-bench.yml index a1b453f46..501629714 100644 --- a/.github/workflows/ubuntu-bench.yml +++ b/.github/workflows/ubuntu-bench.yml @@ -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] diff --git a/.github/workflows/ubuntu-cython.yml b/.github/workflows/ubuntu-cython.yml index e5f39a9bd..453745833 100644 --- a/.github/workflows/ubuntu-cython.yml +++ b/.github/workflows/ubuntu-cython.yml @@ -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 . diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 0a5bfd939..f5edc3237 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c35ebdd76..640f5e5db 100755 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 . diff --git a/mathics/builtin/procedural.py b/mathics/builtin/procedural.py index 6d4841c88..a7e30cfb6 100644 --- a/mathics/builtin/procedural.py +++ b/mathics/builtin/procedural.py @@ -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 diff --git a/mathics/eval/datetime.py b/mathics/eval/datetime.py index e25cbd4af..8185f2ad2 100644 --- a/mathics/eval/datetime.py +++ b/mathics/eval/datetime.py @@ -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 @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 81d96749d..e5fda4010 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/test/builtin/test_datentime.py b/test/builtin/test_datentime.py index 386136d90..3c97ca9cf 100644 --- a/test/builtin/test_datentime.py +++ b/test/builtin/test_datentime.py @@ -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( @@ -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(