Skip to content

Commit d97eb13

Browse files
committed
Get ready for release 1.1.2
Add Settings`MathicsScriptVersion.
1 parent cc639e5 commit d97eb13

File tree

9 files changed

+55
-6
lines changed

9 files changed

+55
-6
lines changed

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
1.1.2
2+
-----
3+
4+
* Fix ``Settings`$ShowFullForm`` now that we use Mathics supports Booleans better
5+
* Show mathicsscript version on startup
6+
* Add ``Settings`MathicsScriptVersion`
7+
18
1.1.1
29
-----
310

@@ -10,6 +17,7 @@
1017
* Toleratte MS/Windows pyreadline which doesn't handle `remove_history_item`
1118
* Show pygments styles when an invalid one is given
1219
* Use "inkpot" for dark backgrounds and "colorful" for light backgrounds.
20+
* Add ``Settings`PygementsStylesAvailable``
1321
* Add settings.m to holds `mathicsscript`-specific definitions `Settings` and their default values. Settings include
1422
- ``Settings`$ShowFullFormInput``
1523
- ``Settings`$PygmentsStyle``

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
|CI status| |Pypi Installs| |Latest Version| |Supported Python Versions|
22

3-
mathicsscript is a command-line interface to Mathics.
3+
mathicsscript is a command-line interface to `Mathics <https://mathics.org>`_.
44

55
|screenshot|
66

@@ -26,7 +26,7 @@ To install, run
2626

2727
$ make install
2828

29-
To install from git shources so that you run from the git source tree:
29+
To install from git sources so that you run from the git source tree:
3030

3131

3232
::

admin-tools/pyenv-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ if [[ $0 == ${BASH_SOURCE[0]} ]] ; then
55
echo "This script should be *sourced* rather than run directly through bash"
66
exit 1
77
fi
8-
export PYVERSIONS='3.6.12 3.7.9 3.8.6 3.9.0'
8+
export PYVERSIONS='3.6.12 3.7.9 3.8.6 3.9.1'

mathicsscript/__main__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ def main(
306306
definitions.set_ownvalue(
307307
"Settings`$PygmentsShowTokens", from_python(pygments_tokens)
308308
)
309-
309+
definitions.set_ownvalue("Settings`MathicsScriptVersion", from_python(__version__))
310+
definitions.set_attribute("Settings`MaticsScriptVersion", "System`Protected")
311+
definitions.set_attribute("Settings`MaticsScriptVersion", "System`Locked")
310312
TeXForm = Symbol("System`TeXForm")
311313

312314
definitions.set_line_no(0)

mathicsscript/settings.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@
2121

2222
Settings`$PygmentsShowTokens = False
2323

24-
Settings`$PygmentsStyle::usage = "This Boolean variable sets whether Unicode is used in terminal input and output."
24+
Settings`$UseUnicode::usage = "This Boolean variable sets whether Unicode is used in terminal input and output."
2525
Settings`$UseUnicode = True
26+
27+
Settings`MathicsScriptVersion::usage = "This string is the version of MathicsScript we are running."

mathicsscript/termshell.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,9 @@ def __init__(
217217
Symbol("Settings`PygmentsStylesAvailable"),
218218
from_python("usage"),
219219
),
220-
from_python("Lists the available styles for Pygment"),
220+
from_python(
221+
"A list of Pygments style that are valid in Settings`$PygmentsStyle."
222+
),
221223
),
222224
)
223225
self.definitions.set_attribute(

test/__init__.py

Whitespace-only changes.

test/helper.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from mathics.core.parser import parse, SingleLineFeeder
2+
from mathics.core.definitions import Definitions
3+
from mathics.core.evaluation import Evaluation
4+
from mathics.session import MathicsSession
5+
6+
session = MathicsSession(add_builtin=True, catch_interrupt=False)
7+
8+
9+
def check_evaluation(str_expr: str, str_expected: str, message=""):
10+
"""Helper function to test that a WL expression against
11+
its results"""
12+
result = session.evaluate(str_expr)
13+
expected = session.evaluate(str_expected)
14+
15+
if message:
16+
assert result == expected, "%s: got: %s" % (message, result)
17+
else:
18+
assert result == expected

test/test_settings.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -*- coding: utf-8 -*-
2+
from .helper import session
3+
4+
5+
def test_settings():
6+
# FIXME: this is a start, but we should do more
7+
for setting in (
8+
"Settings`$ShowFullFormInput::usage",
9+
"Settings`$ShowFullFormInput",
10+
"Settings`$PygmentsStyle::usage",
11+
"Settings`$PygmentsShowTokens::usage",
12+
"Settings`$PygmentsShowTokens",
13+
"Settings`$UseUnicode::usage",
14+
"Settings`$UseUnicode",
15+
"Settings`MathicsScriptVersion::usage",
16+
):
17+
assert session.evaluate(setting), setting

0 commit comments

Comments
 (0)