Skip to content

Commit

Permalink
ci: test poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Oct 17, 2023
1 parent 3843b09 commit 3343d94
Show file tree
Hide file tree
Showing 6 changed files with 773 additions and 583 deletions.
File renamed without changes.
45 changes: 45 additions & 0 deletions .github/workflows/poetry-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests & Coverage

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- 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

- uses: actions/setup-python@v4
with:
python-version: matrix.python-version
cache: poetry

- name: Install happypose
run: poetry install --with dev --all-extras

- name: Download pre-trained models required for tests
run: |
mkdir local_data
python -m happypose.toolbox.utils.download --cosypose_model=detector-bop-ycbv-pbr--970850
python -m happypose.toolbox.utils.download --cosypose_model=coarse-bop-ycbv-pbr--724183
python -m happypose.toolbox.utils.download --cosypose_model=refiner-bop-ycbv-pbr--604090
python -m happypose.toolbox.utils.download --megapose_models
cd tests/data
git clone https://github.com/petrikvladimir/happypose_test_data.git crackers_example
- name: Run tests
run: |
coverage run --source=happypose -m unittest
coverage xml
6 changes: 6 additions & 0 deletions happypose/pose_estimators/cosypose/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"pybind11>=2.10.0",
]
build-backend = "setuptools.build_meta"
29 changes: 9 additions & 20 deletions happypose/pose_estimators/cosypose/setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
import os
from os import path
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import setup

from setuptools import find_packages, setup
from torch.utils.cpp_extension import BuildExtension, CppExtension

here = path.abspath(path.dirname(__file__))

# Use correct conda compiler used to build pytorch
if "GXX" in os.environ:
os.environ["CXX"] = os.environ.get("GXX", "")
ext_modules = [
Pybind11Extension("cosypose_cext", ["cosypose/csrc/cosypose_cext.cpp"]),
]

setup(
name="cosypose",
version="1.0.0",
description="CosyPose",
packages=find_packages(),
ext_modules=[
CppExtension(
name="cosypose_cext",
sources=["cosypose/csrc/cosypose_cext.cpp"],
extra_compile_args=["-O3"],
verbose=True,
)
],
cmdclass={"build_ext": BuildExtension},
ext_modules=ext_modules,
cmdclass={"build_ext": build_ext},
zip_safe=False,
python_requires=">=3.9",
)
Loading

0 comments on commit 3343d94

Please sign in to comment.