diff --git a/.github/workflows/autoblack.yml b/.github/workflows/autoblack.yml index 40d7050..1b7863f 100644 --- a/.github/workflows/autoblack.yml +++ b/.github/workflows/autoblack.yml @@ -9,11 +9,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.11 - name: Install click run: pip install 'click==8.0.4' - name: Install Black diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 8713116..2be3ffd 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -12,11 +12,11 @@ jobs: strategy: matrix: os: [macOS] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7bb35a1..07da93c 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.9, 3.11] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 38151bb..547c4be 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,11 +12,11 @@ jobs: strategy: matrix: os: [windows] - python-version: [ 3.8, 3.9] + python-version: [ 3.9, 3.11] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/pymathics/hello/__init__.py b/pymathics/hello/__init__.py index e783221..95c5f92 100644 --- a/pymathics/hello/__init__.py +++ b/pymathics/hello/__init__.py @@ -28,7 +28,7 @@ """ from pymathics.hello.version import __version__ -from pymathics.hello.__main__ import Hello # noqa +from pymathics.hello.__main__ import Hello __all__ = ("__version__", "Hello", "pymathics_version_data") @@ -36,7 +36,7 @@ # is required: # pymathics_version_data = { - "author": "The Mathics Team", + "author": "The Mathics3 Team", "version": __version__, "requires": [], } diff --git a/pymathics/hello/__main__.py b/pymathics/hello/__main__.py index 589e73b..b27ead3 100644 --- a/pymathics/hello/__main__.py +++ b/pymathics/hello/__main__.py @@ -1,23 +1,38 @@ # -*- coding: utf-8 -*- from mathics.core.atoms import String from mathics.core.builtin import Builtin +from mathics.core.evaluation import Evaluation class Hello(Builtin): """
'Hello'[$person$] -
An example function in a Python-importable Mathics module. +
An example function in a Python-importable Mathics3 module.
- >> Hello["World"] + + See also the + :developer guide section: + https://mathics-development-guide.readthedocs.io/en/latest/extending/developing-code/extending/tutorial/1-builtin.html for an \ + explanation of everything. + + >> Hello[] = Hello, World! + + >> Hello["rocky"] + = Hello, rocky! """ + summary_text = """classic "hello" demo""" + # The function below should start with "apply" - def eval_with_name(self, person, evaluation): - "%(name)s[person_String]" - # %(name)s is just a more flexible way of writing "Hello". - # If the class name changes, so will the above pattern. + def eval(self, evaluation: Evaluation): + "Hello[]" + return String("Hello, World!") + + # The function below should start with "eval" + def eval_with_name(self, person: String, evaluation: Evaluation) -> String: + "Hello[person_String]" # The above pattern matches Hello with a single string argument. # See https://reference.wolfram.com/language/tutorial/Patterns.html#7301 # and https://reference.wolfram.com/language/ref/Cases.html