From 9042b75bc368ef840e1b4fe6a77d75bafcdd82cc Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 28 Jun 2024 13:10:53 +0200 Subject: [PATCH 01/11] sync submodule --- cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake b/cmake index 657b07c..2bea127 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 657b07cb721ecbc383d4e76438eb6ec5c421a332 +Subproject commit 2bea127e8113a32f216ae7a7201e36a6e7c56cc2 From 969d6fe519fc43f7045f04f98f1fddf1f610ba64 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 28 Jun 2024 13:10:54 +0200 Subject: [PATCH 02/11] pre-commit autoupdate --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e2e9834..4d3c449 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_branch: devel repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.8 + rev: v0.5.0 hooks: - id: ruff args: @@ -19,7 +19,7 @@ repos: - id: toml-sort-fix exclude: poetry.lock - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.6 + rev: v18.1.7 hooks: - id: clang-format args: From 80c40ed6cbca2c517e7bdace752b778f770cae8d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Fri, 28 Jun 2024 14:00:18 +0200 Subject: [PATCH 03/11] nix: initialize flake-parts --- flake.lock | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 49 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5ac9fdc --- /dev/null +++ b/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1719575122, + "narHash": "sha256-1x3SNH6GtWgpHmhxO4pCz6nidxjCAheF0FpSXSjqRrg=", + "owner": "nim65s", + "repo": "nixpkgs", + "rev": "5206f72d0fadec6f15e6130a86c0695ceb5ec92d", + "type": "github" + }, + "original": { + "owner": "nim65s", + "ref": "gepetto", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1717284937, + "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..94c479c --- /dev/null +++ b/flake.nix @@ -0,0 +1,49 @@ +{ + description = "Description for the project"; + + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:nim65s/nixpkgs/gepetto"; + }; + + outputs = + inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + # To import a flake module + # 1. Add foo to inputs + # 2. Add foo as a parameter to the outputs function + # 3. Add here: foo.flakeModule + + ]; + systems = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + perSystem = + { + config, + self', + inputs', + pkgs, + system, + ... + }: + { + # Per-system attributes can be defined here. The self' and inputs' + # module parameters provide easy access to attributes of the same + # system. + + # Equivalent to inputs'.nixpkgs.legacyPackages.hello; + packages.default = pkgs.hello; + }; + flake = { + # The usual flake attributes can be defined here, including system- + # agnostic ones like nixosModule and system-enumerating ones, although + # those are more easily expressed in perSystem. + + }; + }; +} From d3d9bb4db58ca943f6f750e265e7685cdf485a39 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 29 Jun 2024 16:11:18 +0200 Subject: [PATCH 04/11] nix: package --- default.nix | 44 ++++++++++++++++++++++++++++++++++++++++++++ flake.lock | 16 +++------------- flake.nix | 36 +++++++++++++----------------------- 3 files changed, 60 insertions(+), 36 deletions(-) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..8e1250c --- /dev/null +++ b/default.nix @@ -0,0 +1,44 @@ +{ + lib, + stdenv, + cmake, + jrl-cmakemodules, + example-robot-data, + python3Packages, +}: + +python3Packages.buildPythonPackage { + pname = "hpp-universal-robot"; + version = "5.0.0"; + pyproject = false; + + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./CMakeLists.txt + ./doc + ./package.xml + ./src + ]; + }; + + strictDeps = true; + + nativeBuildInputs = [ + cmake + python3Packages.python + ]; + propagatedBuildInputs = [ + jrl-cmakemodules + example-robot-data + ]; + + doCheck = true; + + meta = { + description = "Data specific to robots ur5 and ur10 for hpp-corbaserver"; + homepage = "https://github.com/humanoid-path-planner/hpp-universal-robot"; + license = lib.licenses.bsd2; + maintainers = [ lib.maintainers.nim65s ]; + }; +} diff --git a/flake.lock b/flake.lock index 5ac9fdc..406cf66 100644 --- a/flake.lock +++ b/flake.lock @@ -2,7 +2,9 @@ "nodes": { "flake-parts": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1717285511, @@ -34,18 +36,6 @@ "type": "github" } }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1717284937, - "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz" - } - }, "root": { "inputs": { "flake-parts": "flake-parts", diff --git a/flake.nix b/flake.nix index 94c479c..5c7b1c9 100644 --- a/flake.nix +++ b/flake.nix @@ -1,21 +1,23 @@ { - description = "Description for the project"; + description = "Data specific to robots ur5 and ur10 for hpp-corbaserver"; + + nixConfig = { + extra-substituters = [ "https://gepetto.cachix.org" ]; + extra-trusted-public-keys = [ "gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY=" ]; + }; inputs = { - flake-parts.url = "github:hercules-ci/flake-parts"; nixpkgs.url = "github:nim65s/nixpkgs/gepetto"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; }; outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ - # To import a flake module - # 1. Add foo to inputs - # 2. Add foo as a parameter to the outputs function - # 3. Add here: foo.flakeModule - - ]; + imports = [ ]; systems = [ "x86_64-linux" "aarch64-linux" @@ -24,26 +26,14 @@ ]; perSystem = { - config, self', - inputs', pkgs, system, ... }: { - # Per-system attributes can be defined here. The self' and inputs' - # module parameters provide easy access to attributes of the same - # system. - - # Equivalent to inputs'.nixpkgs.legacyPackages.hello; - packages.default = pkgs.hello; + packages.default = pkgs.callPackage ./. { }; + devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; }; - flake = { - # The usual flake attributes can be defined here, including system- - # agnostic ones like nixosModule and system-enumerating ones, although - # those are more easily expressed in perSystem. - - }; }; } From d9308abb98b864da8ab1041f66f6c78aef2e8d53 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sat, 29 Jun 2024 16:11:28 +0200 Subject: [PATCH 05/11] nix: ci --- .github/workflows/nix.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..d86192c --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,20 @@ +name: "Nix CI" + +on: [pull_request, push] + +jobs: + tests: + name: "Nix build on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}-latest" + strategy: + matrix: + os: [ubuntu] + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + trusted-substituters = https://gepetto.cachix.org + trusted-public-keys = gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY= + - uses: DeterminateSystems/magic-nix-cache-action@main + - run: nix build --accept-flake-config From 145bc925f9d6c11ac2867738d4644704da168999 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 30 Jun 2024 13:40:35 +0200 Subject: [PATCH 06/11] nix ci: cachix push --- .github/workflows/nix.yml | 9 ++++----- flake.nix | 5 ++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index d86192c..1ac391b 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -12,9 +12,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: DeterminateSystems/nix-installer-action@main - with: - extra-conf: | - trusted-substituters = https://gepetto.cachix.org - trusted-public-keys = gepetto.cachix.org-1:toswMl31VewC0jGkN6+gOelO2Yom0SOHzPwJMY2XiDY= - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix build --accept-flake-config + - run: nix --accept-flake-config build -L + - run: nix --accept-flake-config run .#cachix push gepetto $(readlink result) + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} diff --git a/flake.nix b/flake.nix index 5c7b1c9..fb4ea94 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,10 @@ ... }: { - packages.default = pkgs.callPackage ./. { }; + packages = { + inherit (pkgs) cachix; + default = pkgs.callPackage ./. { }; + }; devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; }; }; From 50690cf62fce3d49fc2c8a4411767ef30d67cea4 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 30 Jun 2024 13:54:09 +0200 Subject: [PATCH 07/11] Create LICENSE --- LICENSE | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dbe2dc3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +BSD 2-Clause License + +Copyright (c) 2014-2024, CNRS + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From ec4aa8c961049a2b412a4a8dcf2207145ccc0426 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 30 Jun 2024 19:45:33 +0200 Subject: [PATCH 08/11] release: Update package.xml version to 5.1.0 --- package.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 792fd4a..eed0525 100644 --- a/package.xml +++ b/package.xml @@ -1,6 +1,6 @@ hpp_universal_robot - 5.0.0 + 5.1.0 Data specific to robots ur5 and ur10 for hpp-corbaserver. From 789a540f150b7dc50f3409d94338b7aa96f74084 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Sun, 30 Jun 2024 19:45:33 +0200 Subject: [PATCH 09/11] release: Update pyproject.toml version to 5.1.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 63a247c..f6835f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ description = "Data specific to ur5 and 10 robots for hpp-corbaserver" license = "BSD-2-Clause" name = "hpp-universal-robot" -version = "5.0.0" +version = "5.1.0" [tool.ruff] extend-exclude = ["cmake"] From 13a8ec66dbb6230b475279486d62b2c584341a43 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 2 Jul 2024 11:52:15 +0200 Subject: [PATCH 10/11] nix ci: cachix only on HPP org --- .github/workflows/nix.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 1ac391b..9488350 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -15,5 +15,6 @@ jobs: - uses: DeterminateSystems/magic-nix-cache-action@main - run: nix --accept-flake-config build -L - run: nix --accept-flake-config run .#cachix push gepetto $(readlink result) + if: github.repository_owner == 'humanoid-path-planner' env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} From 37b5f01713d492e744ba7f36860152b85bb25de0 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 4 Jul 2024 13:37:24 +0200 Subject: [PATCH 11/11] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d3c449..8d2133d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: toml-sort-fix exclude: poetry.lock - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.7 + rev: v18.1.8 hooks: - id: clang-format args: