Skip to content

Commit

Permalink
poetry -> uv
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Nov 24, 2024
1 parent 6732deb commit df44bef
Show file tree
Hide file tree
Showing 8 changed files with 2,146 additions and 4,488 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/conda-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'

- name: Install happypose
run: pip install -e .[multiview]
run: pip install -e .[cpu,multiview]

- name: Download pre-trained models required for tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pip-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: pip install -U pip

- name: Install happypose
run: pip install ".[multiview,pypi]"
run: pip install ".[cpu,multiview,pypi]"

- name: Download pre-trained models required for tests
run: |
Expand Down
29 changes: 10 additions & 19 deletions .github/workflows/poetry-test.yml → .github/workflows/uv-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests with poetry + Coverage
name: Tests with uv

on: [ push, pull_request ]

Expand All @@ -16,27 +16,25 @@ jobs:
- name: Install EGL mesa - required for Panda3D renderer
run: sudo apt-get update && sudo apt-get install -qqy libegl1-mesa libegl1-mesa-dev

- name: Setup poetry
run: pipx install poetry

- name: Caching of the happypose installation and data
uses: actions/cache@v4
with:
path: local_data
key: data

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}

- name: Install happypose
run: poetry install --with dev -E pypi -E multiview
run: uv sync --extra cpu

- name: Download pre-trained models required for tests
run: |
mkdir -p local_data
poetry run python -m happypose.toolbox.utils.download \
python -m happypose.toolbox.utils.download \
--megapose_models \
--examples \
barbecue-sauce \
Expand All @@ -47,12 +45,5 @@ jobs:
- name: Run tests
run: |
poetry run coverage run --source=happypose -m unittest
poetry run coverage run --source=happypose -m pytest tests -v
- name: Process coverage
run: poetry run coverage xml

#- uses: codecov/codecov-action@v4
#env:
#CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
python -m unittest
pytest tests -v
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Conda](https://github.com/agimus-project/happypose/actions/workflows/conda-test.yml/badge.svg)](https://github.com/agimus-project/happypose/actions/workflows/conda-test.yml)
[![Pip](https://github.com/agimus-project/happypose/actions/workflows/pip-test.yml/badge.svg)](https://github.com/agimus-project/happypose/actions/workflows/pip-test.yml)
[![Poetry](https://github.com/agimus-project/happypose/actions/workflows/poetry-test.yml/badge.svg)](https://github.com/agimus-project/happypose/actions/workflows/poetry-test.yml)
[![uv](https://github.com/agimus-project/happypose/actions/workflows/uv-test.yml/badge.svg)](https://github.com/agimus-project/happypose/actions/workflows/uv-test.yml)
[![Book](https://github.com/agimus-project/happypose/actions/workflows/book.yml/badge.svg)](https://github.com/agimus-project/happypose/actions/workflows/book.yml)

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/agimus-project/happypose/main.svg)](https://results.pre-commit.ci/latest/github/agimus-project/happypose/main)
Expand All @@ -16,7 +16,7 @@ Toolbox and trackers for object pose-estimation. Based on the work [CosyPose](ht

## Installation

To install happypose, you can use pip or poetry.
To install happypose, you can use pip or uv.

We strongly suggest to install it in either a
[venv](https://docs.python.org/fr/3/library/venv.html) or a
Expand All @@ -32,20 +32,30 @@ conda activate happypose
pip install .
```

### Example with uv

```
git clone --branch dev --recurse-submodules https://github.com/agimus-project/happypose.git
cd happypose
uv sync --extra pypi --extra cpu # you *must* choose between cpu / cu124
```

### Example with venv

```
git clone --branch dev --recurse-submodules https://github.com/agimus-project/happypose.git
cd happypose
python -m venv .venv
source .venv/bin/activate
pip install .[pypi]
pip install .[cpu,pypi] # you *must* choose between cpu / cu124
```

### Install extras:

- `multiview`: installs cosypose c++ extension
- `pypi`: install torch, pinocchio & opencv from PyPI (don't use this with conda)
- `pypi`: install pinocchio & opencv from PyPI (don't use this with conda)
- `cpu`: install torch for CPU from wheel (don't use this with conda)
- `cu124`: install torch for CUDA 12.4 from wheel (don't use this with conda)

## Create data directory

Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#name: happypose_torch2
name: happypose
channels:
- conda-forge
- pytorch
- nvidia
- anaconda
- defaults
dependencies:
- pytorch-cuda==12.1
- pytorch-cuda==12.4
- pip
- pytorch
- torchvision
Expand Down
Loading

0 comments on commit df44bef

Please sign in to comment.