diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 23deebe9..9d1b0daf 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -15,9 +15,11 @@ jobs: unittest: runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [windows-latest, ubuntu-22.04, macos-latest] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + # https://devguide.python.org/versions/ + python-version: ["3.10", "3.11", "3.12", "3.13"] exclude: - os: windows-latest python-version: "3.11" @@ -25,7 +27,7 @@ jobs: python-version: "3.12" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: @@ -36,9 +38,18 @@ jobs: pip install .[dev] - name: Test with pytest env: - MPLBACKEND: TkAgg + MPLBACKEND: Agg run: | - pytest -s --ignore=W605 --timeout=50 --timeout_method=thread + pytest -s --timeout=50 --timeout_method=thread + + all-unittests-passed: + needs: unittest + if: always() + runs-on: ubuntu-latest + steps: + - name: Check unittest status + if: ${{ needs.unittest.result != 'success' }} + run: exit 1 codecov: # If all tests pass: @@ -46,11 +57,11 @@ jobs: needs: unittest runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - uses: actions/checkout@v4 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip @@ -61,7 +72,7 @@ jobs: coverage report coverage xml - name: upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: file: ./coverage.xml sphinx: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 89717352..ececa43e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,10 +16,10 @@ jobs: max-parallel: 2 matrix: os: [ubuntu-22.04] - python-version: [3.8] + python-version: [3.12] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 45105ee5..eb05fff7 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-22.04 if: ${{ github.event_name != 'pull_request' }} steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - uses: actions/checkout@v4 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.12 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/tests/base/test_transforms3d_plot.py b/tests/base/test_transforms3d_plot.py index f250df4a..1f05806e 100755 --- a/tests/base/test_transforms3d_plot.py +++ b/tests/base/test_transforms3d_plot.py @@ -14,6 +14,7 @@ from math import pi import math from scipy.linalg import logm, expm +import os import pytest import sys @@ -25,8 +26,9 @@ class Test3D(unittest.TestCase): @pytest.mark.skipif( - sys.platform.startswith("darwin") and sys.version_info < (3, 11), - reason="tkinter bug with mac", + os.environ.get("CI") == "true" + or (sys.platform.startswith("darwin") and sys.version_info < (3, 11)), + reason="no display in CI / tkinter bug on mac", ) def test_plot(self): plt.figure() @@ -72,8 +74,9 @@ def test_plot(self): plt.close("all") @pytest.mark.skipif( - sys.platform.startswith("darwin") and sys.version_info < (3, 11), - reason="tkinter bug with mac", + os.environ.get("CI") == "true" + or (sys.platform.startswith("darwin") and sys.version_info < (3, 11)), + reason="no display in CI / tkinter bug on mac", ) def test_animate(self): tranimate(transl(1, 2, 3), repeat=False, wait=True) diff --git a/tests/test_spline.py b/tests/test_spline.py index 9f27c608..1a8ae0e8 100644 --- a/tests/test_spline.py +++ b/tests/test_spline.py @@ -1,3 +1,6 @@ +import os +import pytest + import numpy.testing as nt import numpy as np import matplotlib.pyplot as plt @@ -25,6 +28,7 @@ def test_evaluation(self): nt.assert_almost_equal(spline(0).A, self.control_poses[0].A) nt.assert_almost_equal(spline(1).A, self.control_poses[-1].A) + @pytest.mark.skipif(os.environ.get("CI") == "true", reason="no display in CI") def test_visualize(self): spline = BSplineSE3(self.control_poses) spline.visualize( @@ -65,6 +69,7 @@ def test_small_delta_t(self): np.linspace(0, InterpSplineSE3._e, len(self.waypoints)), self.waypoints ) + @pytest.mark.skipif(os.environ.get("CI") == "true", reason="no display in CI") def test_visualize(self): spline = InterpSplineSE3(self.times, self.waypoints) spline.visualize( @@ -105,8 +110,9 @@ def test_spline_fit(self): assert fit.max_angular_error() < np.deg2rad(5.0) assert fit.max_angular_error() < 0.1 - spline.visualize( - sample_times=np.linspace(0, self.time_horizon, 100), - animate=True, - repeat=False, - ) + if os.environ.get("CI") != "true": + spline.visualize( + sample_times=np.linspace(0, self.time_horizon, 100), + animate=True, + repeat=False, + )