diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index 779f640..5c810c5 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -4,13 +4,19 @@ on: pull_request: paths: - '.github/workflows/python_tests.yml' - - 'tools/logunitas/**' + - 'bin/**' + - 'p1_runner/**' + - 'tests/**' + - 'requirements*.txt' push: branches: - - 'st-develop' + - 'internal' paths: - '.github/workflows/python_tests.yml' - - 'tools/logunitas/**' + - 'bin/**' + - 'p1_runner/**' + - 'tests/**' + - 'requirements*.txt' jobs: test: diff --git a/README.md b/README.md index c7dd639..6cf657a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,8 @@ + + + +
Build Status
Python Support
+ # Point One Host Tools Tools for interfacing with Point One FusionEngine devices from a host computer. These tools are compatible with Windows, macOS, and Linux. diff --git a/tests/test_syntax_compat.py b/tests/test_syntax_compat.py new file mode 100644 index 0000000..e10673a --- /dev/null +++ b/tests/test_syntax_compat.py @@ -0,0 +1,26 @@ +"""! +@brief Verify that user scripts compile cleanly on the current Python interpreter. + +Note that this only checks that the syntax is valid for the supported Python versions (e.g. match statements, X | Y +union types, walrus operator, etc.). It does not test that the code actually functions as intended. +""" + +import glob +import os +import py_compile +import pytest + +_REPO_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) + +_SCRIPTS = sorted( + p for p in ( + glob.glob(os.path.join(_REPO_ROOT, 'bin', '**', '*.py'), recursive=True) + + glob.glob(os.path.join(_REPO_ROOT, 'p1_runner', '**', '*.py'), recursive=True) + ) + if '__pycache__' not in p +) + +# Parametrize by repo-relative path for readable test IDs. +@pytest.mark.parametrize('path', _SCRIPTS, ids=[os.path.relpath(p, _REPO_ROOT) for p in _SCRIPTS]) +def test_compiles(path): + py_compile.compile(path, doraise=True)