diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index da80f62fea6109faa16850ca4648b13caff32c5a..eeebff81a8f9f9edd84e6e53bec7243c8115437a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ include: file: #Â choose which jobs to run by including the corresponding files. - '.gitlab/ci/ubuntu_python.gitlab-ci.yml' - - '.gitlab/ci/release/pip_ubuntu.gitlab-ci.yml' + - '.gitlab/ci/release/pip.gitlab-ci.yml' # Since aidge_export_cpp is a pure python package building on windows and on ubuntu doesn't differ # - '.gitlab/ci/windows_python.gitlab-ci.yml' diff --git a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh new file mode 100755 index 0000000000000000000000000000000000000000..4f74488ae41714a4ce03ba7514bf93842768c5ae --- /dev/null +++ b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e +if [[ "$1" == "" ]]; then + echo "build aidge deps in cibuildwheel container before building wheel." + echo "search path defines where the dependencies will be searched." + echo "Hint : In wheel containers, files are mounted on /host by default." + echo "\nusage : ./cibuildwheel_build_deps_before_build_wheel.sh $search_path" +fi +set -x +if [[ $AIDGE_DEPENDENCIES == "" ]]; then # case for aidge_ core + mkdir -p build # creating build if its not already there to hold the build of cpp files + rm -rf build/* # build from scratch +else + for repo in $AIDGE_DEPENDENCIES ; do # case for other projects + search_path=$1 + REPO_PATH=$(find $search_path ! -writable -prune -o -type d \ + -name "$repo" \ + -not -path "*/install/*" \ + -not -path "*/.git/*" \ + -not -path "*/miniconda/*" \ + -not -path "*/conda/*" \ + -not -path "*/.local/*" \ + -not -path "*/lib/*" \ + -not -path "*/$repo/$repo/*" \ + -not -path "*/proc/*" \ + -print -quit) + if [[ -z "$REPO_PATH" ]]; then + echo "ERROR : dependency $repo not found in search_path \"$search_path\". ABORTING." + exit -1 + fi + + cd $REPO_PATH + mkdir -p build # creating build if its not already there to hold the build of cpp files + rm -rf build/* # build from scratch + pip install . -v + cd - + done +fi +set +x +set +e diff --git a/cibuildwheel_build_deps_before_build_wheel.sh b/cibuildwheel_build_deps_before_build_wheel.sh new file mode 100755 index 0000000000000000000000000000000000000000..4f74488ae41714a4ce03ba7514bf93842768c5ae --- /dev/null +++ b/cibuildwheel_build_deps_before_build_wheel.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e +if [[ "$1" == "" ]]; then + echo "build aidge deps in cibuildwheel container before building wheel." + echo "search path defines where the dependencies will be searched." + echo "Hint : In wheel containers, files are mounted on /host by default." + echo "\nusage : ./cibuildwheel_build_deps_before_build_wheel.sh $search_path" +fi +set -x +if [[ $AIDGE_DEPENDENCIES == "" ]]; then # case for aidge_ core + mkdir -p build # creating build if its not already there to hold the build of cpp files + rm -rf build/* # build from scratch +else + for repo in $AIDGE_DEPENDENCIES ; do # case for other projects + search_path=$1 + REPO_PATH=$(find $search_path ! -writable -prune -o -type d \ + -name "$repo" \ + -not -path "*/install/*" \ + -not -path "*/.git/*" \ + -not -path "*/miniconda/*" \ + -not -path "*/conda/*" \ + -not -path "*/.local/*" \ + -not -path "*/lib/*" \ + -not -path "*/$repo/$repo/*" \ + -not -path "*/proc/*" \ + -print -quit) + if [[ -z "$REPO_PATH" ]]; then + echo "ERROR : dependency $repo not found in search_path \"$search_path\". ABORTING." + exit -1 + fi + + cd $REPO_PATH + mkdir -p build # creating build if its not already there to hold the build of cpp files + rm -rf build/* # build from scratch + pip install . -v + cd - + done +fi +set +x +set +e diff --git a/pyproject.toml b/pyproject.toml index 0034cfdd0ce1acd517d4558463416b965b269d7f..9c54a0f16e5c840a28fb46afbf6f5b20f624d582 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,26 @@ build-backend = "setuptools.build_meta" ### No cibuildwheel needed here since onnx is a pure python package. ### To package aidge_onnx run : ### pip wheel -w DEST_DIR . +##################################################### +# CIBUILDWHEEL +[tool.cibuildwheel] +build-frontend = "build" +build=["cp38-manylinux_x86_64"] #Â , "cp39-manylinux_x86_64","cp310-manylinux_x86_64"] +### AIDGE DEPENDENCIES DECLARATION +[tool.cibuildwheel.linux.environment] +AIDGE_DEPENDENCIES = "" # format => "dep_1 dep_2 ... dep_n" +AIDGE_INSTALL="/AIDGE_INSTALL_CIBUILDWHEEL" +[tool.cibuildwheel.windows.environment] +AIDGE_DEPENDENCIES = '@()' # format => '@("dep_1","dep_2", ... ,"dep_n")' +AIDGE_INSTALL="../AIDGE_INSTALL_CIBUILDWHEEL/" +[tool.cibuildwheel.linux] +before-build = [ + "bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh /host" + ] +[tool.cibuildwheel.windows] +before-build = [ + "powershell -File .\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1" + ] ##################################################### # SETUPTOOLS