Skip to content

Commit 985ae96

Browse files
committed
Get ready for release 9.0.1
Change module name to Mathics3-Module-hello. Revise documentation.
1 parent d38217a commit 985ae96

File tree

7 files changed

+33
-13
lines changed

7 files changed

+33
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ clean-pyc:
4949

5050
#: Run py.test tests. Use environment variable "o" for pytest options
5151
pytest:
52-
py.test test $o
52+
pytest test $o
5353

5454

5555
# #: Make Mathics PDF manual

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
9.0.1
2+
-----
3+
4+
Change module name to Mathics3-Module-hello. Revise documentation.
5+
6+
17
9.0.0
28
-----
39

README.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ Then the function ```Hello[]`` is available::
1919
In[1]:= LoadModule["pymathics.hello"]
2020
Out[1]= pymathics.hello
2121

22-
In[2]:= Hello["World"]
22+
In[2]:= Hello[]
2323
Out[2]:= Hello, World!
2424

25-
You can test with ``py.test``::
25+
In[2]:= Hello["everyone"]
26+
Out[2]:= Hello, everyone!
2627

27-
$ py.test test
28+
You can test with ``pytest``::
29+
30+
$ pytest test
2831

2932
or simply::
3033

pymathics/hello/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
PyMathics Hello test module.
3+
Mathics3 Module hello module.
44
5-
This is an example of an external PyMathics module.
5+
This is an example of an external Mathics3 module.
66
7-
A PyMathics module is a Python module which can be loaded into Mathics using the
7+
A Mathics3 module is a Python module which can be loaded into Mathics using the
88
``LoadModule[]`` method.
99
1010
In particular, to load this after installing this module as a Python module run inside

pymathics/hello/__main__.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class Hello(Builtin):
1212
<dd>An example function in a Python-importable Mathics3 module.
1313
</dl>
1414
15-
>> PyMathics`Hello["World"]
15+
>> Hello["everyone"]
16+
= "Hello, everyone!"
1617
1718
See also the <url>
1819
:developer guide section:
@@ -26,6 +27,10 @@ class Hello(Builtin):
2627
= Hello, rocky!
2728
"""
2829

30+
# Set checking that the number of arguments required is zero or one.
31+
# eval_error = Builtin.generic_argument_error
32+
# expected_args = (0, 1)
33+
2934
summary_text = """classic "hello" demo"""
3035

3136
# The function below should start with "apply"
@@ -34,9 +39,15 @@ def eval(self, evaluation: Evaluation):
3439
return String("Hello, World!")
3540

3641
# The function below should start with "eval"
37-
def eval_with_name(self, person: String, evaluation: Evaluation) -> String:
38-
"Hello[person_String]"
39-
# The above pattern matches Hello with a single string argument.
42+
def eval_with_name(self, person, evaluation: Evaluation) -> String:
43+
"Hello[person_]"
44+
# The above pattern matches Hello with a argument.
4045
# See https://reference.wolfram.com/language/tutorial/Patterns.html#7301
4146
# and https://reference.wolfram.com/language/ref/Cases.html
47+
48+
# Check that "person" is a String.
49+
if not isinstance(person, String):
50+
evaluation.message("Hello", "string")
51+
return
52+
4253
return String(f"Hello, {person.value}!")

pymathics/hello/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# well as importing into Python. That's why there is no
66
# space around "=" below.
77
# fmt: off
8-
__version__="9.0.1.dev0" # noqa
8+
__version__="9.0.1" # noqa

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ requires = [
66
build-backend = "setuptools.build_meta"
77

88
[project]
9-
name = "Mathics3-hello"
9+
name = "Mathics3-Module-hello"
1010
description = 'Mathics3 Hello, World! module'
1111
dependencies = [
1212
"Mathics3-Module-Base >= 9.0.0",

0 commit comments

Comments
 (0)