From 3fddda239ea4bf91c2059bbdbcbbc69f7ab20d57 Mon Sep 17 00:00:00 2001 From: John Harwell Date: Wed, 21 Aug 2024 11:21:23 -0500 Subject: [PATCH] feature(#315): Support python 3.10 - Preliminary --- .../actions/sample-project-setup/action.yml | 79 +++++++++--- .github/actions/sierra-setup/action.yml | 13 +- .github/workflows/analysis-nox.yml | 121 ++++++++++++++++++ .github/workflows/analysis.yml | 33 +++++ .github/workflows/coverage.yml | 19 ++- .../{integration-all.yml => integration.yml} | 55 +++++--- .../workflows/{argos.yml => plugin-argos.yml} | 88 ++++++++++++- ...ec-env-plugins.yml => plugin-exec-env.yml} | 2 +- .../{ros1gazebo.yml => plugin-ros1gazebo.yml} | 2 +- .../{ros1robot.yml => plugin-ros1robot.yml} | 2 +- .github/workflows/sierra-core.yml | 121 ++++++++++++++++-- .github/workflows/static-analysis.yml | 38 ------ .github/workflows/unit-tests.yml | 16 ++- docs/conf.py | 6 +- docs/requirements.txt | 4 +- docs/src/getting_started.rst | 1 + docs/src/requirements.rst | 4 +- docs/src/trial.rst | 3 +- docs/src/usage/subprograms.rst | 4 + noxfile.py | 19 ++- setup.py | 1 + sierra/core/config.py | 2 +- sierra/core/graphs/heatmap.py | 2 +- sierra/core/startup.py | 4 +- sierra/core/utils.py | 2 +- sierra/version.py | 2 +- 26 files changed, 510 insertions(+), 133 deletions(-) create mode 100644 .github/workflows/analysis-nox.yml create mode 100644 .github/workflows/analysis.yml rename .github/workflows/{integration-all.yml => integration.yml} (54%) rename .github/workflows/{argos.yml => plugin-argos.yml} (71%) rename .github/workflows/{exec-env-plugins.yml => plugin-exec-env.yml} (98%) rename .github/workflows/{ros1gazebo.yml => plugin-ros1gazebo.yml} (98%) rename .github/workflows/{ros1robot.yml => plugin-ros1robot.yml} (98%) delete mode 100644 .github/workflows/static-analysis.yml diff --git a/.github/actions/sample-project-setup/action.yml b/.github/actions/sample-project-setup/action.yml index 02dbaeef..49e07c22 100644 --- a/.github/actions/sample-project-setup/action.yml +++ b/.github/actions/sample-project-setup/action.yml @@ -18,7 +18,7 @@ runs: working-directory: ../../ run: | if [ ! -d sierra-sample-project ]; then - git clone https://github.com/swarm-robotics/sierra-sample-project.git + git clone https://github.com/jharwell/sierra-sample-project.git cd sierra-sample-project else cd sierra-sample-project @@ -41,13 +41,34 @@ runs: # dependencies these packages requires manual intervention to fix, and I # don't have a mac. if [ "${{ runner.os }}" == "macOS" ]; then - brew install pkg-config cmake libpng freeimage lua qt \ - docbook asciidoc graphviz doxygen|| true + brew install \ + pkg-config \ + cmake \ + libpng \ + freeimage \ + lua \ + qt \ + docbook \ + asciidoc \ + graphviz \ + doxygen \ + || true elif [ "${{ runner.os }}" == "Linux" ]; then sudo apt-get update - sudo apt-get install cmake libfreeimage-dev libfreeimageplus-dev \ - qt5-default freeglut3-dev libxi-dev libxmu-dev liblua5.3-dev \ - lua5.3 doxygen graphviz libgraphviz-dev asciidoc + sudo apt-get install -y \ + cmake \ + libfreeimage-dev \ + libfreeimageplus-dev \ + qtbase5-dev \ + freeglut3-dev \ + libxi-dev \ + libxmu-dev \ + liblua5.3-dev \ + lua5.3 \ + doxygen \ + graphviz \ + libgraphviz-dev \ + asciidoc fi - name: Install ARGoS @@ -86,24 +107,42 @@ runs: working-directory: ../.. shell: bash run: | - sudo apt-get install ros-${{ inputs.rosdistro }}-desktop-full - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-description - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-msgs - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-gazebo - sudo apt-get install ros-${{ inputs.rosdistro }}-turtlebot3-bringup - sudo apt-get install python${{ matrix.python-version }} python${{ matrix.python-version }}-dev - sudo apt-get install python${{ matrix.python-version }}-venv python3-apt - sudo apt-get install python3-pip python3-cairo intltool python3-wheel python3-rospkg python3-empy + sudo apt-get install -y \ + ros-${{ inputs.rosdistro }}-desktop-full \ + ros-${{ inputs.rosdistro }}-turtlebot3-description \ + ros-${{ inputs.rosdistro }}-turtlebot3-msgs \ + ros-${{ inputs.rosdistro }}-turtlebot3-gazebo \ + ros-${{ inputs.rosdistro }}-turtlebot3-bringup \ + python${{ matrix.python-version }} \ + python${{ matrix.python-version }}-dev \ + python${{ matrix.python-version }}-venv \ + python3-apt \ + python3-pip \ + python3-cairo \ + intltool \ + python3-wheel \ + python3-rospkg \ + python3-empy + # 2023/1/18: You still need install these even after installing stuff # with apt AND if the sysem python matches your current python. I don't # know why. - pip3 install empy - pip3 install rospkg wheel pyparsing pyqt5 - pip3 install pyqt5 pysip numpy rospkg - pip3 install matplotlib pyyaml psutil - pip3 install pysip defusedxml pyparsing pydev - pip3 install pyopengl opencv-python + pip3 install empy \ + rospkg \ + wheel \ + pyparsing \ + pyqt5 \ + pysip \ + numpy \ + matplotlib \ + pyyaml \ + psutil \ + defusedxml \ + pyparsing \ + pydev \ + pyopengl \ + opencv-python - name: Install SIERRA ROSBridge dependency (ubuntu) if: inputs.platform == 'ros1gazebo' diff --git a/.github/actions/sierra-setup/action.yml b/.github/actions/sierra-setup/action.yml index d5c7abca..71f01049 100644 --- a/.github/actions/sierra-setup/action.yml +++ b/.github/actions/sierra-setup/action.yml @@ -16,7 +16,7 @@ runs: # Ubuntu setup ############################################################################ - name: Setup python (ubuntu) - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 if: runner.os == 'Linux' with: python-version: ${{ matrix.python-version }} @@ -26,8 +26,9 @@ runs: shell: bash run: | sudo apt-get update - sudo apt-get install parallel cm-super texlive-fonts-recommended - sudo apt-get install texlive-latex-extra dvipng pssh ffmpeg xvfb + sudo apt-get install parallel cm-super texlive-fonts-recommended -y + sudo apt-get install texlive-latex-extra dvipng pssh ffmpeg xvfb -y + python3 -m pip install --upgrade pip python3 -m pip install wheel @@ -36,7 +37,7 @@ runs: ############################################################################ - name: Setup python (OSX) - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 if: runner.os == 'macOS' with: python-version: ${{ matrix.python-version }} @@ -55,8 +56,8 @@ runs: brew update && brew install parallel pssh ffmpeg brew update && brew install --cask mactex brew update && brew install --cask xquartz - python -m pip install --upgrade pip - python -m pip install wheel + python3 -m pip install --upgrade pip + python3 -m pip install wheel ############################################################################ # SIERRA install diff --git a/.github/workflows/analysis-nox.yml b/.github/workflows/analysis-nox.yml new file mode 100644 index 00000000..b49cfea2 --- /dev/null +++ b/.github/workflows/analysis-nox.yml @@ -0,0 +1,121 @@ +name: OS Static Analysis + +on: + workflow_call: + inputs: + os: + required: True + type: string + +jobs: + nox-lint: + runs-on: ${{ inputs.os }} + strategy: + matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. + python-version: + - 3.8 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + + - name: Run nox + run: | + nox --pythons ${{ matrix.python-version }} --sessions lint + + nox-docs: + runs-on: ${{ inputs.os }} + strategy: + matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. + python-version: + - 3.8 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + + - name: Run nox + run: | + nox --pythons ${{ matrix.python-version }} --sessions docs + + nox-pytype: + runs-on: ${{ inputs.os }} + strategy: + matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. + python-version: + - 3.8 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + + - name: Run nox + run: | + nox --pythons ${{ matrix.python-version }} --sessions analyze_pytype + + nox-pytype: + runs-on: ${{ inputs.os }} + strategy: + matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. + python-version: + - 3.8 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/sierra-setup + + - name: Run nox + run: | + nox --pythons ${{ matrix.python-version }} --sessions analyze_mypy diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 00000000..e354839d --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,33 @@ +name: Static Analysis Top-level + +# Run: +# +# - Every month. Scheduling helps keep drift/issues with updates +# to runners at bay. +# - On pushes. +on: + push: + paths: + - 'sierra/**' + + schedule: + - cron: '0 0 1 * *' + +jobs: + analyze-ci-ubuntu-2004: + uses: ./.github/workflows/analysis-nox.yml + secrets: inherit + with: + os: ubuntu-20.04 + + analyze-ci-ubuntu-2204: + uses: ./.github/workflows/analysis-nox.yml + secrets: inherit + with: + os: ubuntu-22.04 + + analyze-ci-osx: + uses: ./.github/workflows/analysis-nox.yml + secrets: inherit + with: + os: macos-12 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 1cc0fe35..07081350 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,4 +1,4 @@ -name: Coverage CI +name: Coverage CI Top-level # Run: # @@ -17,32 +17,31 @@ concurrency: cancel-in-progress: true jobs: - argos-ci: - uses: ./.github/workflows/argos.yml + sierra-core-ci: + uses: ./.github/workflows/sierra-core.yml secrets: inherit with: os: ubuntu-20.04 - ros1gazebo-ci: - uses: ./.github/workflows/ros1gazebo.yml + argos-ci: + uses: ./.github/workflows/plugin-argos.yml secrets: inherit with: os: ubuntu-20.04 - sierra-core-ci: - uses: ./.github/workflows/sierra-core.yml + ros1gazebo-ci: + uses: ./.github/workflows/plugin-ros1gazebo.yml secrets: inherit with: os: ubuntu-20.04 - ros1robot-ci: - uses: ./.github/workflows/ros1robot.yml + uses: ./.github/workflows/plugin-ros1robot.yml secrets: inherit with: os: ubuntu-20.04 exec-env-ci: - uses: ./.github/workflows/exec-env-plugins.yml + uses: ./.github/workflows/plugin-exec-env.yml secrets: inherit with: os: ubuntu-20.04 diff --git a/.github/workflows/integration-all.yml b/.github/workflows/integration.yml similarity index 54% rename from .github/workflows/integration-all.yml rename to .github/workflows/integration.yml index 1eff0f23..cc5fb3ed 100644 --- a/.github/workflows/integration-all.yml +++ b/.github/workflows/integration.yml @@ -1,4 +1,4 @@ -name: Integration Tests +name: Integration Top-level # Run: # @@ -14,44 +14,56 @@ on: - cron: '0 0 1 * *' jobs: - argos-ci-ubuntu: - uses: ./.github/workflows/argos.yml + sierra-core-ci-ubuntu-2004: + uses: ./.github/workflows/sierra-core.yml secrets: inherit with: os: ubuntu-20.04 - argos-ci-osx: - uses: ./.github/workflows/argos.yml + sierra-core-ci-ubuntu-2204: + uses: ./.github/workflows/sierra-core.yml secrets: inherit with: - os: macos-12 + os: ubuntu-22.04 - sierra-core-ci-ubuntu: + sierra-core-ci-osx: uses: ./.github/workflows/sierra-core.yml secrets: inherit + with: + os: macos-12 + + argos-ci-ubuntu-2004: + uses: ./.github/workflows/plugin-argos.yml + secrets: inherit with: os: ubuntu-20.04 - sierra-core-ci-osx: - uses: ./.github/workflows/sierra-core.yml + argos-ci-ubuntu-2204: + uses: ./.github/workflows/plugin-argos.yml + secrets: inherit + with: + os: ubuntu-22.04 + + argos-ci-osx: + uses: ./.github/workflows/plugin-argos.yml secrets: inherit with: os: macos-12 - ros1gazebo-ci-ubuntu: - uses: ./.github/workflows/ros1gazebo.yml + ros1gazebo-ci-ubuntu-2004: + uses: ./.github/workflows/plugin-ros1gazebo.yml secrets: inherit with: os: ubuntu-20.04 - ros1robot-ci-ubuntu: - uses: ./.github/workflows/ros1robot.yml + ros1robot-ci-ubuntu-2004: + uses: ./.github/workflows/plugin-ros1robot.yml secrets: inherit with: os: ubuntu-20.04 - exec-env-ci-ubuntu: - uses: ./.github/workflows/exec-env-plugins.yml + exec-env-ci-ubuntu-2004: + uses: ./.github/workflows/plugin-exec-env.yml secrets: inherit with: os: ubuntu-20.04 @@ -63,13 +75,16 @@ jobs: python-version: - 3.8 needs: - - argos-ci-ubuntu + - argos-ci-ubuntu-2004 + - argos-ci-ubuntu-2204 - argos-ci-osx - - sierra-core-ci-ubuntu + - sierra-core-ci-ubuntu-2004 + - sierra-core-ci-ubuntu-2204 - sierra-core-ci-osx - - ros1gazebo-ci-ubuntu - - ros1robot-ci-ubuntu - - exec-env-ci-ubuntu + - ros1gazebo-ci-ubuntu-2004 + - ros1gazebo-ci-ubuntu-2004 + - ros1robot-ci-ubuntu-2004 + - exec-env-ci-ubuntu-2004 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/argos.yml b/.github/workflows/plugin-argos.yml similarity index 71% rename from .github/workflows/argos.yml rename to .github/workflows/plugin-argos.yml index 0366ab59..e07971ba 100644 --- a/.github/workflows/argos.yml +++ b/.github/workflows/plugin-argos.yml @@ -1,5 +1,5 @@ # Only stuff that actually tests the platform should be here: stage 1 and 2. -name: ARGoS CI Tests +name: ARGoS Plugin CI on: workflow_call: @@ -13,9 +13,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -41,9 +53,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -69,9 +93,22 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -96,9 +133,22 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -124,9 +174,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -152,9 +214,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/exec-env-plugins.yml b/.github/workflows/plugin-exec-env.yml similarity index 98% rename from .github/workflows/exec-env-plugins.yml rename to .github/workflows/plugin-exec-env.yml index f0367572..f065c7ce 100644 --- a/.github/workflows/exec-env-plugins.yml +++ b/.github/workflows/plugin-exec-env.yml @@ -1,4 +1,4 @@ -name: --exec-env plugin CI +name: --exec-env Plugin CI on: workflow_call: diff --git a/.github/workflows/ros1gazebo.yml b/.github/workflows/plugin-ros1gazebo.yml similarity index 98% rename from .github/workflows/ros1gazebo.yml rename to .github/workflows/plugin-ros1gazebo.yml index 57b27d3a..1d1716b4 100644 --- a/.github/workflows/ros1gazebo.yml +++ b/.github/workflows/plugin-ros1gazebo.yml @@ -1,5 +1,5 @@ # Only stuff that actually tests the platform should be here: stage 1 and 2. -name: ROS1+Gazebo CI Tests +name: ROS1+Gazebo plugin CI on: workflow_call: diff --git a/.github/workflows/ros1robot.yml b/.github/workflows/plugin-ros1robot.yml similarity index 98% rename from .github/workflows/ros1robot.yml rename to .github/workflows/plugin-ros1robot.yml index 3cde7a14..da4e2c97 100644 --- a/.github/workflows/ros1robot.yml +++ b/.github/workflows/plugin-ros1robot.yml @@ -1,5 +1,5 @@ # Only stuff that actually tests the platform should be here: stage 1 and 2. -name: ROS1+Robot CI Tests +name: ROS1+Robot plugin CI on: workflow_call: diff --git a/.github/workflows/sierra-core.yml b/.github/workflows/sierra-core.yml index 041cdebc..f625b654 100644 --- a/.github/workflows/sierra-core.yml +++ b/.github/workflows/sierra-core.yml @@ -12,9 +12,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -40,9 +52,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -68,6 +92,9 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + python-version: - 3.8 - 3.9 @@ -111,9 +138,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -154,9 +193,22 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -181,9 +233,22 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -208,9 +273,22 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -235,9 +313,22 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup @@ -262,9 +353,23 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 + steps: - uses: actions/checkout@v3 - uses: ./.github/actions/sierra-setup diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml deleted file mode 100644 index 884ef641..00000000 --- a/.github/workflows/static-analysis.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Static Analysis - -# Run: -# -# - Every month. Scheduling helps keep drift/issues with updates -# to runners at bay. -# - On pushes. -on: - push: - paths: - - 'sierra/**' - schedule: - - cron: '0 0 1 * *' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - analyze: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-20.04 # ubuntu-latest, as of 8/22 - - macos-12 - - python-version: - - 3.8 - - 3.9 - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/sierra-setup - - - name: Run nox - run: | - nox --pythons ${{ matrix.python-version }} --sessions lint analysis docs diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f9537b80..866a853f 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,4 +1,4 @@ -name: Unit Tests +name: Unit Tests Top-level on: workflow_call: @@ -12,9 +12,21 @@ jobs: runs-on: ${{ inputs.os }} strategy: matrix: + os: + - ${{ inputs.os }} + + # 2024/08/26: Test the earliest and latest supported version, to speed + # up CI. python-version: - 3.8 - - 3.9 + - '3.10' + + exclude: + - python-version: '3.10' + os: ubuntu-20.04 + + - python-version: 3.8 + os: ubuntu-22.04 steps: - uses: actions/checkout@v3 diff --git a/docs/conf.py b/docs/conf.py index 8662810f..bd90beec 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -160,8 +160,8 @@ "https://www.cs.unm.edu/~wjust/CS523/S2018/Readings/Hecker_Beyond_Pheromones_Swarm_Intelligence.pdf"), "Rosenfeld2006": ("Rosenfeld2006", "http://users.umiacs.umd.edu/~sarit/data/articles/rosenfeldetalbook06.pdf"), - "SIERRA_GITHUB": ("https://github.com:jharwell/sierra.git", - "https://github.com:jharwell/sierra.git"), + "SIERRA_GITHUB": ("https://github.com/jharwell/sierra.git", + "https://github.com/jharwell/sierra.git"), "SIERRA_SAMPLE_PROJECT": ("https://github.com:jharwell/sierra-sample-project.git", "https://github.com:jharwell/sierra-sample-project.git"), "SIERRA_DOCS": ("https://sierra.readthedocs.io/en/master", @@ -310,7 +310,7 @@ 'sphinx': ('https://www.sphinx-doc.org/en/stable/', None), 'pandas': ('https://pandas.pydata.org/pandas-docs/dev', None), 'implements': ('https://implements.readthedocs.io/en/latest/', None), - 'libra': ('https://libra2.readthedocs.io/en/master', None) + 'libra': ('https://jharwell.github.io/libra', None) } # This is the expected signature of the handler for this event, cf doc diff --git a/docs/requirements.txt b/docs/requirements.txt index 64c9b616..72106916 100755 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,7 +1,7 @@ -e . -sphinx==4.4.0 -docutils==0.16 +sphinx==6.0.0 +docutils==0.19 sphinx-rtd-theme sphinx-argparse sphinx-tabs diff --git a/docs/src/getting_started.rst b/docs/src/getting_started.rst index 9c434bf9..25d5361c 100755 --- a/docs/src/getting_started.rst +++ b/docs/src/getting_started.rst @@ -48,6 +48,7 @@ Basic Setup - ``pssh`` - ``ffmpeg`` - ``xvfb`` + - ``psmisc`` .. group-tab:: OSX diff --git a/docs/src/requirements.rst b/docs/src/requirements.rst index 602328bb..68f44cd2 100644 --- a/docs/src/requirements.rst +++ b/docs/src/requirements.rst @@ -34,8 +34,8 @@ One of the following: Python Requirements =================== -Python 3.8+. Tested with 3.8-3.9. It may work for newer versions, probably won't -for older. +Python 3.8+. Tested with 3.8-3.10. It may work for newer versions, probably +won't for older. .. _ln-sierra-req-exp: diff --git a/docs/src/trial.rst b/docs/src/trial.rst index 8d81019a..f925bfe1 100755 --- a/docs/src/trial.rst +++ b/docs/src/trial.rst @@ -30,6 +30,7 @@ you clone things somewhere else. - ``pssh`` - ``ffmpeg`` - ``xvfb`` + - ``psmisc`` .. group-tab:: OSX @@ -92,7 +93,7 @@ you clone things somewhere else. Where ```` is replaced by your ROS distro. - #. Install the `SIERRA ROSBridge `_:: + #. Install the `SIERRA ROSBridge `_:: pip3 install catkin_tools git clone https://github.com/jharwell/sierra_rosbridge.git diff --git a/docs/src/usage/subprograms.rst b/docs/src/usage/subprograms.rst index fc70700a..ffdedb87 100755 --- a/docs/src/usage/subprograms.rst +++ b/docs/src/usage/subprograms.rst @@ -20,3 +20,7 @@ depending on what you are doing. - :program:`parallel-rsync` - Used during stage 1 when generating experiments experiments (:term:`ROS1+Robot` platform). + +- :program:`killall` - Used during stage 2 when running :term: + :term:`ARGoS`, :term:`ROS1+Gazebo` experiments to cleanup after each + experimental run. diff --git a/noxfile.py b/noxfile.py index 03ce9735..12f5fbcb 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,7 +23,7 @@ # Project packages -@nox.session(python=['3.8', '3.9']) +@nox.session(python=['3.8', '3.9', '3.10']) def lint(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' @@ -52,8 +52,8 @@ def lint(session): # venv argument needed so the apt module can be found in the nox venv on linux -@nox.session(python=['3.8', '3.9']) -def analysis(session): +@nox.session(python=['3.8', '3.9', '3.10']) +def analyze_pytype(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' @@ -65,6 +65,15 @@ def analysis(session): 'sierra', external=True) + +# venv argument needed so the apt module can be found in the nox venv on linux +@nox.session(python=['3.8', '3.9', '3.10']) +def analyze_mypy(session): + session.install('.') # same as 'pip3 install .' + session.install('.[devel]') # same as 'pip3 install .[devel]' + + cores = psutil.cpu_count() + session.run('mypyrun', '--select', # No syntax errors @@ -126,7 +135,7 @@ def analysis(session): 'sierra') -@nox.session(python=['3.8', '3.9']) +@nox.session(python=['3.8', '3.9', '3.10']) def docs(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' @@ -147,7 +156,7 @@ def docs(session): 'sierra') -@nox.session(python=['3.8', '3.9']) +@nox.session(python=['3.8', '3.9', '3.10']) def unit_tests(session): session.install('.') # same as 'pip3 install .' session.install('.[devel]') # same as 'pip3 install .[devel]' diff --git a/setup.py b/setup.py index fc151c29..30d92571 100644 --- a/setup.py +++ b/setup.py @@ -56,6 +56,7 @@ # "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: MacOS :: MacOS X", diff --git a/sierra/core/config.py b/sierra/core/config.py index 9f760c0a..7b6d1956 100755 --- a/sierra/core/config.py +++ b/sierra/core/config.py @@ -45,7 +45,7 @@ def mpl_init(): import matplotlib.pyplot as plt # Set MPL style - plt.style.use('seaborn-colorblind') + plt.style.use('seaborn-v0_8-colorblind') # Actually initialize matplotlib diff --git a/sierra/core/graphs/heatmap.py b/sierra/core/graphs/heatmap.py index 5559a558..0fbf5c09 100755 --- a/sierra/core/graphs/heatmap.py +++ b/sierra/core/graphs/heatmap.py @@ -211,7 +211,7 @@ def generate(self) -> None: # Scaffold graph. We can use either dataframe for setting the graph # size; we assume they have the same dimensions. # - fig, axes = plt.subplots(ncols=2) + fig, axes = plt.subplots(nrows=1, ncols=2) Heatmap.set_graph_size(dfs[0], fig) y = np.arange(len(dfs[0].columns)) diff --git a/sierra/core/startup.py b/sierra/core/startup.py index 977d84c9..ecb7fb58 100644 --- a/sierra/core/startup.py +++ b/sierra/core/startup.py @@ -74,8 +74,8 @@ def _linux_pkg_checks() -> None: dist = distro.id() os_info = distro.os_release_info() - if any(candidate in os_info['id_like'] for candidate in ['debian', - 'ubuntu']): + if any(candidate in os_info['id'] for candidate in ['debian', + 'ubuntu']): _apt_pkg_checks(dist) else: logging.warning(("Unknown Linux distro '%s' detected: skipping package " diff --git a/sierra/core/utils.py b/sierra/core/utils.py index c2708bb0..156a200f 100755 --- a/sierra/core/utils.py +++ b/sierra/core/utils.py @@ -365,7 +365,7 @@ def df_fill(df: pd.DataFrame, policy: str) -> pd.DataFrame: @retry(OSError, tries=10, delay=0.100, backoff=1.1) # type:ignore -def pickle_dump(obj: object, f: tp.IO) -> None: +def pickle_dump(obj: object, f) -> None: pickle.dump(obj, f) diff --git a/sierra/version.py b/sierra/version.py index 80604bc8..d4be2b36 100644 --- a/sierra/version.py +++ b/sierra/version.py @@ -9,4 +9,4 @@ # Project packages -__version__ = "1.3.5" +__version__ = "1.3.6"