Skip to content
Snippets Groups Projects
Commit 6ab809b6 authored by Grégoire Kubler's avatar Grégoire Kubler Committed by Maxence Naud
Browse files

feat : created install_opencv script for cibuildwheel + cleanup setup.py

parent ff2ad007
No related branches found
No related tags found
1 merge request!18v0.1.3
......@@ -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
......@@ -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
......
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
......@@ -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
]
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment