From 62a43e72fbe9456adcf0aeede85f9af4dce88f5e Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 8 Nov 2024 12:50:47 +0100 Subject: [PATCH 1/6] Exclude running ruff on .pixi and .idea folders --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 3e67e085b..62c3ec95b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -132,8 +132,10 @@ testpaths = [ [tool.ruff] exclude = [ ".git", + ".pixi", ".pytest_cache", ".ruff_cache", + ".idea", ".vscode", ".devcontainer", "__pycache__", From bc1e5bb4828f24e8861a7a470644aa1b2b5064bc Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 8 Nov 2024 12:53:35 +0100 Subject: [PATCH 2/6] Update pixi configuration --- pyproject.toml | 79 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 62c3ec95b..1426ee90d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -181,52 +181,87 @@ ignore = [ channels = ["conda-forge"] platforms = ["linux-64", "osx-arm64", "osx-64"] +[tool.pixi.environments] +# We resolve only two groups: cpu and gpu. +# Then, multiple environments can be created from these groups. +default = { solve-group = "cpugroup" } +gpu = { features = ["gpu"], solve-group = "gpugroup" } +tasks-cpu = { features = ["test", "examples"], solve-group = "cpugroup" } +tasks-gpu = { features = ["test", "examples", "gpu"], solve-group = "gpugroup" } + +# --------------- +# feature.default +# --------------- + +# Dependencies from conda-forge. [tool.pixi.dependencies] +# +# Matching `project.dependencies`. +# coloredlogs = "*" jax = "*" -jax-dataclasses = "*" -jaxopt = "*" jaxlib = "*" jaxlie = "*" -lxml = "*" -mediapy = "*" -mujoco = "*" -notebook = "*" +jax-dataclasses = "*" pptree = "*" +optax = "*" qpax = "*" rod = "*" -sdformat14 = "*" typing_extensions = "*" +# +# Optional dependencies. +# +lxml = "*" +mediapy = "*" +mujoco = "*" +scipy = "*" +# +# Additional dependencies. +# +pip = "*" + +# Dependendencies from PyPI. +[tool.pixi.pypi-dependencies] +jaxsim = { path = "./", editable = true } + +# ------------ +# feature.test +# ------------ [tool.pixi.feature.test.tasks] -examples = { cmd = "jupyter notebook ./examples" } pipcheck = "pip check" -test = { cmd = "pytest", depends_on = ["pipcheck"] } +tests = { cmd = "pytest", depends_on = ["pipcheck"] } [tool.pixi.feature.test.dependencies] black = "24.*" idyntree = "*" isort = "*" -pip = "*" pre-commit = "*" pytest = "*" pytest-icdiff = "*" robot_descriptions = "*" +# ---------------- +# feature.examples +# ---------------- + +[tool.pixi.feature.examples.tasks] +examples = { cmd = "jupyter notebook ./examples" } + +[tool.pixi.feature.examples.dependencies] +notebook = "*" +robot_descriptions = "*" + +# ----------- +# feature.gpu +# ----------- + [tool.pixi.feature.gpu] platforms = ["linux-64"] -system-requirements = { cuda = "12.1" } +system-requirements = { cuda = "12" } [tool.pixi.feature.gpu.dependencies] -cuda-cupti = "*" cuda-version = "12.*" -jaxlib = {version = "*", build = "*cuda*"} - -[tool.pixi.pypi-dependencies] -jaxsim = { path = "./", editable = true } - -[tool.pixi.environments] -default = { solve-group = "cpugroup" } -gpu = { features = ["gpu"], solve-group = "gpugroup" } -test-cpu = { features = ["test"], solve-group = "cpugroup" } -test-gpu = { features = ["test", "gpu"], solve-group = "gpugroup" } +# Pinning a specific version awaiting the following to get addressed: +# https://github.com/conda-forge/jaxlib-feedstock/issues/285 +jaxlib = { version = "<0.4.31", build = "*cuda*" } From 56cbd3ba025a93f6a353d8b90a81d87f587a4ebc Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 18 Oct 2024 09:08:48 +0200 Subject: [PATCH 3/6] Rename pixi workflow --- .github/workflows/{update_pixi_lockfile.yml => pixi.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{update_pixi_lockfile.yml => pixi.yml} (100%) diff --git a/.github/workflows/update_pixi_lockfile.yml b/.github/workflows/pixi.yml similarity index 100% rename from .github/workflows/update_pixi_lockfile.yml rename to .github/workflows/pixi.yml From f90d30102092dc660361cbd4f859eafe767367de Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 8 Nov 2024 12:55:32 +0100 Subject: [PATCH 4/6] Update pixi workflow --- .github/workflows/pixi.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pixi.yml b/.github/workflows/pixi.yml index e9484d332..4a4df82f0 100644 --- a/.github/workflows/pixi.yml +++ b/.github/workflows/pixi.yml @@ -1,4 +1,4 @@ -name: Update pixi lockfile +name: Pixi permissions: contents: write @@ -7,12 +7,16 @@ permissions: on: workflow_dispatch: schedule: - - cron: 0 5 1 * * + # Execute at 5am UTC on the first day of the month. + - cron: '0 5 1 * *' jobs: + pixi-update: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 with: lfs: true @@ -30,9 +34,14 @@ jobs: set -o pipefail pixi update --json | pixi exec pixi-diff-to-markdown --explicit-column > diff.md + - name: Test project against updated pixi + run: pixi run --environment tasks-cpu tests + env: + PY_COLORS: "1" + JAX_PLATFORM_NAME: cpu + - name: Commit and push changes - run: | - echo "BRANCH_NAME=update-pixi-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV + run: echo "BRANCH_NAME=update-pixi-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV - name: Create pull request uses: peter-evans/create-pull-request@v7 From 9aa0de3db710898836a0493d94681d5368c459d8 Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 8 Nov 2024 12:55:48 +0100 Subject: [PATCH 5/6] Update CI/CD workflow --- .github/workflows/ci_cd.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 1ef3f5f33..bd890b83f 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -8,8 +8,7 @@ on: types: - published schedule: - # * is a special character in YAML so you have to quote this string - # Execute a "nightly" build at 2 AM UTC + # Execute a nightly build at 2am UTC. - cron: '0 2 * * *' @@ -138,6 +137,8 @@ jobs: steps.changes.outputs.all == 'true') run: pytest env: + # https://github.com/pytest-dev/pytest/issues/7443#issuecomment-656642591 + PY_COLORS: "1" JAX_PLATFORM_NAME: cpu publish: From a693cf6544454055ccb2ddf4917a3a970fd7e5a6 Mon Sep 17 00:00:00 2001 From: diegoferigo Date: Fri, 8 Nov 2024 13:07:09 +0100 Subject: [PATCH 6/6] Update metadata with Python 3.13 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1426ee90d..044ac8464 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,6 +37,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Games/Entertainment :: Simulation", "Topic :: Scientific/Engineering :: Artificial Intelligence",