Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/actions/install_python_packages/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ description: 'Install specified Python packages in a virtual environment'
inputs:
packages:
description: 'A space-separated list of Python packages to install.'
required: true
required: false
default: ''
requirements-file:
description: 'Path to a requirements.txt file listing Python packages to install.'
required: false
default: ''
python-version:
description: 'The Python version to use (e.g., 3.12).'
required: true
Expand Down Expand Up @@ -36,5 +41,12 @@ runs:

- name: Install Python packages
run: |
pip install ${{ inputs.packages }}
if [ -n "${{ inputs.requirements-file }}" ]; then
pip install -r ${{ inputs.requirements-file }}
fi

if [ -n "${{ inputs.packages }}" ]; then
pip install ${{ inputs.packages }}
fi

shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Install required python packages
uses: ./.github/actions/install_python_packages
with:
packages: "catkin_pkg lark-parser empy colcon-common-extensions"
requirements-file: "${{ github.workspace }}/requirements.txt"
python-version: ${{ inputs.python-version }}
use-sudo: "true"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sudo apt install -y rsync pip git gcc-arm-none-eabi cmake
This component needs `colcon` and other Python 3 packages in order to build micro-ROS packages:

```bash
pip3 install catkin_pkg lark-parser empy colcon-common-extensions
pip3 install -r requirements.txt
```

## Usage
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
catkin_pkg
lark-parser
empy
colcon-common-extensions