From 7470e1263a754014f8971719b900ea220bc57160 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Tue, 13 Feb 2024 14:11:23 -0800 Subject: [PATCH 1/3] Adds TeamCity build badges and minor cleanup of README.md --- .gitignore | 1 + .idea/.gitignore | 5 ----- README.md | 36 ++++++++++++++++++++++-------------- 3 files changed, 23 insertions(+), 19 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.gitignore b/.gitignore index 9ad0ef7..8a4720c 100644 --- a/.gitignore +++ b/.gitignore @@ -105,4 +105,5 @@ ENV/ .vscode # IntelliJ +.idea/ *.iml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 2fcc1c5..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# JetBrains -misc.xml -modules.xml -vcs.xml -workspace.xml diff --git a/README.md b/README.md index c347495..51af81b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,14 @@ [![Build Status](https://github.com/inorbit-ai/edge-sdk-python/workflows/Build%20Main/badge.svg)](https://github.com/inorbit-ai/edge-sdk-python/actions) [![Code Coverage](https://codecov.io/gh/inorbit/edge-sdk-python/branch/main/graph/badge.svg)](https://codecov.io/gh/inorbit/edge-sdk-python) -The `InOrbit Edge SDK` allows Python programs to communicate with `InOrbit` platform on behalf of robots - providing robot data and handling robot actions. It's goal is to ease the integration between `InOrbit` and any other software that handles robot data. +| Python 3.8 | Python 3.9 | Python 3.10 | Python 3.11 | +|:-----------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------:| +| ![TeamCity](https://inorbit.teamcity.com/app/rest/builds/buildType:id:DeveloperPortal_EdgeSdkPython_Python38QualityRunner/statusIcon.svg) | ![TeamCity](https://inorbit.teamcity.com/app/rest/builds/buildType:id:DeveloperPortal_EdgeSdkPython_Python39QualityRunner/statusIcon.svg) | ![TeamCity](https://inorbit.teamcity.com/app/rest/builds/buildType:id:DeveloperPortal_EdgeSdkPython_Python310QualityRunner/statusIcon.svg) | ![TeamCity](https://inorbit.teamcity.com/app/rest/builds/buildType:id:DeveloperPortal_EdgeSdkPython_Python311QualityRunner/statusIcon.svg) | + +The `InOrbit Edge SDK` allows Python programs to communicate with `InOrbit` +platform on behalf of robots - providing robot data and handling robot actions. +Its goal is to ease the integration between `InOrbit` and any other software +that handles robot data. --- @@ -31,11 +38,11 @@ def my_command_handler(robot_id, command_name, args, options): command_name (str): InOrbit command e.g. 'customCommand' args (list): Command arguments options (dict): object that includes - - `result_function` can be called to report command execution result. It - has the following signature: `result_function(return_code)`. - - `progress_function` can be used to report command output and has the - following signature: `progress_function(output, error)`. - - `metadata` is reserved for the future and will contains additional + - `result_function` can be called to report command execution + result with the following signature: `result_function(return_code)` + - `progress_function` can be used to report command output with + the following signature: `progress_function(output, error)` + - `metadata` is reserved for the future and will contain additional information about the received command request. """ if command_name == "customCommand": @@ -50,7 +57,7 @@ robot_session_factory = RobotSessionFactory( # Register commands handlers. Note that all handlers are invoked. robot_session_factory.register_command_callback(my_command_handler) -robot_session_factory.register_executable_commands("./user_scripts", r".*\.sh") +robot_session_factory.register_commands_path("./user_scripts", r".*\.sh") robot_session_pool = RobotSessionPool(robot_session_factory) @@ -72,21 +79,22 @@ For full package documentation please visit [InOrbit Developer Portal](https://d ## Development -See [CONTRIBUTING.md](CONTRIBUTING.md) for information related to developing the code. +See [CONTRIBUTING.md](CONTRIBUTING.md) for information related to developing +the code. ## The Three Commands You Need To Know 1. `pip install -e .[dev]` - This will install your package in editable mode with all the required development - dependencies (i.e. `tox`). + This will install your package in editable mode with all the required + development dependencies (i.e. `tox`). 2. `make build` - This will run `tox` which will run all your tests in both Python 3.7 - and Python 3.8 as well as linting your code. + This will run `tox` which will run all your tests in Python 3.8 - 3.11 as + well as linting your code. 3. `make clean` - This will clean up various Python and build generated files so that you can ensure - that you are working in a clean environment. + This will clean up various Python and build generated files so that you can + ensure that you are working in a clean environment. From 87fb20dbb9349c875b73fae95fef7da066a33ff9 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Tue, 13 Feb 2024 14:24:42 -0800 Subject: [PATCH 2/3] Linux builds on TeamCity/updates supported Python versions --- .github/workflows/build-main.yml | 6 +++--- .github/workflows/test-and-lint.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 21b5fa3..33bb9a6 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: ['3.8', '3.9', '3.10', '3.11'] os: [windows-latest, macOS-latest] steps: @@ -42,7 +42,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' - name: Install Dependencies run: | python -m pip install --upgrade pip @@ -64,7 +64,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' - name: Install Dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/test-and-lint.yml b/.github/workflows/test-and-lint.yml index f09ef0f..999872a 100644 --- a/.github/workflows/test-and-lint.yml +++ b/.github/workflows/test-and-lint.yml @@ -7,8 +7,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [3.7, 3.8, 3.9] - os: [ubuntu-latest, windows-latest, macOS-latest] + python-version: ['3.8', '3.9', '3.10', '3.11'] + os: [windows-latest, macOS-latest] steps: - uses: actions/checkout@v1 @@ -34,7 +34,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v1 with: - python-version: 3.9 + python-version: '3.10' - name: Install Dependencies run: | python -m pip install --upgrade pip From ba000f69faebaff4fe9ccc9dd9b0d54f5f99ce61 Mon Sep 17 00:00:00 2001 From: Russell Toris Date: Tue, 13 Feb 2024 16:25:16 -0800 Subject: [PATCH 3/3] Liniting moved to TC --- .github/workflows/build-main.yml | 20 -------------------- .github/workflows/test-and-lint.yml | 20 -------------------- 2 files changed, 40 deletions(-) diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 33bb9a6..1c69c5b 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -34,26 +34,6 @@ jobs: - name: Upload codecov uses: codecov/codecov-action@v1 - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.10' - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install .[test] - - name: Lint with flake8 - run: | - flake8 inorbit_edge --count --verbose --show-source --statistics - - name: Check with black - run: | - black --check inorbit_edge --exclude inorbit_edge/inorbit_pb2.py - publish: if: "contains(github.event.head_commit.message, 'Bump version')" needs: [test, lint] diff --git a/.github/workflows/test-and-lint.yml b/.github/workflows/test-and-lint.yml index 999872a..af80ae7 100644 --- a/.github/workflows/test-and-lint.yml +++ b/.github/workflows/test-and-lint.yml @@ -25,23 +25,3 @@ jobs: pytest inorbit_edge/tests/ - name: Upload codecov uses: codecov/codecov-action@v1 - - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: '3.10' - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install .[test] - - name: Lint with flake8 - run: | - flake8 inorbit_edge --count --verbose --show-source --statistics - - name: Check with black - run: | - black --diff --check inorbit_edge --exclude inorbit_edge/inorbit_pb2.py