diff --git a/.github/workflows/pyodide.yml b/.github/workflows/pyodide.yml index 3f73f4c..aac00df 100644 --- a/.github/workflows/pyodide.yml +++ b/.github/workflows/pyodide.yml @@ -12,13 +12,13 @@ jobs: pyodide-test: runs-on: ubuntu-latest env: - PYODIDE_VERSION: 0.27.0a2 + PYODIDE_VERSION: 0.28.2 # PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION. # The appropriate versions can be found in the Pyodide repodata.json # "info" field, or in Makefile.envs: # https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2 - PYTHON_VERSION: 3.12.1 - EMSCRIPTEN_VERSION: 3.1.58 + PYTHON_VERSION: 3.13.2 + EMSCRIPTEN_VERSION: 4.0.9 NODE_VERSION: 20 steps: - name: Checkout @@ -51,9 +51,9 @@ jobs: # Activate the virtual environment . .venv-pyodide/bin/activate - pip install "setuptools>=70.0.0" PyYAML click packaging pytest + pip install "setuptools>=70.0.0" "packaging>=24.2" PyYAML click pytest - pip install --no-build-isolation -v -v -v -e . + pip install -e . - name: Test Timed Threads run: | # Activate the virtual environment diff --git a/.gitignore b/.gitignore index 9b7cf1d..19f7ece 100644 --- a/.gitignore +++ b/.gitignore @@ -23,7 +23,6 @@ *.pyo .DS_Store /.python-version -/ChangeLog-spell-corrected /Timed_Threads.egg-info /.pyodide-xbuildenv* /.python-version diff --git a/CHANGES.rst b/CHANGES.rst index 0a55750..50b8f2d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,8 +1,17 @@ -Changes log -=========== +Changes +======= + +2.0.0 - 2025-12-17 +------------------ + +* Change to be suitable for Mathics3: + - use ``pyproject.toml`` for packaging + - works on Python 3.10 to 3.14 + - uses Mathics3-style precommit hooks and editorconfig + +* Change ``ALARM`` list to store absolute time rather than relative time +* Change name from ``stopit`` to ``Timed-Threads`` with module ``timed_threads`` -2.0.0 - 2025 ------------- 1.1.2 - 2018-02-09 ------------------ diff --git a/ChangeLog-spell-corrected b/ChangeLog-spell-corrected new file mode 100644 index 0000000..f47b79a --- /dev/null +++ b/ChangeLog-spell-corrected @@ -0,0 +1,248 @@ +2025-12-17 rocky + + * Makefile, timed_threads/version.py: Get ready for release 2.0.0 + +2025-12-17 R. Bernstein + + * : Merge pull request #1 from + Mathics3/revise-for-modern-conventions Reworked for current Python conventions + +2025-05-30 rocky + + * .editorconfig, .github/workflows/macos.yml, + .github/workflows/pyodide.yml, .github/workflows/ubuntu.yml, + .github/workflows/windows.yml, .gitignore, .pre-commit-config.yaml, + CHANGES.rst, ChangeLog-spell-corrected.diff, Makefile, README.rst, + admin-tools/git2cl, pyproject.toml, setup.cfg, setup.py, + src/stopit/__init__.py, test/test_basic.py, tests.py, + timed_threads/__init__.py, {src/stopit => + timed_threads}/signalstop.py, {src/stopit => + timed_threads}/threadstop.py, {src/stopit => + timed_threads}/utils.py, timed_threads/version.py: Reworked for + current Python conventions * Use pyproject.toml * Reorganize along current Python project guidelines * Revise tests for pytest + +2025-01-18 R. Bernstein + + * : Merge pull request #3 from + Mathics3/fixing_nested_Timeout_contexts_using_signal-rocky Bump version + +2025-01-18 rocky + + * .github/workflows/pyodide.yml: See what's up with pyodide + +2025-01-18 R. Bernstein + + * : commit bc8c5c282ccc11ac6a8f15ee9a8678bfd3da4a60 Author: rocky + Date: Sat Jan 18 09:15:22 2025 -0500 + +2025-01-18 rocky + + * .gitignore: More ignore + +2025-01-18 rocky + + * .github/workflows/pyodide.yml, src/stopit/signalstop.py, + src/stopit/utils.py, tests.py: Minimal stopit load + +2025-01-08 mmatera + + * .github/workflows/pyodide.yml: more verbose install + +2025-01-08 mmatera + + * .github/workflows/pyodide.yml: fix workflow + +2025-01-08 mmatera + + * .github/workflows/pyodide.yml, setup.py: change version + +2025-01-06 rocky + + * setup.py: Bump version + +2025-01-05 mmatera + + * .github/workflows/macos.yml, .github/workflows/pyodide.yml, + .github/workflows/ubuntu.yml, .github/workflows/windows.yml: rename + workflows + +2025-01-04 mmatera + + * .github/workflows/pyodide.yml: pip through python + +2025-01-04 mmatera + + * tests.py: removing control prints + +2025-01-04 mmatera + + * tests.py: improve await function + +2025-01-04 mmatera + + * tests.py: reordering tests + +2025-01-04 mmatera + + * tests.py: check time + +2025-01-04 mmatera + + * tests.py: show duration in test + +2025-01-04 mmatera + + * .github/workflows/pyodide.yml: no build isolation + +2025-01-04 mmatera + + * tests.py: fix typo + +2025-01-04 mmatera + + * .github/workflows/pyodide.yml: pyodide workflow + +2025-01-04 mmatera + + * .github/workflows/macos.yml, .github/workflows/windows.yml: macos + and windows workflows + +2025-01-04 mmatera + + * .github/workflows/ubuntu.yml: adding dependencies + +2025-01-04 mmatera + + * .github/workflows/ubuntu.yml: workflows + +2025-01-04 mmatera + + * src/stopit/utils.py: comment out the warning when the timeout is + reached. + +2025-01-04 mmatera + + * src/stopit/signalstop.py, src/stopit/threadstop.py, + src/stopit/utils.py, tests.py: fix nested timeout contexts using + signals + +2025-01-03 mmatera + + * src/stopit/threadstop.py, tests.py: fix nested timers when using + Threads + +2024-01-09 Gilles Lenfant + + * : Merge pull request #31 from kajaste/ulong37 Use ulong for thread id on Python >= 3.7 + +2019-08-27 Gilles Lenfant + + * : Merge pull request #22 from bartbroere/patch-1 Fix typo in setLevel + +2019-08-03 Gilles Lenfant + + * : Merge pull request #21 from graingert/patch-1 link to github from pypi + +2018-02-09 Gilles Lenfant + + * : commit 6634d280fb607d18774460988f264752f5cae436 Author: Gilles + Lenfant Date: Fri Feb 9 00:28:49 2018 + +0100 + +2018-02-09 Gilles Lenfant + + * LICENSE: Create LICENSE + +2017-12-31 Gilles Lenfant + + * README.rst: Typo + +2017-12-31 Gilles Lenfant + + * README.rst: RST syntax fix + +2017-12-31 Gilles Lenfant + + * README.rst: Comment on issue #13 "wontfix" + +2016-09-02 Gilles Lenfant + + * : Merge pull request #12 from Randl/patch-1 README typo signaling -> signal fixed + +2016-02-18 Gilles Lenfant + + * : Merge pull request #9 from magni-/patch-1 Fix the smallest of typos + +2016-02-07 Gilles Lenfant + + * : Merge pull request #8 from guysoft/to_ctx_mgr-typo Fix to_ctx_mrg to_ctx_mgr typo + +2015-03-22 Gilles Lenfant + + * CHANGES.rst: Release ready + +2015-03-20 Gilles Lenfant + + * README.rst: Supportedversions and rst markup change + +2015-03-20 Gilles Lenfant + + * CHANGES.rst, README.rst, setup.py, src/stopit/utils.py: * Fixed bug of timeout context manager as bool under Python 2.x * Tested with Python 3.4 + +2015-01-01 Gilles Lenfant + + * README.rst: Typo : status <- state + +2014-05-02 Gilles Lenfant + + * MANIFEST.in: Added the MANIFEST.in to add missing dist files + +2014-05-02 Gilles Lenfant + + * CHANGES.rst, README.rst: Finished the doc before releasing + +2014-05-02 Gilles Lenfant + + * README.rst: Some typo on the doc... + +2014-05-02 Gilles Lenfant + + * CHANGES.rst, README.rst, setup.py, src/stopit/__init__.py, + src/stopit/signalstop.py, src/stopit/threadstop.py, + src/stopit/utils.py, tests.py: Completed the documentation and + cleanup + +2014-05-01 Gilles Lenfant + + * README.rst, setup.py, src/stopit/__init__.py, + src/stopit/signalstop.py, src/stopit/threadstop.py, + src/stopit/utils.py, stopit.py, tests.py: Added timeoutcontrol with + posix signals + +2014-03-07 Gilles Lenfant + + * .gitignore: Python 3 cache + +2014-02-09 Gilles Lenfant + + * setup.py: Marking 1st release + +2014-02-09 Gilles Lenfant + + * README.rst: Fixed rst formatting + +2014-02-09 Gilles Lenfant + + * README.rst: Fixed rst warning + +2014-02-09 Gilles Lenfant + + * README.rst: Added more doc + +2014-02-09 Gilles Lenfant + + * setup.py: marked dev version + +2014-02-09 Gilles Lenfant + + * Initial diff --git a/Makefile b/Makefile index 60d4844..780edfd 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,10 @@ RM ?= rm PIP_INSTALL_OPTS ?= .PHONY: all build \ + ChangeLog-without-corrections \ check clean \ develop \ + dist \ pytest \ rmChangeLog \ test @@ -24,7 +26,10 @@ all: develop develop: $(PIP) install -e .$(PIP_INSTALL_OPTS) -#: Install timed_threads +dist: + $(PYTHON) -m build --sdist && $(PYTHON) -m build --wheel + +#: Install development version of timed_threads install: $(PYTHON) -m pip install -e . @@ -46,7 +51,10 @@ pytest: rmChangeLog: $(RM) ChangeLog || true +#: Create ChangeLog from version control without corrections +ChangeLog-without-corrections: + git log --pretty --numstat --summary | $(GIT2CL) >ChangeLog + #: Create a ChangeLog from git via git log and git2cl -ChangeLog: rmChangeLog - git log --pretty --numstat --summary | $(GIT2CL) >$@ - patch -p0 ChangeLog < ChangeLog-spell-corrected.diff +ChangeLog: rmChangeLog ChangeLog-without-corrections + patch ChangeLog < ChangeLog-spell-corrected.diff diff --git a/README.rst b/README.rst index d525c39..7174356 100644 --- a/README.rst +++ b/README.rst @@ -53,7 +53,7 @@ Exception --------- ``timed_threads.TimeoutException`` -........................... +.................................. A ``timed_threads.TimeoutException`` may be raised in a timeout context manager controlled block. @@ -81,7 +81,7 @@ Threading based resources **after** its execution. ``timed_threads.async_raise`` -...................... +.............................. A function that raises an arbitrary exception in another thread @@ -94,7 +94,7 @@ A function that raises an arbitrary exception in another thread - ``exception`` is the exception class or object to raise in the thread. ``timed_threads.ThreadingTimeout`` -........................... +................................... A context manager that "kills" its inner block execution that exceeds the provided time. @@ -191,7 +191,7 @@ indicating (if ``True``) that the block executed normally: # Objects it created or changed may be considered consistent ``timed_threads.threading_timeoutable`` -................................ +....................................... A decorator that kills the function or method it decorates, if it does not return within a given time frame. @@ -616,10 +616,10 @@ Links ===== Source code (clone, fork, ...) - https://github.com/glenfant/timed_threads + https://github.com/Mathics3/python-timed-threads/timed_threads Issues tracker - https://github.com/glenfant/timed_threads/issues + https://github.com/Mathics3/python-timed-threads/timed_threads/issues PyPI https://pypi.python.org/pypi/timed_threads diff --git a/pyproject.toml b/pyproject.toml index eaf20d6..c598bbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "Timed-Threads" description = "Absolute time deadlines and thread cancelling for Python asynchronous threads" requires-python = ">=3.10" readme = "README.rst" -license = {text = "MIT"} +license = "MIT" maintainers = [ {name = "Mathics3 Group"}, ] @@ -21,7 +21,6 @@ classifiers = [ "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Operating System :: OS Independent", - "License :: OSI Approved :: MIT License", "Intended Audience :: Developers", "Development Status :: 5 - Production/Stable" ] diff --git a/timed_threads/version.py b/timed_threads/version.py index 1fdb531..b8d1327 100644 --- a/timed_threads/version.py +++ b/timed_threads/version.py @@ -4,4 +4,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="2.0.0dev0" # noqa +__version__="2.0.0" # noqa