Skip to content

Commit 914f3e1

Browse files
committed
Get ready for release 1.1.0
1 parent e68871e commit 914f3e1

File tree

6 files changed

+46
-16
lines changed

6 files changed

+46
-16
lines changed

CHANGES.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
CHANGES
22
=======
33

4-
1.0.1.dev0
5-
----------
4+
1.1.0
5+
-----
66

7-
Revise for upcoming Mathics 9.0.0 release
7+
Revise for Mathics 9.0.0 release
88

9-
* Add ``mframe``: is like ``frame`` but mathics-oriented frame motion
9+
* Add ``mframe``: is like ``frame`` but for Mathics3-related frame motion
10+
* Add ``mprogram``: is like ``program`` but for Mathics3-related frame
11+
* Add ``abort``: Aborts current Mathics3 command
1012

1113

1214
1.0.0

admin-tools/make-dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ function finish {
1010

1111
trepan3k_mathics3_owd=$(pwd)
1212
cd $(dirname ${BASH_SOURCE[0]})
13-
trepan3k_mathics3_owd=$(pwd)
1413
trap finish EXIT
1514

1615
cd ..
@@ -22,6 +21,7 @@ if ! pyenv local $pyversion ; then
2221
exit $?
2322
fi
2423

24+
rm -fr build
2525
pip wheel --wheel-dir=dist .
2626
python -m build --sdist
2727
finish

admin-tools/pyenv-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
66
exit 1
77
fi
88

9-
export PYVERSIONS='3.9 3.10 3.11 3.12 3.13'
9+
export PYVERSIONS='3.10 3.11 3.12 3.13'

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ authors = [
1313
name = "trepan3k_mathics3"
1414
description = "trepan3k plugin to support Mathics3 debugging"
1515
dependencies = [
16-
"Mathics3>8.0.1",
17-
"trepan3k>=1.4.0"
16+
"Mathics3>=9.0.0",
17+
"Mathics3-Module-trepan>=9.0.0",
18+
"trepan3k>=1.4.1"
1819
]
1920
readme = "README.rst"
2021
license = "GPL-3.0-or-later"
@@ -24,7 +25,6 @@ classifiers = [
2425
"Intended Audience :: Developers",
2526
"Programming Language :: Python",
2627
"Topic :: Software Development :: Libraries :: Python Modules",
27-
"Programming Language :: Python :: 3.9",
2828
"Programming Language :: Python :: 3.10",
2929
"Programming Language :: Python :: 3.11",
3030
"Programming Language :: Python :: 3.12",

trepan3k_mathics3/mabort.py

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,33 @@
2020
from mathics.core.interrupt import AbortInterrupt
2121
from trepan.processor.command.base_cmd import DebuggerCommand
2222

23+
24+
def ctype_async_raise(thread_obj, exception):
25+
found = False
26+
target_tid = 0
27+
for tid, tobj in threading._active.items():
28+
if tobj is thread_obj:
29+
found = True
30+
target_tid = tid
31+
break
32+
33+
if not found:
34+
raise ValueError("Invalid thread object")
35+
36+
ret = ctypes.pythonapi.PyThreadState_SetAsyncExc(
37+
target_tid, ctypes.py_object(exception)
38+
)
39+
# ref: http://docs.python.org/c-api/init.html#PyThreadState_SetAsyncExc
40+
if ret == 0:
41+
raise AbortInterrupt
42+
elif ret > 1:
43+
# Huh? Why would we notify more than one threads?
44+
# Because we punch a hole into C level interpreter.
45+
# So it is better to clean up the mess.
46+
ctypes.pythonapi.PyThreadState_SetAsyncExc(target_tid, 0)
47+
raise SystemError("PyThreadState_SetAsyncExc failed")
48+
49+
2350
class AbortCommand(DebuggerCommand):
2451
"""**abort**
2552
@@ -62,9 +89,9 @@ def threaded_quit(self, arg):
6289

6390
def run(self, args):
6491
threading_list = threading.enumerate()
65-
if (
66-
len(threading_list) == 1 or self.debugger.from_ipython
67-
) and threading_list[0].name == "MainThread":
92+
if (len(threading_list) == 1 or self.debugger.from_ipython) and threading_list[
93+
0
94+
].name == "MainThread":
6895
# We are in a main thread and either there is one thread or
6996
# we or are in ipython, so that's safe to quit.
7097
return self.nothread_quit(args)
@@ -73,17 +100,18 @@ def run(self, args):
73100
return
74101

75102

76-
77103
trepan_cmdproc.PASSTHROUGH_EXCEPTIONS.add(AbortInterrupt)
104+
105+
78106
def setup(debugger, instance):
79107
"""
80108
Setup we need to do in order to make the Mathics3 Debugger code in ``instance`` work in the
81109
trepan3k debugger object ``debugger``
82110
"""
83111
# Make sure we hook into debugger interface
84-
print("mabort setup")
85112
instance.debugger.intf = debugger.intf
86-
trepan_cmdproc.PASSTHROUGH_EXCEPTIONS.add(AbortInterrupt)
113+
# trepan_cmdproc.PASSTHROUGH_EXCEPTIONS.add(AbortInterrupt)
114+
87115

88116
# Demo it
89117
if __name__ == "__main__":

trepan3k_mathics3/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# debugger version number.
66

77
# fmt: off
8-
__version__="1.0.1.dev0" # noqa
8+
__version__="1.1.0" # noqa

0 commit comments

Comments
 (0)