diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..9b57fe81 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,79 @@ +# Copyright (c) 2023 Boston Dynamics AI Institute, Inc. All rights reserved. + +name: CI + +on: + pull_request: + push: + branches: + - main + workflow_call: + secrets: + CODECOV_TOKEN: + required: true + +defaults: + run: + shell: bash + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}} + cancel-in-progress: true + +jobs: + lint: + strategy: + matrix: + config: + - { python: "3.8" } + - { python: "3.9" } + - { python: "3.10" } + name: Run pre-commit + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.config.python }} + + - name: Pre-commit + uses: pre-commit/action@v3.0.1 + + test_package: + strategy: + matrix: + config: + - { python: "3.8" } + - { python: "3.9" } + - { python: "3.10" } + name: Test spot_wrapper package + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.config.python }} + + - name: Pip installs + run: | + pip install -r requirements.txt + pip install -e . + + - name: Run tests + run: python -m pytest --cov=spot_wrapper spot_wrapper/tests/ + + - if: ${{ matrix.config.python }} == "3.10" + name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} + fail-on-error: true + flag-name: unittests + debug: true + files: $(find ../../ -name "coverage.xml" -type f) diff --git a/.github/workflows/graph_nav_util_test.yml b/.github/workflows/graph_nav_util_test.yml deleted file mode 100644 index 08636ac9..00000000 --- a/.github/workflows/graph_nav_util_test.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: graph_nav_util unit tests - -# Run on every push -on: push - -jobs: - test: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - - steps: - - name: Make directory - run: mkdir -p ~/spot_wrapper - - - name: Checkout repository - uses: actions/checkout@v3 - with: - path: spot_wrapper - - - name: Check files - run: ls spot_wrapper - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - - name: Install dependencies - run: | - pip install -r spot_wrapper/requirements.txt - pip install -e spot_wrapper - - - name: Run tests - run: pytest --junit-xml=test-results.xml - - - name: Surface failing tests - if: always() - uses: pmeier/pytest-summary-gha@main - with: - # A list of JUnit XML files, directories containing the former, and wildcard patterns to process. - path: test-results.xml - - # Add a summary of the results at the top of the report - summary: true - - # Select which results should be included in the report. - # Follows the same syntax as `pytest -r` - display-options: fEX - - # Fail the workflow if no JUnit XML was found. - fail-on-empty: true diff --git a/.github/workflows/util_pre-commit.yml b/.github/workflows/util_pre-commit.yml deleted file mode 100644 index e243ab50..00000000 --- a/.github/workflows/util_pre-commit.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2023 Boston Dynamics AI Institute, Inc. All rights reserved. - -name: Util - Pre-Commit Runner - -on: - push: - branches: - - main - pull_request: - branches: - - main - -concurrency: - group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}} - cancel-in-progress: true - -jobs: - pre-commit: - strategy: - matrix: - config: - - { python: "3.8" } - - { python: "3.9" } - - { python: "3.10" } - name: util_pre-commit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.config.python }} - - - uses: pre-commit/action@v3.0.1 diff --git a/README.md b/README.md index b978eafc..172da7aa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # Spot Wrapper +![Python](https://img.shields.io/badge/python-3.8|3.9|3.10-blue) +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) +[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) +[![CI](https://github.com/bdaiinstitute/spot_wrapper/workflows/CI/badge.svg)](https://github.com/bdaiinstitute/spot_wrapper/actions) +[![Coverage Status](https://coveralls.io/repos/github/bdaiinstitute/spot_wrapper/badge.svg?branch=main)](https://coveralls.io/github/bdaiinstitute/spot_wrapper?branch=main) +[![LICENSE](https://img.shields.io/badge/license-MIT-purple)](LICENSE) + This Python package is a wrapper around the [Boston Dynamics Spot SDK](https://dev.bostondynamics.com), intended as a united point of entry to the SDK for use with the [spot_ros](https://github.com/heuristicus/spot_ros) and [spot_ros2](https://github.com/bdaiinstitute/spot_ros2) packages. # Installation diff --git a/requirements.txt b/requirements.txt index e546b988..0bcfed98 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,14 @@ -bosdyn-core==4.0.0 +aiortc==1.5.0 +bosdyn-api==4.0.0 bosdyn-choreography-client==4.0.0 bosdyn-client==4.0.0 +bosdyn-core==4.0.0 bosdyn-mission==4.0.0 -bosdyn-api==4.0.0 -protobuf==4.22.1 -setuptools==59.6.0 -pytest==7.3.1 -aiortc==1.5.0 +grpcio==1.59.3 image==1.5.33 inflection==0.5.1 -grpcio==1.59.3 +protobuf==4.22.1 +pytest==7.3.1 +pytest-cov==4.1.0 +pytest-xdist==3.5.0 +setuptools==59.6.0