Skip to content

Commit fe483b1

Browse files
alibertsCadene
andauthored
Remove poetry.lock (#737)
Co-authored-by: Remi <[email protected]>
1 parent ddeade0 commit fe483b1

File tree

10 files changed

+88
-8922
lines changed

10 files changed

+88
-8922
lines changed

.github/workflows/quality.yml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -38,53 +38,7 @@ jobs:
3838
run: python -m pip install "ruff==${{ env.RUFF_VERSION }}"
3939

4040
- name: Ruff check
41-
run: ruff check
41+
run: ruff check --output-format=github
4242

4343
- name: Ruff format
4444
run: ruff format --diff
45-
46-
47-
poetry_check:
48-
name: Poetry check
49-
runs-on: ubuntu-latest
50-
steps:
51-
- name: Checkout Repository
52-
uses: actions/checkout@v4
53-
with:
54-
persist-credentials: false
55-
56-
- name: Install poetry
57-
run: pipx install "poetry>=2.1"
58-
59-
- name: Poetry check
60-
run: poetry check
61-
62-
63-
poetry_relax:
64-
name: Poetry relax
65-
runs-on: ubuntu-latest
66-
steps:
67-
- name: Checkout Repository
68-
uses: actions/checkout@v4
69-
with:
70-
persist-credentials: false
71-
72-
- name: Install poetry
73-
run: pipx install "poetry>=2.1"
74-
75-
- name: Install poetry-relax
76-
run: poetry self add poetry-relax
77-
78-
- name: Poetry relax
79-
id: poetry_relax
80-
run: |
81-
output=$(poetry relax --check 2>&1)
82-
if echo "$output" | grep -q "Proposing updates"; then
83-
echo "$output"
84-
echo ""
85-
echo "Some dependencies have caret '^' version requirement added by poetry by default."
86-
echo "Please replace them with '>='. You can do this by hand or use poetry-relax to do this."
87-
exit 1
88-
else
89-
echo "$output"
90-
fi

.github/workflows/test-docker-build.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ jobs:
3232
files: docker/**
3333
json: "true"
3434

35-
- name: Run step if only the files listed above change
35+
- name: Run step if only the files listed above change # zizmor: ignore[template-injection]
3636
if: steps.changed-files.outputs.any_changed == 'true'
3737
id: set-matrix
38-
env:
39-
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
4038
run: |
41-
echo "matrix=${ALL_CHANGED_FILES}" >> $GITHUB_OUTPUT
42-
39+
echo "matrix=${{ steps.changed-files.outputs.all_changed_files}}" >> $GITHUB_OUTPUT
4340
4441
build_modified_dockerfiles:
4542
name: Build modified Docker images

.github/workflows/test.yml

Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ on:
77
- "tests/**"
88
- "examples/**"
99
- ".github/**"
10-
- "poetry.lock"
10+
- "pyproject.toml"
11+
- ".pre-commit-config.yaml"
1112
- "Makefile"
1213
- ".cache/**"
1314
push:
@@ -18,12 +19,16 @@ on:
1819
- "tests/**"
1920
- "examples/**"
2021
- ".github/**"
21-
- "poetry.lock"
22+
- "pyproject.toml"
23+
- ".pre-commit-config.yaml"
2224
- "Makefile"
2325
- ".cache/**"
2426

2527
permissions: {}
2628

29+
env:
30+
UV_VERSION: "0.6.0"
31+
2732
jobs:
2833
pytest:
2934
name: Pytest
@@ -42,25 +47,19 @@ jobs:
4247
sudo apt-get update && \
4348
sudo apt-get install -y libegl1-mesa-dev ffmpeg portaudio19-dev
4449
45-
- name: Install poetry
46-
run: |
47-
pipx install poetry && poetry config virtualenvs.in-project true
48-
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
49-
50-
# TODO(rcadene, aliberts): python 3.12 seems to be used in the tests, not python 3.10
51-
- name: Set up Python 3.10
52-
uses: actions/setup-python@v5
50+
- name: Install uv and python
51+
uses: astral-sh/setup-uv@v5
5352
with:
53+
enable-cache: true
54+
version: ${{ env.UV_VERSION }}
5455
python-version: "3.10"
55-
cache: "poetry"
5656

57-
- name: Install poetry dependencies
58-
run: |
59-
poetry install --all-extras
57+
- name: Install lerobot (all extras)
58+
run: uv sync --all-extras
6059

6160
- name: Test with pytest
6261
run: |
63-
pytest tests -v --cov=./lerobot --durations=0 \
62+
uv run pytest tests -v --cov=./lerobot --durations=0 \
6463
-W ignore::DeprecationWarning:imageio_ffmpeg._utils:7 \
6564
-W ignore::UserWarning:torch.utils.data.dataloader:558 \
6665
-W ignore::UserWarning:gymnasium.utils.env_checker:247 \
@@ -80,24 +79,19 @@ jobs:
8079
- name: Install apt dependencies
8180
run: sudo apt-get update && sudo apt-get install -y ffmpeg
8281

83-
- name: Install poetry
84-
run: |
85-
pipx install poetry && poetry config virtualenvs.in-project true
86-
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
87-
88-
# TODO(rcadene, aliberts): python 3.12 seems to be used in the tests, not python 3.10
89-
- name: Set up Python 3.10
90-
uses: actions/setup-python@v5
82+
- name: Install uv and python
83+
uses: astral-sh/setup-uv@v5
9184
with:
85+
enable-cache: true
86+
version: ${{ env.UV_VERSION }}
9287
python-version: "3.10"
9388

94-
- name: Install poetry dependencies
95-
run: |
96-
poetry install --extras "test"
89+
- name: Install lerobot
90+
run: uv sync --extra "test"
9791

9892
- name: Test with pytest
9993
run: |
100-
pytest tests -v --cov=./lerobot --durations=0 \
94+
uv run pytest tests -v --cov=./lerobot --durations=0 \
10195
-W ignore::DeprecationWarning:imageio_ffmpeg._utils:7 \
10296
-W ignore::UserWarning:torch.utils.data.dataloader:558 \
10397
-W ignore::UserWarning:gymnasium.utils.env_checker:247 \
@@ -120,20 +114,21 @@ jobs:
120114
sudo apt-get update && \
121115
sudo apt-get install -y libegl1-mesa-dev portaudio19-dev
122116
123-
- name: Install poetry
124-
run: |
125-
pipx install poetry && poetry config virtualenvs.in-project true
126-
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
127-
128-
- name: Set up Python 3.10
129-
uses: actions/setup-python@v5
117+
- name: Install uv and python
118+
uses: astral-sh/setup-uv@v5
130119
with:
120+
enable-cache: true
121+
version: ${{ env.UV_VERSION }}
131122
python-version: "3.10"
132-
cache: "poetry"
133123

134-
- name: Install poetry dependencies
124+
- name: Install lerobot (all extras)
125+
run: |
126+
uv venv
127+
uv sync --all-extras
128+
129+
- name: venv
135130
run: |
136-
poetry install --all-extras
131+
echo "PYTHON_PATH=${{ github.workspace }}/.venv/bin/python" >> $GITHUB_ENV
137132
138133
- name: Test end-to-end
139134
run: |

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ share/python-wheels/
4949
*.egg
5050
MANIFEST
5151

52+
# uv/poetry lock files
53+
poetry.lock
54+
uv.lock
55+
5256
# PyInstaller
5357
# Usually these files are written by a python script from a template
5458
# before PyInstaller builds the exe, so as to inject date/other infos into it.

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ repos:
2323
- id: ruff
2424
args: [--fix]
2525
- id: ruff-format
26-
- repo: https://github.com/python-poetry/poetry
27-
rev: 2.1.0
28-
hooks:
29-
- id: poetry-check
3026
- repo: https://github.com/gitleaks/gitleaks
3127
rev: v8.23.3
3228
hooks:

CONTRIBUTING.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,38 +129,71 @@ Follow these steps to start contributing:
129129

130130
🚨 **Do not** work on the `main` branch.
131131

132-
4. for development, we use `poetry` instead of just `pip` to easily track our dependencies.
133-
If you don't have it already, follow the [instructions](https://python-poetry.org/docs/#installation) to install it (use a version >=2.1.0).
132+
4. for development, we advise to use a tool like `poetry` or `uv` instead of just `pip` to easily track our dependencies.
133+
Follow the instructions to [install poetry](https://python-poetry.org/docs/#installation) (use a version >=2.1.0) or to [install uv](https://docs.astral.sh/uv/getting-started/installation/#installation-methods) if you don't have one of them already.
134134

135135
Set up a development environment with conda or miniconda:
136136
```bash
137137
conda create -y -n lerobot-dev python=3.10 && conda activate lerobot-dev
138138
```
139139

140+
If you're using `uv`, it can manage python versions so you can instead do:
141+
```bash
142+
uv venv --python 3.10 && source .venv/bin/activate
143+
```
144+
140145
To develop on 🤗 LeRobot, you will at least need to install the `dev` and `test` extras dependencies along with the core library:
146+
147+
using `poetry`
148+
```bash
149+
poetry sync --extras "dev test"
150+
```
151+
152+
using `uv`
141153
```bash
142-
poetry install --sync --extras "dev test"
154+
uv sync --extra dev --extra test
143155
```
144156

145157
You can also install the project with all its dependencies (including environments):
158+
159+
using `poetry`
146160
```bash
147161
poetry sync --all-extras
148162
```
149163

164+
using `uv`
165+
```bash
166+
uv sync --all-extras
167+
```
168+
150169
> **Note:** If you don't install simulation environments with `--all-extras`, the tests that require them will be skipped when running the pytest suite locally. However, they *will* be tested in the CI. In general, we advise you to install everything and test locally before pushing.
151170
152171
Whichever command you chose to install the project (e.g. `poetry sync --all-extras`), you should run it again when pulling code with an updated version of `pyproject.toml` and `poetry.lock` in order to synchronize your virtual environment with the new dependencies.
153172

154173
The equivalent of `pip install some-package`, would just be:
174+
175+
using `poetry`
155176
```bash
156177
poetry add some-package
157178
```
158179

180+
using `uv`
181+
```bash
182+
uv add some-package
183+
```
184+
159185
When making changes to the poetry sections of the `pyproject.toml`, you should run the following command to lock dependencies.
186+
using `poetry`
160187
```bash
161-
poetry lock --no-update
188+
poetry lock
162189
```
163190

191+
using `uv`
192+
```bash
193+
uv lock
194+
```
195+
196+
164197
5. Develop the features on your branch.
165198

166199
As you work on the features, you should make sure that the test suite

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
PYTHON_PATH := $(shell which python)
44

5-
# If Poetry is installed, redefine PYTHON_PATH to use the Poetry-managed Python
6-
POETRY_CHECK := $(shell command -v poetry)
7-
ifneq ($(POETRY_CHECK),)
8-
PYTHON_PATH := $(shell poetry run which python)
5+
# If uv is installed and a virtual environment exists, use it
6+
UV_CHECK := $(shell command -v uv)
7+
ifneq ($(UV_CHECK),)
8+
PYTHON_PATH := $(shell .venv/bin/python)
99
endif
1010

1111
export PATH := $(dir $(PYTHON_PATH)):$(PATH)

docker/lerobot-gpu-dev/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUN (type -p wget >/dev/null || (apt update && apt-get install wget -y)) \
5858
RUN ln -s /usr/bin/python3 /usr/bin/python
5959

6060
# Install poetry
61-
RUN curl -sSL https://install.python-poetry.org | python - --version 1.8.5
61+
RUN curl -sSL https://install.python-poetry.org | python -
6262
ENV PATH="/root/.local/bin:$PATH"
6363
RUN echo 'if [ "$HOME" != "/root" ]; then ln -sf /root/.local/bin/poetry $HOME/.local/bin/poetry; fi' >> /root/.bashrc
6464
RUN poetry config virtualenvs.create false

examples/7_get_started_with_real_robot.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ Using `pip`:
3636
pip install -e ".[dynamixel]"
3737
```
3838

39-
Or using `poetry`:
39+
Using `poetry`:
4040
```bash
41-
poetry install --sync --extras "dynamixel"
41+
poetry sync --extras "dynamixel"
42+
```
43+
44+
Using `uv`:
45+
```bash
46+
uv sync --extra "dynamixel"
4247
```
4348

4449
/!\ For Linux only, ffmpeg and opencv requires conda install for now. Run this exact sequence of commands:

0 commit comments

Comments
 (0)