Skip to content

Commit c5376a0

Browse files
authored
Merge pull request #1 from Mathics3/revise-for-modern-conventions
Reworked for current Python conventions
2 parents 7088e50 + d5c3670 commit c5376a0

23 files changed

+867
-330
lines changed

.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This is an EditorConfig file
2+
# https://EditorConfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = lf
8+
insert_final_newline = true
9+
charset = utf-8
10+
indent_style = tab
11+
indent_size = 4
12+
13+
[*.yml]
14+
indent_style = space
15+
indent_size = 2
16+
end_of_line = lf
17+
insert_final_newline = true
18+
19+
[*.py]
20+
indent_style = space
21+
indent_size = 4
22+
end_of_line = lf
23+
insert_final_newline = true
24+
25+
# Tab indentation (no size specified)
26+
[Makefile]
27+
indent_style = tab

.github/workflows/macos.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stopit (macOS)
1+
name: Timed Threads (macOS)
22

33
on:
44
push:
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [macOS]
18-
python-version: ['3.10', '3.11']
18+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Set up Python ${{ matrix.python-version }}
@@ -25,10 +25,10 @@ jobs:
2525
- name: Install OS dependencies
2626
run: |
2727
python -m pip install --upgrade pip
28-
- name: Install stopit
28+
- name: Install timed_threads
2929
run: |
3030
pip install "setuptools>=70.0.0" packaging pytest
31-
pip install -e .
31+
pip install -e .[dev]
3232
- name: Test Stopit
3333
run: |
34-
python tests.py
34+
pytest test

.github/workflows/pyodide.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Copied from SymPy https://github.com/sympy/sympy/pull/27183
22

3-
name: Stopit (Pyodide)
3+
name: Timed Theads (Pyodide)
44

55
on:
66
push:
@@ -54,10 +54,10 @@ jobs:
5454
pip install "setuptools>=70.0.0" PyYAML click packaging pytest
5555
5656
pip install --no-build-isolation -v -v -v -e .
57-
- name: Test stopit
57+
- name: Test Timed Threads
5858
run: |
5959
# Activate the virtual environment
6060
. .venv-pyodide/bin/activate
6161
echo $PATH
62-
python -c "import sys; print(sys.path); import stopit"
63-
# python tests.py
62+
python -c "import sys; print(sys.path); import timed_threads"
63+
# python test

.github/workflows/ubuntu.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stopit (ubuntu)
1+
name: Timed Threads (ubuntu)
22

33
on:
44
push:
@@ -11,18 +11,18 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ['3.12', '3.11', '3.8', '3.9', '3.10']
14+
python-version: ['3.13', '3.11', '3.10', '3.12', '3.14']
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Set up Python ${{ matrix.python-version }}
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: ${{ matrix.python-version }}
21-
- name: Install stopit
21+
- name: Install Timed Threads
2222
run: |
2323
python -m pip install --upgrade pip
2424
pip install "setuptools>=70.0.0" packaging pytest
25-
pip install -e .
26-
- name: Test stopit
25+
pip install -e .[dev]
26+
- name: Test Timed threads
2727
run: |
28-
python tests.py
28+
pytest test

.github/workflows/windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Stopit (Windows)
1+
name: Timed Threads (Windows)
22

33
on:
44
push:
@@ -21,11 +21,11 @@ jobs:
2121
uses: actions/setup-python@v5
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- name: Install stopit
24+
- name: Install Timed Threads
2525
run: |
2626
python -m pip install --upgrade pip
2727
pip install "setuptools>=70.0.0" packaging pytest
28-
pip install -e .
29-
- name: Test stopit
28+
pip install -e .[dev]
29+
- name: Test Timed Threads
3030
run: |
31-
python tests.py
31+
pytest test

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
1+
*.c
2+
*.cpp
3+
*.egg
4+
*.gz
5+
*.nix
6+
*.py[cod]
7+
*.so
8+
*.stackdump
9+
*~
10+
.coverage
11+
.idea/
12+
.mypy_cache
13+
.project
14+
.pydevproject
15+
.settings
16+
.vscode
17+
/.cache
18+
/.pyodide-xbuildenv-*
19+
/.pytest_cache
20+
/.python-version
121
*.egg-info
222
*.pyc
323
*.pyo
424
.DS_Store
25+
/.python-version
26+
/ChangeLog-spell-corrected
27+
/Timed_Threads.egg-info
528
/.pyodide-xbuildenv*
629
/.python-version
30+
/ChangeLog
31+
/ChangeLog.orig
32+
/ChangeLog.rej
733
__pycache__/
834
build/
935
dist/
36+
tmp

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
default_language_version:
2+
python: python
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: check-merge-conflict
8+
- id: debug-statements
9+
stages: [pre-commit]
10+
exclude: ChangeLog-spell-corrected.diff|mathics/builtin/system.py
11+
- id: end-of-file-fixer
12+
stages: [pre-commit]
13+
exclude: ChangeLog-spell-corrected.diff
14+
- repo: https://github.com/pycqa/isort
15+
rev: 5.13.2
16+
hooks:
17+
- id: isort
18+
stages: [pre-commit]
19+
- repo: https://github.com/psf/black
20+
rev: 23.12.1
21+
hooks:
22+
- id: black
23+
language_version: python3
24+
exclude: 'mathics/version.py'
25+
stages: [pre-commit]

CHANGES.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changes log
22
===========
33

4+
2.0.0 - 2025
5+
------------
6+
47
1.1.2 - 2018-02-09
58
------------------
69

@@ -16,7 +19,7 @@ Changes log
1619
1.1.0 - 2014-05-02
1720
------------------
1821

19-
* Added support for TIMER signal based timeout control (Posix OS only)
22+
* Added support for TIMER signal based timeout control (POSIX OS only)
2023
* API changes due to new timeout controls
2124
* An exhaustive documentation.
2225

ChangeLog-spell-corrected.diff

Whitespace-only changes.

Makefile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# A GNU Makefile to run various tasks - compatibility for us old-timers.
2+
3+
# Note: This makefile include remake-style target comments.
4+
# These comments before the targets start with #:
5+
# remake --tasks to shows the targets and the comments
6+
7+
GIT2CL ?= ./admin-tools/git2cl
8+
PYTHON ?= python3
9+
PIP ?= $(PYTHON) -m pip
10+
RM ?= rm
11+
PIP_INSTALL_OPTS ?=
12+
13+
.PHONY: all build \
14+
check clean \
15+
develop \
16+
pytest \
17+
rmChangeLog \
18+
test
19+
20+
#: Default target - same as "develop"
21+
all: develop
22+
23+
#: Set up to run from the source tree
24+
develop:
25+
$(PIP) install -e .$(PIP_INSTALL_OPTS)
26+
27+
#: Install timed_threads
28+
install:
29+
$(PYTHON) -m pip install -e .
30+
31+
#: Run unit tests and Mathics doctest
32+
check: pytest
33+
34+
#: Same as check
35+
test: check
36+
37+
#: Remove derived files
38+
clean:
39+
@find . -name *.pyc -type f -delete;
40+
41+
#: Run py.test tests. Use environment variable "o" for pytest options
42+
pytest:
43+
$(PYTHON) -m pytest test $o
44+
45+
#: Remove ChangeLog
46+
rmChangeLog:
47+
$(RM) ChangeLog || true
48+
49+
#: Create a ChangeLog from git via git log and git2cl
50+
ChangeLog: rmChangeLog
51+
git log --pretty --numstat --summary | $(GIT2CL) >$@
52+
patch -p0 ChangeLog < ChangeLog-spell-corrected.diff

0 commit comments

Comments
 (0)