Skip to content

Commit 7e8730f

Browse files
authored
Merge pull request #194 from agimus-project/uv2
poetry -> uv
2 parents 6732deb + e64c29f commit 7e8730f

File tree

14 files changed

+7726
-4517
lines changed

14 files changed

+7726
-4517
lines changed

.github/workflows/conda-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
if: steps.cache.outputs.cache-hit != 'true'
5353

5454
- name: Install happypose
55-
run: pip install -e .[multiview]
55+
run: pip install -r requirements/base.txt
5656

5757
- name: Download pre-trained models required for tests
5858
run: |

.github/workflows/pip-test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
run: pip install -U pip
3131

3232
- name: Install happypose
33-
run: pip install ".[multiview,pypi]"
33+
run: pip install -r requirements/cpu.txt -r requirements/pypi.txt
3434

3535
- name: Download pre-trained models required for tests
3636
run: |
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Tests with poetry + Coverage
1+
name: Tests with uv
22

33
on: [ push, pull_request ]
44

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

19-
- name: Setup poetry
20-
run: pipx install poetry
21-
2219
- name: Caching of the happypose installation and data
2320
uses: actions/cache@v4
2421
with:
2522
path: local_data
2623
key: data
2724

28-
- uses: actions/setup-python@v5
29-
with:
30-
python-version: ${{ matrix.python-version }}
31-
cache: poetry
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v3
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
run: uv python install ${{ matrix.python-version }}
3230

3331
- name: Install happypose
34-
run: poetry install --with dev -E pypi -E multiview
32+
run: uv sync --extra cpu --extra pypi
3533

3634
- name: Download pre-trained models required for tests
3735
run: |
3836
mkdir -p local_data
39-
poetry run python -m happypose.toolbox.utils.download \
37+
uv run python -m happypose.toolbox.utils.download \
4038
--megapose_models \
4139
--examples \
4240
barbecue-sauce \
@@ -47,12 +45,5 @@ jobs:
4745
4846
- name: Run tests
4947
run: |
50-
poetry run coverage run --source=happypose -m unittest
51-
poetry run coverage run --source=happypose -m pytest tests -v
52-
53-
- name: Process coverage
54-
run: poetry run coverage xml
55-
56-
#- uses: codecov/codecov-action@v4
57-
#env:
58-
#CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
48+
uv run python -m unittest
49+
uv run pytest tests -v

README.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![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)
44
[![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)
5-
[![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)
5+
[![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)
66
[![Book](https://github.com/agimus-project/happypose/actions/workflows/book.yml/badge.svg)](https://github.com/agimus-project/happypose/actions/workflows/book.yml)
77

88
[![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)
@@ -16,7 +16,7 @@ Toolbox and trackers for object pose-estimation. Based on the work [CosyPose](ht
1616

1717
## Installation
1818

19-
To install happypose, you can use pip or poetry.
19+
To install happypose, you can use pip or uv.
2020

2121
We strongly suggest to install it in either a
2222
[venv](https://docs.python.org/fr/3/library/venv.html) or a
@@ -29,7 +29,15 @@ git clone --branch dev --recurse-submodules https://github.com/agimus-project/ha
2929
cd happypose
3030
conda env create -f environment.yml
3131
conda activate happypose
32-
pip install .
32+
pip install -r requirements/base.txt
33+
```
34+
35+
### Example with uv
36+
37+
```
38+
git clone --branch dev --recurse-submodules https://github.com/agimus-project/happypose.git
39+
cd happypose
40+
uv sync --extra pypi --extra cpu # you *must* choose between cpu / cu124
3341
```
3442

3543
### Example with venv
@@ -39,13 +47,14 @@ git clone --branch dev --recurse-submodules https://github.com/agimus-project/ha
3947
cd happypose
4048
python -m venv .venv
4149
source .venv/bin/activate
42-
pip install .[pypi]
50+
pip install -r requirements/pypi.txt -r requirements/cpu.txt # you *must* choose between cpu / cu124
4351
```
4452

4553
### Install extras:
4654

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

5059
## Create data directory
5160

environment.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#name: happypose_torch2
1+
name: happypose
22
channels:
33
- conda-forge
44
- pytorch
55
- nvidia
66
- anaconda
77
- defaults
88
dependencies:
9-
- pytorch-cuda==12.1
9+
- pytorch-cuda==12.4
1010
- pip
1111
- pytorch
1212
- torchvision

happypose/pose_estimators/cosypose/pyproject.toml

+17
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,20 @@ requires = [
44
"pybind11>=2.10.0",
55
"setuptools>=42"
66
]
7+
8+
[project]
9+
authors = [
10+
{name = "Yann Labbé"}
11+
]
12+
classifiers = ["License :: OSI Approved :: BSD License"]
13+
description = "CosyPose C extension"
14+
maintainers = [
15+
{email = "guilhem.saurel@laas.fr", name = "Guilhem Saurel"}
16+
]
17+
name = "cosypose"
18+
readme = "README.md"
19+
requires-python = ">=3.10"
20+
version = "1.0.0"
21+
22+
[tool.setuptools]
23+
packages = ["cosypose"]

0 commit comments

Comments
 (0)