Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
8 changes: 4 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# uv
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# https://docs.astral.sh/uv/concepts/projects/layout/#the-lockfile
#uv.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
with:
clean: true

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 2.1.1
enable-cache: true

- name: Create virtual audio device
run: |
Expand All @@ -46,7 +46,7 @@ jobs:
jackd -d dummy -r 44100 &

- name: Install python dependencies
run: poetry install --with perception,nomad,s2s,simbench
run: uv sync --all-groups

- name: Update rosdep
shell: bash
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/mkdocs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,30 @@ jobs:
with:
clean: true

- name: Cache Poetry and pip
- name: Install system dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get --yes install git

- name: Cache uv and pip
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/uv
~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
${{ runner.os }}-uv-

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 2.1.1
enable-cache: true

- name: Install python dependencies
run: poetry install --with docs

- name: Install rai packages
run: poetry run pip install src/rai_core src/rai_sim src/rai_bench src/rai_s2s --no-deps
run: uv sync --frozen --all-groups

- name: Build docs
shell: bash
run: |
poetry run mkdocs build --strict
uv run mkdocs build --strict
21 changes: 9 additions & 12 deletions .github/workflows/mkdocs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,25 @@ jobs:
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com

- name: Cache Poetry and pip
- name: Cache uv and pip
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry
~/.cache/uv
~/.cache/pip
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
${{ runner.os }}-uv-

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: 2.1.1
enable-cache: true

- name: Install python dependencies
run: poetry install --with docs

- name: Install rai packages
run: poetry run pip install src/rai_core src/rai_sim src/rai_bench src/rai_s2s --no-deps
run: uv sync --frozen --all-groups

- name: Build and Deploy
shell: bash
run: |
poetry run mkdocs gh-deploy --force
uv run mkdocs gh-deploy --force
16 changes: 0 additions & 16 deletions .github/workflows/poetry-update.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# uv
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# https://docs.astral.sh/uv/concepts/projects/layout/#the-lockfile
#uv.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pre-commit run -a # Run the checks before committing
Optionally, install all RAI dependencies and run the tests:

```bash
poetry install --all-groups
uv sync --all-groups
colcon build --symlink-install
pytest tests/
```
Expand Down
10 changes: 4 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ FROM osrf/ros:${ROS_DISTRO}-desktop-full

ARG DEPENDENCIES=core_only
ENV DEBIAN_FRONTEND=noninteractive
# Increase timeout for Poetry requests.
ENV POETRY_REQUESTS_TIMEOUT=300

# Check whether the $DEPENDENCIES ARG has a valid value
RUN /bin/bash -c 'if [ "${DEPENDENCIES}" != "core_only" ] && [ "${DEPENDENCIES}" != "all_groups" ]; then \
Expand All @@ -33,8 +31,8 @@ RUN apt update && apt install -y \
git \
wget \
zip
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 - --version 2.1.3
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"

# Copy the RAI repository
Expand All @@ -46,9 +44,9 @@ ENV FASTRTPS_DEFAULT_PROFILES_FILE=/rai/docker/fastrtps_config.xml
ENV RMW_IMPLEMENTATION=rmw_fastrtps_cpp

RUN /bin/bash -c 'if [ "${DEPENDENCIES}" = "core_only" ]; then \
poetry install; \
uv sync --frozen; \
else \
poetry install --all-groups; \
uv sync --frozen --all-groups; \
fi'

# Install ROS dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/manipulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ manipulation techniques.
2. Download additional dependencies:

