diff --git a/.gitignore b/.gitignore index 9fbfccca6dfda997d8a0dbfc4b373590feeecad8..81fde16c8c8788938fa26601506a6b9b12c68217 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ install*/ __pycache__ *.pyc *.egg-info +aidge_backend_opencv/_version.py +wheelhouse/* # Mermaid *.mmd @@ -18,4 +20,4 @@ __pycache__ xml*/ # ONNX -*.onnx \ No newline at end of file +*.onnx diff --git a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh index dde9ca9bf115b2931f9885b35a85e0cbd3e4c02a..df6891d6367f90ac7f176eb3d2b13f42e6cdc69f 100644 --- a/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh +++ b/.gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh @@ -7,7 +7,8 @@ if [[ $AIDGE_DEPENDENCIES == "" ]]; then # case for aidge_ core rm -rf build/* # build from scratch else for repo in $AIDGE_DEPENDENCIES ; do # case for other projects - REPO_PATH=$(find /host/data1/is156025/tb256203/dev/eclipse_aidge/aidge_latest/ -type d -name $repo \ + search_path="/host/home/" + REPO_PATH=$(find $search_path -type d -name $repo \ -not -path '*install*' \ -not -path '*.git*' \ -not -path '*miniconda*' \ @@ -16,6 +17,10 @@ else -not -path "*lib*" \ -not -path "*/$repo/$repo" \ -print -quit) + if [[ "$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 diff --git a/.gitlab/ci/cibuildwheel_install_opencv.sh b/.gitlab/ci/cibuildwheel_install_opencv.sh new file mode 100644 index 0000000000000000000000000000000000000000..5fc00298a3ad9625f6e5ac6be0ec3378f75f92d8 --- /dev/null +++ b/.gitlab/ci/cibuildwheel_install_opencv.sh @@ -0,0 +1,23 @@ +git clone https://github.com/opencv/opencv.git +cd opencv +git checkout 4.9.0 +mkdir build +cd build +cmake .. \ + -DENABLE_SOLUTION_FOLDERS=OFF\ + -DBUILD_TESTS=OFF \ + -DBUILD_opencv_ml=ON \ + -DBUILD_opencv_java_bindings_generator=OFF \ + -DBUILD_opencv_js=OFF \ + -DBUILD_opencv_js_bindings_generator=OFF \ + -DBUILD_opencv_objc_bindings_generator=OFF \ + -DBUILD_opencv_python_bindings_generator=OFF \ + -DBUILD_opencv_apps=OFF \ + -DBUILD_opencv_calib3d=OFF \ + -DBUILD_opencv_videoio=OFF \ + -DBUILD_opencv_highgui=OFF \ + -DBUILD_opencv_gapi=OFF \ + + -DBUI +make -j8 +make install diff --git a/pyproject.toml b/pyproject.toml index 4c0d4fd18d9dcb80a56e27adddda5b173f7d0c4e..6254421d8e0dbff4427e38a76f0b8cea610c0f5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,11 +3,9 @@ name = "aidge_backend_opencv" description="Opencv implementations of the operators and tensor of aidge framework" dependencies = [ "numpy>=1.21.6", - "opencv-python", ] requires-python = ">= 3.7" -# dynamic = ["version"] # defined in tool.setuptools_scm -version = "0.1" +dynamic = ["version"] # defined in tool.setuptools_scm readme = "README.md" license = { file = "LICENSE" } classifiers = [ @@ -33,9 +31,9 @@ where = ["."] # list of folders that contain the packages (["."] by default) include = ["aidge_backend_opencv*"] # package names should match these glob patterns (["*"] by default) exclude = ["aidge_backend_opencv.unit_tests*"] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) -# SETUPTOOLS_SCM -# [tool.setuptools_scm] -# write_to = "aidge_backend_opencv/_version.py" +SETUPTOOLS_SCM +[tool.setuptools_scm] +write_to = "aidge_backend_opencv/_version.py" ##################################################### # CIBUILDWHEEL @@ -48,14 +46,15 @@ build-frontend = "build" AIDGE_DEPENDENCIES = "aidge_core" # format => "dep_1 dep_2 ... dep_n" AIDGE_INSTALL="/host/AIDGE_INSTALL_CIBUILDWHEEL" [tool.cibuildwheel.windows.environment] -AIDGE_DEPENDENCIES = "aidge_core" # format => "dep_1","dep_2", ... ,"dep_n" +AIDGE_DEPENDENCIES = ["aidge_core"] # format => "dep_1","dep_2", ... ,"dep_n" AIDGE_INSTALL="../AIDGE_INSTALL_CIBUILDWHEEL/" [tool.cibuildwheel.linux] before-build = [ + "bash .gitlab/ci/cibuildwheel_install_opencv.sh", "bash .gitlab/ci/cibuildwheel_build_deps_before_build_wheel.sh " ] [tool.cibuildwheel.windows] before-build = [ "powershell -File .\\.gitlab\\ci\\cibuildwheel_build_deps_before_build_wheel.ps1" -] \ No newline at end of file +] diff --git a/setup.py b/setup.py index 44d40d4b29b801ad4f7b91446b8c895fbfab48db..2df428c2a335adae29baac2f73765e6b80d31b43 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,6 @@ import sys import os import shutil import pathlib -import subprocess import multiprocessing import sysconfig @@ -12,7 +11,6 @@ from math import ceil import toml from setuptools import setup, Extension -from setuptools import find_packages from setuptools.command.build_ext import build_ext def get_project_name() -> str: