Skip to content

Commit

Permalink
Merge branch 'main' into mjcf-importer
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulero authored Jan 3, 2025
2 parents ef03b97 + aec85bb commit e31f44b
Show file tree
Hide file tree
Showing 73 changed files with 2,449 additions and 3,671 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: black
uses: psf/black@stable
with:
Expand Down
162 changes: 106 additions & 56 deletions .github/workflows/pypi-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI

# Ref: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

on:
workflow_dispatch:
push:
branches: ["**"]
tags-ignore: ["**"]
Expand All @@ -9,69 +12,116 @@ on:
types:
- published
jobs:
build_wheels:
name: Build wheels [${{ matrix.os }}]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
os:
- ubuntu-20.04
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: github.event_name == 'release' || startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/adam-robotics
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

- name: Install pypa/build
run: pip install build
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Build wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .
github-release:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest

- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

deploy_test_PyPI:
name: 📦 Deploy to TestPyPI
runs-on: ubuntu-20.04
needs: [build_wheels]
if: github.ref == 'refs/heads/main'
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
'${{ github.ref_name }}'
--repo '${{ github.repository }}'
--notes ""
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest

deploy_PyPI:
name: 📦 Deploy to PyPI
runs-on: ubuntu-20.04
needs: [build_wheels]
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
environment:
name: testpypi
url: https://test.pypi.org/p/adam-robotics

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Adam
name: adam-tests

on:
push:
Expand All @@ -16,9 +16,9 @@ jobs:
python-version: [3.11]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,30 @@ pip install .[selected-interface]

#### Installation from conda-forge package

```bash
mamba create -n adamenv -c conda-forge adam-robotics
```

If you want to use `jax` or `pytorch`, just install the corresponding package as well.
- Install **CasADi** interface:

```bash
mamba create -n adamenv -c conda-forge adam-robotics-casadi
```

- Install **Jax** interface (warning: not available on Windows):

```bash
mamba create -n adamenv -c conda-forge adam-robotics-jax
```

- Install **PyTorch** interface (warning: not available on Windows):

```bash
mamba create -n adamenv -c conda-forge adam-robotics-pytorch
```

- Install **ALL** interfaces (warning: not available on Windows):

```bash
mamba create -n adamenv -c conda-forge adam-robotics-all
```

> [!NOTE]
> Check also the conda JAX installation guide [here](https://jax.readthedocs.io/en/latest/installation.html#conda-community-supported)
Expand Down Expand Up @@ -225,6 +244,7 @@ w_H_f_batch = jitted_vmapped_frame_fk(w_H_b_batch, joints_batch)
### CasADi interface

```python
import casadi as cs
import adam
from adam.casadi import KinDynComputations
import icub_models
Expand Down
2 changes: 1 addition & 1 deletion ci_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies:
- pytest-repeat
- icub-models
- idyntree >=11.0.0
- gitpython
- jax
- pytorch
- jax2torch
- requests
2 changes: 1 addition & 1 deletion ci_env_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dependencies:
- pytest-repeat
- icub-models
- idyntree >=11.0.0
- gitpython
- requests
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "adam"
copyright = "2021, Artificial and Mechanical Intelligence Lab"
copyright = "Artificial and Mechanical Intelligence Lab"
author = "Artificial and Mechanical Intelligence Lab"
# get release from git tag

Expand Down
Loading

0 comments on commit e31f44b

Please sign in to comment.