```shell
poetry install --with perception,simbench
uv sync --group perception --group simbench
vcs import < demos.repos
rosdep install --from-paths src/examples/rai-manipulation-demo/ros2_ws/src --ignore-src -r -y
```
Expand Down
2 changes: 1 addition & 1 deletion docs/demos/rosbot_xl.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ platform in a nice apartment.
sudo apt install ros-${ROS_DISTRO}-navigation2 ros-${ROS_DISTRO}-nav2-bringup
vcs import < demos.repos
rosdep install --from-paths src --ignore-src -r -y
poetry install --with perception
uv sync --group perception
colcon build
```

Expand Down
2 changes: 1 addition & 1 deletion docs/faq/ROS_2_Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ At the heart of this integration is the `rai.communication.ros2.ROS2Connector`,
1. **Dependency Management**
- ROS 2's dependency system (rosdep) is too vague and inflexible for RAI's needs
- RAI heavily relies on the Python ecosystem, particularly for AI/LLM integration
- Poetry provides more precise version control and dependency resolution, crucial for AI/ML components
- uv provides more precise version control and dependency resolution, crucial for AI/ML components

2. **Architectural Separation**
- The initial ROS 2 package approach made it difficult to maintain clear separation between:
Expand Down
22 changes: 11 additions & 11 deletions docs/setup/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ There are two ways to start using RAI:

1. Installing RAI using pip (recommended for end users)

2. Setting up a developer environment using poetry (recommended for developers)
2. Setting up a developer environment using uv (recommended for developers)

## Installing RAI

??? tip "Virtual environment"

We recommend installing RAI in a virtual environment (e.g., [virtualenv](https://docs.python.org/3/library/venv.html), [uv](https://docs.astral.sh/uv/), or [poetry](https://python-poetry.org/docs/)) to keep your dependencies organized. Make sure to use the same version of python as the one used for ROS 2 (typically `python3.10` for Humble and `python3.12` for Jazzy).
We recommend installing RAI in a virtual environment (e.g., [virtualenv](https://docs.python.org/3/library/venv.html) or [uv](https://docs.astral.sh/uv/)) to keep your dependencies organized. Make sure to use the same version of python as the one used for ROS 2 (typically `python3.10` for Humble and `python3.12` for Jazzy).

If you plan to use ROS 2 commands (`ros2 run` or `ros2 launch`), you'll need to add your virtual environment's Python packages to your `$PYTHONPATH`. This step is only necessary for ROS 2 integration - if you're just running RAI directly with Python, you can skip this step.

Expand Down Expand Up @@ -74,17 +74,17 @@ There are two ways to start using RAI:

## Setting up developer environment

### 1.1 Install poetry
### 1.1 Install uv

RAI uses [Poetry](https://python-poetry.org/)(2.1+) for python packaging and dependency management.
Install poetry with the following line:
RAI uses [uv](https://docs.astral.sh/uv/) for python packaging and dependency management.
Install uv with the following line:

```bash
curl -sSL https://install.python-poetry.org | python3 -
curl -LsSf https://astral.sh/uv/install.sh | sh
```

Alternatively, you can opt to do so by following the
[official docs](https://python-poetry.org/docs/#installation).
[official docs](https://docs.astral.sh/uv/getting-started/installation/).

### 1.2 Clone the repository:

Expand All @@ -99,10 +99,10 @@ cd rai
vcs import < ros_deps.repos
```

### 1.4 Create poetry virtual environment and install dependencies:
### 1.4 Create virtual environment and install dependencies:

```bash
poetry install
uv sync
rosdep install --from-paths src --ignore-src -r -y
```

Expand All @@ -113,7 +113,7 @@ rosdep install --from-paths src --ignore-src -r -y
install additional dependencies:

```bash
poetry install --with perception,nomad,s2s,simbench # or `--all-groups` for full setup
uv sync --group perception --group nomad --group s2s --group simbench # or `--all-groups` for full setup
```

| Group Name | Description | Dependencies |
Expand All @@ -129,7 +129,7 @@ rosdep install --from-paths src --ignore-src -r -y
Run the configuration tool to set up your LLM vendor and other settings:

```bash
poetry run streamlit run src/rai_core/rai/frontend/configurator.py
uv run streamlit run src/rai_core/rai/frontend/configurator.py
```

!!! tip "Web browser"
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/setup_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ docker run --net=host --ipc=host --pid=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID -it
```sh
cd /rai
source setup_shell.sh
poetry run pytest tests/{agents,messages,tools,types}
uv run pytest tests/{agents,messages,tools,types}
```
Loading
Loading